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
Nested ClassesModifier and TypeClassDescriptionstatic classSession listener. -
Constructor Summary
ConstructorsConstructorDescriptionTyrusEndpointWrapper(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) CreateTyrusEndpointWrapperfor 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 CreateTyrusEndpointWrapperfor 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.nullindicates standalone mode.endpointEventListener- endpoint event listener.parallelBroadcastEnabled-trueif parallel broadcast should be enabled,trueis 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.nullindicates standalone mode.endpointEventListener- endpoint event listener.parallelBroadcastEnabled-trueif parallel broadcast should be enabled,trueis default.- Throws:
DeploymentException- when the endpoint is not valid.
-
-
Method Details
-
doEncode
- Throws:
EncodeExceptionIOException
-
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:
Sessionrepresenting the connection.
-
getEndpointConfig
Get Endpoint configuration.- Returns:
- configuration.
-
toString
-