Class ServerContainer

  • All Implemented Interfaces:
    javax.websocket.server.ServerContainer, javax.websocket.WebSocketContainer, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.websocket.common.scopes.WebSocketContainerScope

    @ManagedObject("JSR356 Server Container")
    public class ServerContainer
    extends org.eclipse.jetty.websocket.jsr356.ClientContainer
    implements javax.websocket.server.ServerContainer
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerContainer​(org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration configuration, java.util.concurrent.Executor executor)
      Deprecated.
      use ServerContainer(NativeWebSocketConfiguration, HttpClient) instead
      ServerContainer​(org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration configuration, org.eclipse.jetty.client.HttpClient httpClient)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEndpoint​(java.lang.Class<?> endpointClass)  
      void addEndpoint​(javax.websocket.server.ServerEndpointConfig config)  
      protected void doStart()  
      long getDefaultAsyncSendTimeout()  
      int getDefaultMaxBinaryMessageBufferSize()  
      long getDefaultMaxSessionIdleTimeout()  
      int getDefaultMaxTextMessageBufferSize()  
      ServerEndpointMetadata getServerEndpointMetadata​(java.lang.Class<?> endpoint, javax.websocket.server.ServerEndpointConfig config)  
      static javax.websocket.WebSocketContainer getWebSocketContainer()
      Get the WebSocketContainer out of the current ThreadLocal reference of the active ContextHandler.
      org.eclipse.jetty.websocket.server.WebSocketServerFactory getWebSocketServerFactory()  
      org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance newClientEndpointInstance​(java.lang.Object endpoint, javax.websocket.server.ServerEndpointConfig config, java.lang.String path)  
      void setAsyncSendTimeout​(long ms)  
      void setDefaultMaxBinaryMessageBufferSize​(int max)  
      void setDefaultMaxSessionIdleTimeout​(long ms)  
      void setDefaultMaxTextMessageBufferSize​(int max)  
      • Methods inherited from class org.eclipse.jetty.websocket.jsr356.ClientContainer

        addSessionListener, connectToServer, connectToServer, connectToServer, connectToServer, doStop, getBufferPool, getClient, getClientEndpointMetadata, getDecoderFactory, getEncoderFactory, getExecutor, getInstalledExtensions, getObjectFactory, getOpenSessions, getPolicy, getSessionListeners, getSslContextFactory, newClientEndpointInstance, removeSessionListener
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface javax.websocket.WebSocketContainer

        connectToServer, connectToServer, connectToServer, connectToServer, getInstalledExtensions
      • Methods inherited from interface org.eclipse.jetty.websocket.common.scopes.WebSocketContainerScope

        isRunning
    • Constructor Detail

      • ServerContainer

        @Deprecated
        public ServerContainer​(org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration configuration,
                               java.util.concurrent.Executor executor)
        Deprecated.
        use ServerContainer(NativeWebSocketConfiguration, HttpClient) instead
        Parameters:
        configuration - the NativeWebSocketConfiguration to use
        executor - not used
      • ServerContainer

        public ServerContainer​(org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration configuration,
                               org.eclipse.jetty.client.HttpClient httpClient)
        Parameters:
        configuration - the NativeWebSocketConfiguration to use
        httpClient - the HttpClient instance to use
    • Method Detail

      • getWebSocketContainer

        public static javax.websocket.WebSocketContainer getWebSocketContainer()
        Get the WebSocketContainer out of the current ThreadLocal reference of the active ContextHandler.
        Returns:
        the WebSocketContainer if found, null if not found.
      • newClientEndpointInstance

        public org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance newClientEndpointInstance​(java.lang.Object endpoint,
                                                                                                       javax.websocket.server.ServerEndpointConfig config,
                                                                                                       java.lang.String path)
      • addEndpoint

        public void addEndpoint​(java.lang.Class<?> endpointClass)
                         throws javax.websocket.DeploymentException
        Specified by:
        addEndpoint in interface javax.websocket.server.ServerContainer
        Throws:
        javax.websocket.DeploymentException
      • addEndpoint

        public void addEndpoint​(javax.websocket.server.ServerEndpointConfig config)
                         throws javax.websocket.DeploymentException
        Specified by:
        addEndpoint in interface javax.websocket.server.ServerContainer
        Throws:
        javax.websocket.DeploymentException
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.websocket.jsr356.ClientContainer
        Throws:
        java.lang.Exception
      • getServerEndpointMetadata

        public ServerEndpointMetadata getServerEndpointMetadata​(java.lang.Class<?> endpoint,
                                                                javax.websocket.server.ServerEndpointConfig config)
                                                         throws javax.websocket.DeploymentException
        Throws:
        javax.websocket.DeploymentException
      • getDefaultAsyncSendTimeout

        public long getDefaultAsyncSendTimeout()
        Specified by:
        getDefaultAsyncSendTimeout in interface javax.websocket.WebSocketContainer
        Overrides:
        getDefaultAsyncSendTimeout in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • getDefaultMaxBinaryMessageBufferSize

        public int getDefaultMaxBinaryMessageBufferSize()
        Specified by:
        getDefaultMaxBinaryMessageBufferSize in interface javax.websocket.WebSocketContainer
        Overrides:
        getDefaultMaxBinaryMessageBufferSize in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • getDefaultMaxSessionIdleTimeout

        public long getDefaultMaxSessionIdleTimeout()
        Specified by:
        getDefaultMaxSessionIdleTimeout in interface javax.websocket.WebSocketContainer
        Overrides:
        getDefaultMaxSessionIdleTimeout in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • getDefaultMaxTextMessageBufferSize

        public int getDefaultMaxTextMessageBufferSize()
        Specified by:
        getDefaultMaxTextMessageBufferSize in interface javax.websocket.WebSocketContainer
        Overrides:
        getDefaultMaxTextMessageBufferSize in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • getWebSocketServerFactory

        public org.eclipse.jetty.websocket.server.WebSocketServerFactory getWebSocketServerFactory()
      • setAsyncSendTimeout

        public void setAsyncSendTimeout​(long ms)
        Specified by:
        setAsyncSendTimeout in interface javax.websocket.WebSocketContainer
        Overrides:
        setAsyncSendTimeout in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • setDefaultMaxBinaryMessageBufferSize

        public void setDefaultMaxBinaryMessageBufferSize​(int max)
        Specified by:
        setDefaultMaxBinaryMessageBufferSize in interface javax.websocket.WebSocketContainer
        Overrides:
        setDefaultMaxBinaryMessageBufferSize in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • setDefaultMaxSessionIdleTimeout

        public void setDefaultMaxSessionIdleTimeout​(long ms)
        Specified by:
        setDefaultMaxSessionIdleTimeout in interface javax.websocket.WebSocketContainer
        Overrides:
        setDefaultMaxSessionIdleTimeout in class org.eclipse.jetty.websocket.jsr356.ClientContainer
      • setDefaultMaxTextMessageBufferSize

        public void setDefaultMaxTextMessageBufferSize​(int max)
        Specified by:
        setDefaultMaxTextMessageBufferSize in interface javax.websocket.WebSocketContainer
        Overrides:
        setDefaultMaxTextMessageBufferSize in class org.eclipse.jetty.websocket.jsr356.ClientContainer