Class JettyClientContainerProvider
- java.lang.Object
-
- javax.websocket.ContainerProvider
-
- org.eclipse.jetty.websocket.jsr356.JettyClientContainerProvider
-
public class JettyClientContainerProvider extends javax.websocket.ContainerProviderClientContainerProviderimplementation.Created by a
ServiceLoadercall in theContainerProvider.getWebSocketContainer()call.
-
-
Constructor Summary
Constructors Constructor Description JettyClientContainerProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.websocket.WebSocketContainergetContainer()Used byContainerProvider.getWebSocketContainer()to get a new instance of the ClientWebSocketContainer.java.lang.ObjectgetContextHandler()static voiduseServerContainer(boolean flag)Add ability of calls toContainerProvider.getWebSocketContainer()to find and return thejavax.websocket.server.ServerContainerfrom the activejavax.servlet.ServletContext.static voiduseSingleton(boolean flag)Change calls toContainerProvider.getWebSocketContainer()to always return a singleton instance of the sameWebSocketContainerstatic booleanwillUseServerContainer()Test ifContainerProvider.getWebSocketContainer()has the ability to find and return thejavax.websocket.server.ServerContainerfrom the activejavax.servlet.ServletContext, before creating a new client basedWebSocketContainer.static booleanwillUseSingleton()Test ifContainerProvider.getWebSocketContainer()will always return a singleton instance of the sameWebSocketContainer
-
-
-
Method Detail
-
useSingleton
public static void useSingleton(boolean flag)
Change calls toContainerProvider.getWebSocketContainer()to always return a singleton instance of the sameWebSocketContainer- Parameters:
flag- true to use a singleton instance ofWebSocketContainerfor all calls toContainerProvider.getWebSocketContainer()
-
willUseSingleton
public static boolean willUseSingleton()
Test ifContainerProvider.getWebSocketContainer()will always return a singleton instance of the sameWebSocketContainer- Returns:
- true if using a singleton instance of
WebSocketContainerfor all calls toContainerProvider.getWebSocketContainer()
-
useServerContainer
public static void useServerContainer(boolean flag)
Add ability of calls toContainerProvider.getWebSocketContainer()to find and return thejavax.websocket.server.ServerContainerfrom the activejavax.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 thejavax.websocket.server.ServerContainerfrom the activejavax.servlet.ServletContextfor all calls toContainerProvider.getWebSocketContainer()from within a Servlet thread.
-
willUseServerContainer
public static boolean willUseServerContainer()
Test ifContainerProvider.getWebSocketContainer()has the ability to find and return thejavax.websocket.server.ServerContainerfrom the activejavax.servlet.ServletContext, before creating a new client basedWebSocketContainer.- Returns:
- true if
WebSocketContainerreturned from calls toContainerProvider.getWebSocketContainer()could be thejavax.websocket.server.ServerContainerfrom the activejavax.servlet.ServletContext
-
getContextHandler
public java.lang.Object getContextHandler()
-
getContainer
protected javax.websocket.WebSocketContainer getContainer()
Used byContainerProvider.getWebSocketContainer()to get a new instance of the ClientWebSocketContainer.- Specified by:
getContainerin classjavax.websocket.ContainerProvider
-
-