Class JavaxWebSocketClientContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer
- All Implemented Interfaces:
javax.websocket.WebSocketContainer
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
JavaxWebSocketServerContainer
@ManagedObject("JSR356 Client Container")
public class JavaxWebSocketClientContainer
extends JavaxWebSocketContainer
implements javax.websocket.WebSocketContainer
Container for Client use of the javax.websocket API.
This should be specific to a JVM if run in a standalone mode. or specific to a WebAppContext if running on the Jetty server.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Modifier and TypeFieldDescriptionprotected WebSocketCoreClient
protected Function<WebSocketComponents,
WebSocketCoreClient> Fields inherited from class org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
components, defaultCustomizer, sessionTracker
-
Constructor Summary
ConstructorDescriptionJavaxWebSocketClientContainer
(HttpClient httpClient) Create aWebSocketContainer
using the suppliedHttpClient
for environments where you want to configure SSL/TLS or Proxy behaviors.JavaxWebSocketClientContainer
(WebSocketComponents components) JavaxWebSocketClientContainer
(WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionjavax.websocket.Session
connectToServer
(Class<?> annotatedEndpointClass, URI path) javax.websocket.Session
connectToServer
(Class<? extends javax.websocket.Endpoint> endpointClass, javax.websocket.ClientEndpointConfig providedConfig, URI path) javax.websocket.Session
connectToServer
(Object endpoint, URI path) javax.websocket.Session
connectToServer
(javax.websocket.Endpoint endpoint, javax.websocket.ClientEndpointConfig providedConfig, URI path) static Throwable
convertCause
(Throwable error) protected void
protected void
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.protected HttpClient
protected WebSocketCoreClient
static void
setShutdownContainer
(ContainerLifeCycle container) Methods inherited from class org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
addSessionListener, dump, getBufferPool, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getExtensionRegistry, getInstalledExtensions, getObjectFactory, getOpenSessions, getWebSocketComponents, newFrameHandler, notifySessionListeners, removeSessionListener, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
Methods inherited from interface javax.websocket.WebSocketContainer
getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
Field Details
-
coreClient
-
coreClientFactory
-
-
Constructor Details
-
JavaxWebSocketClientContainer
public JavaxWebSocketClientContainer() -
JavaxWebSocketClientContainer
Create aWebSocketContainer
using the suppliedHttpClient
for environments where you want to configure SSL/TLS or Proxy behaviors.- Parameters:
httpClient
- the HttpClient instance to use
-
JavaxWebSocketClientContainer
-
JavaxWebSocketClientContainer
public JavaxWebSocketClientContainer(WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientFactory)
-
-
Method Details
-
setShutdownContainer
-
getHttpClient
-
getWebSocketCoreClient
-
convertCause
-
connectToServer
public javax.websocket.Session connectToServer(Class<? extends javax.websocket.Endpoint> endpointClass, javax.websocket.ClientEndpointConfig providedConfig, URI path) throws javax.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejavax.websocket.WebSocketContainer
- Throws:
javax.websocket.DeploymentException
IOException
-
connectToServer
public javax.websocket.Session connectToServer(Class<?> annotatedEndpointClass, URI path) throws javax.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejavax.websocket.WebSocketContainer
- Throws:
javax.websocket.DeploymentException
IOException
-
connectToServer
public javax.websocket.Session connectToServer(javax.websocket.Endpoint endpoint, javax.websocket.ClientEndpointConfig providedConfig, URI path) throws javax.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejavax.websocket.WebSocketContainer
- Throws:
javax.websocket.DeploymentException
IOException
-
connectToServer
public javax.websocket.Session connectToServer(Object endpoint, URI path) throws javax.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejavax.websocket.WebSocketContainer
- Throws:
javax.websocket.DeploymentException
IOException
-
getFrameHandlerFactory
- Specified by:
getFrameHandlerFactory
in classJavaxWebSocketContainer
-
getExecutor
- Specified by:
getExecutor
in classJavaxWebSocketContainer
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classContainerLifeCycle
- Throws:
AbstractLifeCycle.StopException
- If thrown, the lifecycle will immediately be stopped.Exception
- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
doClientStart
protected void doClientStart() -
doClientStop
protected void doClientStop()
-