Class JakartaWebSocketClientContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.jakarta.common.JakartaWebSocketContainer
org.eclipse.jetty.websocket.jakarta.client.internal.JakartaWebSocketClientContainer
- All Implemented Interfaces:
jakarta.websocket.WebSocketContainer
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
JakartaWebSocketServerContainer
@ManagedObject("JSR356 Client Container")
public class JakartaWebSocketClientContainer
extends JakartaWebSocketContainer
implements jakarta.websocket.WebSocketContainer
Container for Client use of the jakarta.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.jakarta.common.JakartaWebSocketContainer
components, defaultCustomizer, sessionTracker
-
Constructor Summary
ConstructorDescriptionJakartaWebSocketClientContainer
(HttpClient httpClient) Create aWebSocketContainer
using the suppliedHttpClient
for environments where you want to configure SSL/TLS or Proxy behaviors.JakartaWebSocketClientContainer
(WebSocketComponents components) JakartaWebSocketClientContainer
(WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.websocket.Session
connectToServer
(jakarta.websocket.Endpoint endpoint, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) jakarta.websocket.Session
connectToServer
(Class<?> annotatedEndpointClass, URI path) jakarta.websocket.Session
connectToServer
(Class<? extends jakarta.websocket.Endpoint> endpointClass, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) jakarta.websocket.Session
connectToServer
(Object endpoint, 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.jakarta.common.JakartaWebSocketContainer
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 jakarta.websocket.WebSocketContainer
getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
Field Details
-
coreClient
-
coreClientFactory
-
-
Constructor Details
-
JakartaWebSocketClientContainer
public JakartaWebSocketClientContainer() -
JakartaWebSocketClientContainer
Create aWebSocketContainer
using the suppliedHttpClient
for environments where you want to configure SSL/TLS or Proxy behaviors.- Parameters:
httpClient
- the HttpClient instance to use
-
JakartaWebSocketClientContainer
-
JakartaWebSocketClientContainer
public JakartaWebSocketClientContainer(WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientFactory)
-
-
Method Details
-
setShutdownContainer
-
getHttpClient
-
getWebSocketCoreClient
-
convertCause
-
connectToServer
public jakarta.websocket.Session connectToServer(Class<? extends jakarta.websocket.Endpoint> endpointClass, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejakarta.websocket.WebSocketContainer
- Throws:
jakarta.websocket.DeploymentException
IOException
-
connectToServer
public jakarta.websocket.Session connectToServer(Class<?> annotatedEndpointClass, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejakarta.websocket.WebSocketContainer
- Throws:
jakarta.websocket.DeploymentException
IOException
-
connectToServer
public jakarta.websocket.Session connectToServer(jakarta.websocket.Endpoint endpoint, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejakarta.websocket.WebSocketContainer
- Throws:
jakarta.websocket.DeploymentException
IOException
-
connectToServer
public jakarta.websocket.Session connectToServer(Object endpoint, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServer
in interfacejakarta.websocket.WebSocketContainer
- Throws:
jakarta.websocket.DeploymentException
IOException
-
getFrameHandlerFactory
- Specified by:
getFrameHandlerFactory
in classJakartaWebSocketContainer
-
getExecutor
- Specified by:
getExecutor
in classJakartaWebSocketContainer
-
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()
-