Class JettyClientContainerProvider


  • public class JettyClientContainerProvider
    extends javax.websocket.ContainerProvider
    Client ContainerProvider implementation.

    Created by a ServiceLoader call in the ContainerProvider.getWebSocketContainer() call.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.websocket.WebSocketContainer getContainer()
      Used by ContainerProvider.getWebSocketContainer() to get a new instance of the Client WebSocketContainer.
      java.lang.Object getContextHandler()  
      static void useServerContainer​(boolean flag)
      Add ability of calls to ContainerProvider.getWebSocketContainer() to find and return the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext.
      static void useSingleton​(boolean flag)
      Change calls to ContainerProvider.getWebSocketContainer() to always return a singleton instance of the same WebSocketContainer
      static boolean willUseServerContainer()
      Test if ContainerProvider.getWebSocketContainer() has the ability to find and return the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext, before creating a new client based WebSocketContainer.
      static boolean willUseSingleton()
      Test if ContainerProvider.getWebSocketContainer() will always return a singleton instance of the same WebSocketContainer
      • Methods inherited from class javax.websocket.ContainerProvider

        getWebSocketContainer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JettyClientContainerProvider

        public JettyClientContainerProvider()
    • Method Detail

      • useSingleton

        public static void useSingleton​(boolean flag)
        Change calls to ContainerProvider.getWebSocketContainer() to always return a singleton instance of the same WebSocketContainer
        Parameters:
        flag - true to use a singleton instance of WebSocketContainer for all calls to ContainerProvider.getWebSocketContainer()
      • willUseSingleton

        public static boolean willUseSingleton()
        Test if ContainerProvider.getWebSocketContainer() will always return a singleton instance of the same WebSocketContainer
        Returns:
        true if using a singleton instance of WebSocketContainer for all calls to ContainerProvider.getWebSocketContainer()
      • useServerContainer

        public static void useServerContainer​(boolean flag)
        Add ability of calls to ContainerProvider.getWebSocketContainer() to find and return the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext.

        This will only work if the call to ContainerProvider.getWebSocketContainer() occurs within a thread being processed by the Servlet container.

        Parameters:
        flag - true to to use return the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext for all calls to ContainerProvider.getWebSocketContainer() from within a Servlet thread.
      • willUseServerContainer

        public static boolean willUseServerContainer()
        Test if ContainerProvider.getWebSocketContainer() has the ability to find and return the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext, before creating a new client based WebSocketContainer.
        Returns:
        true if WebSocketContainer returned from calls to ContainerProvider.getWebSocketContainer() could be the javax.websocket.server.ServerContainer from the active javax.servlet.ServletContext
      • getContextHandler

        public java.lang.Object getContextHandler()
      • getContainer

        protected javax.websocket.WebSocketContainer getContainer()
        Used by ContainerProvider.getWebSocketContainer() to get a new instance of the Client WebSocketContainer.
        Specified by:
        getContainer in class javax.websocket.ContainerProvider