Package org.glassfish.tyrus.core
Class TyrusEndpointWrapper
- java.lang.Object
-
- org.glassfish.tyrus.core.TyrusEndpointWrapper
-
public class TyrusEndpointWrapper extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static class
TyrusEndpointWrapper.SessionListener
Session listener.
-
Constructor Summary
Constructors Constructor Description TyrusEndpointWrapper(java.lang.Class<? extends Endpoint> endpointClass, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, java.lang.String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, java.lang.Boolean parallelBroadcastEnabled)
CreateTyrusEndpointWrapper
for class that extendsEndpoint
.TyrusEndpointWrapper(Endpoint endpoint, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, java.lang.String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, java.lang.Boolean parallelBroadcastEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Session
createSessionForRemoteEndpoint(TyrusWebSocket socket, java.lang.String subprotocol, java.util.List<Extension> extensions, DebugContext debugContext)
Creates a Session based on theTyrusWebSocket
, subprotocols and extensions.java.lang.Object
doEncode(Session session, java.lang.Object message)
EndpointConfig
getEndpointConfig()
Get Endpoint configuration.java.lang.String
getEndpointPath()
Server-side; Get Endpoint absolute path.java.lang.String
toString()
-
-
-
Constructor Detail
-
TyrusEndpointWrapper
public TyrusEndpointWrapper(java.lang.Class<? extends Endpoint> endpointClass, EndpointConfig configuration, ComponentProviderService componentProvider, WebSocketContainer container, java.lang.String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, java.lang.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, java.lang.String contextPath, ServerEndpointConfig.Configurator configurator, TyrusEndpointWrapper.SessionListener sessionListener, ClusterContext clusterContext, EndpointEventListener endpointEventListener, java.lang.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 Detail
-
doEncode
public java.lang.Object doEncode(Session session, java.lang.Object message) throws EncodeException, java.io.IOException
- Throws:
EncodeException
java.io.IOException
-
getEndpointPath
public java.lang.String getEndpointPath()
Server-side; Get Endpoint absolute path.- Returns:
- endpoint absolute path.
-
createSessionForRemoteEndpoint
public Session createSessionForRemoteEndpoint(TyrusWebSocket socket, java.lang.String subprotocol, java.util.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
public EndpointConfig getEndpointConfig()
Get Endpoint configuration.- Returns:
- configuration.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-