Class 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
    • Constructor Detail

      • TyrusEndpointWrapper

        public TyrusEndpointWrapper​(java.lang.Class<? extends Endpoint> endpointClass,
                                    EndpointConfig configuration,
                                    ComponentProviderService componentProvider,
                                    WebSocketContainer container,
                                    java.lang.String contextPath,
                                    jakarta.websocket.server.ServerEndpointConfig.Configurator configurator,
                                    TyrusEndpointWrapper.SessionListener sessionListener,
                                    ClusterContext clusterContext,
                                    EndpointEventListener endpointEventListener,
                                    java.lang.Boolean parallelBroadcastEnabled)
                             throws DeploymentException
        Create TyrusEndpointWrapper for class that extends Endpoint.
        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,
                                    jakarta.websocket.server.ServerEndpointConfig.Configurator configurator,
                                    TyrusEndpointWrapper.SessionListener sessionListener,
                                    ClusterContext clusterContext,
                                    EndpointEventListener endpointEventListener,
                                    java.lang.Boolean parallelBroadcastEnabled)
                             throws DeploymentException
        Create TyrusEndpointWrapper for Endpoint instance or AnnotatedEndpoint instance.
        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

      • 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 the TyrusWebSocket, 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 class java.lang.Object