Interface IWSAcceptor
- All Superinterfaces:
org.eclipse.net4j.util.collection.Closeable, IAcceptor, org.eclipse.net4j.util.container.IContainer<IConnector>, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.properties.IPropertiesContainer
A Net4j acceptor that receives message connections from a WebSocket server integration after the WebSocket upgrade.
The integration supplies upgrade handling and creates an MessageConnector.IMessageConnection. Ownership of the underlying
server and network listener depends on the integration; with Jetty, the embedding application owns the Jetty server
and listener. This acceptor routes the resulting connection into the Net4j connector lifecycle, applies its transport
configuration, and tracks the server connector.
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E>, org.eclipse.net4j.util.container.IContainer.Persistable<E>, org.eclipse.net4j.util.container.IContainer.Persistence<E>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(MessageConnector.IMessageConnection connection) Attaches a WebSocket message connection accepted by a server provider to this Net4j acceptor.getName()Returns the route name used by WebSocket clients to select this acceptor.getType()Returns the transport factory type represented by this acceptor, eitherwsorwss.Methods inherited from interface org.eclipse.net4j.util.collection.Closeable
close, isClosedMethods inherited from interface IAcceptor
getAcceptedConnectorsMethods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmptyMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListenerMethods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer
properties
-
Method Details
-
getName
String getName()Returns the route name used by WebSocket clients to select this acceptor.- Returns:
- this acceptor's name
-
getType
String getType()Returns the transport factory type represented by this acceptor, eitherwsorwss. A server provider can use this value to select the appropriate upgrade and security configuration while routing an accepted connection by name.- Returns:
- the WS or WSS transport type
- Since:
- 2.0
-
accept
Attaches a WebSocket message connection accepted by a server provider to this Net4j acceptor. Ownership of the open connection transfers to this method on invocation. If acceptance is rejected or connector preparation or activation fails, the connection is aborted before the failure is propagated. On success, the created server connector owns the connection and closes it when the connector or this acceptor is deactivated. The server integration supplies protocol-upgrade handling and creates theMessageConnector.IMessageConnection; ownership of its server and listener is integration-specific. This method creates and activates the server-side Net4j connector and applies this acceptor's transport configuration.- Parameters:
connection- the accepted, open message connection whose lifetime is transferred to the Net4j connector- Since:
- 2.0
-