Class JettyClientContainerProvider
- java.lang.Object
-
- javax.websocket.ContainerProvider
-
- org.eclipse.jetty.websocket.jsr356.JettyClientContainerProvider
-
public class JettyClientContainerProvider extends javax.websocket.ContainerProvider
ClientContainerProvider
implementation.Created by a
ServiceLoader
call 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.WebSocketContainer
getContainer()
Used byContainerProvider.getWebSocketContainer()
to get a new instance of the ClientWebSocketContainer
.java.lang.Object
getContextHandler()
static void
useServerContainer(boolean flag)
Add ability of calls toContainerProvider.getWebSocketContainer()
to find and return thejavax.websocket.server.ServerContainer
from the activejavax.servlet.ServletContext
.static void
useSingleton(boolean flag)
Change calls toContainerProvider.getWebSocketContainer()
to always return a singleton instance of the sameWebSocketContainer
static boolean
willUseServerContainer()
Test ifContainerProvider.getWebSocketContainer()
has the ability to find and return thejavax.websocket.server.ServerContainer
from the activejavax.servlet.ServletContext
, before creating a new client basedWebSocketContainer
.static boolean
willUseSingleton()
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 ofWebSocketContainer
for 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
WebSocketContainer
for all calls toContainerProvider.getWebSocketContainer()
-
useServerContainer
public static void useServerContainer(boolean flag)
Add ability of calls toContainerProvider.getWebSocketContainer()
to find and return thejavax.websocket.server.ServerContainer
from 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.ServerContainer
from the activejavax.servlet.ServletContext
for 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.ServerContainer
from the activejavax.servlet.ServletContext
, before creating a new client basedWebSocketContainer
.- Returns:
- true if
WebSocketContainer
returned from calls toContainerProvider.getWebSocketContainer()
could be thejavax.websocket.server.ServerContainer
from 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:
getContainer
in classjavax.websocket.ContainerProvider
-
-