Package org.glassfish.tyrus.core
Class TyrusEndpointWrapper
java.lang.Object
org.glassfish.tyrus.core.TyrusEndpointWrapper
Wraps the registered application class.
There is one TyrusEndpointWrapper
for each application class, which handles all the methods.
- Author:
- Danny Coward, Stepan Kopriva, Martin Matula, Pavel Bucek
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Session listener. -
Constructor Summary
ConstructorDescriptionTyrusEndpointWrapper
(Endpoint endpoint, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, Boolean parallelBroadcastEnabled) TyrusEndpointWrapper
(Class<? extends Endpoint> endpointClass, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, Boolean parallelBroadcastEnabled) CreateTyrusEndpointWrapper
for class that extendsEndpoint
. -
Method Summary
Modifier and TypeMethodDescriptioncreateSessionForRemoteEndpoint
(TyrusWebSocket socket, String subprotocol, List<Extension> extensions, DebugContext debugContext) Creates a Session based on theTyrusWebSocket
, subprotocols and extensions.Get Endpoint configuration.Server-side; Get Endpoint absolute path.toString()
-
Constructor Details
-
TyrusEndpointWrapper
public TyrusEndpointWrapper(Class<? extends Endpoint> endpointClass, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, Boolean parallelBroadcastEnabled) throws DeploymentException CreateTyrusEndpointWrapper
for class that extendsEndpoint
.- Parameters:
endpointClass
- endpoint class for which the wrapper is created.configuration
- endpoint configuration.componentProvider
- component provider.container
- container where the wrapper is running.contextPath
- context path of the application.configurator
- endpoint configurator.sessionListener
- session listener.clusterContext
- cluster context instance.null
indicates standalone mode.endpointEventListener
- endpoint event listener.parallelBroadcastEnabled
-true
if parallel broadcast should be enabled,true
is default.- Throws:
DeploymentException
- when the endpoint is not valid.
-
TyrusEndpointWrapper
public TyrusEndpointWrapper(Endpoint endpoint, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, Boolean parallelBroadcastEnabled) throws DeploymentException - Parameters:
endpoint
- endpoint instance for which the wrapper is created.configuration
- endpoint configuration.componentProvider
- component provider.container
- container where the wrapper is running.contextPath
- context path of the application.configurator
- endpoint configurator.sessionListener
- session listener.clusterContext
- cluster context instance.null
indicates standalone mode.endpointEventListener
- endpoint event listener.parallelBroadcastEnabled
-true
if parallel broadcast should be enabled,true
is default.- Throws:
DeploymentException
- when the endpoint is not valid.
-
-
Method Details
-
doEncode
- Throws:
EncodeException
IOException
-
getEndpointPath
Server-side; Get Endpoint absolute path.- Returns:
- endpoint absolute path.
-
createSessionForRemoteEndpoint
public Session createSessionForRemoteEndpoint(TyrusWebSocket socket, String subprotocol, List<Extension> extensions, DebugContext debugContext) Creates a Session based on theTyrusWebSocket
, subprotocols and extensions.- Parameters:
socket
- the other end of the connection.subprotocol
- used.extensions
- extensions used.debugContext
- debug context.- Returns:
Session
representing the connection.
-
getEndpointConfig
Get Endpoint configuration.- Returns:
- configuration.
-
toString
-