Class JakartaWebSocketClientContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketContainer
org.eclipse.jetty.ee10.websocket.jakarta.client.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 AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WebSocketCoreClientprotected Function<WebSocketComponents, WebSocketCoreClient> Fields inherited from class JakartaWebSocketContainer
components, defaultCustomizer, sessionTracker -
Constructor Summary
ConstructorsConstructorDescriptionJakartaWebSocketClientContainer(HttpClient httpClient) Create aWebSocketContainerusing the suppliedHttpClientfor 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.SessionconnectToServer(jakarta.websocket.Endpoint endpoint, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) jakarta.websocket.SessionconnectToServer(Class<?> annotatedEndpointClass, URI path) jakarta.websocket.SessionconnectToServer(Class<? extends jakarta.websocket.Endpoint> endpointClass, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) jakarta.websocket.SessionconnectToServer(Object endpoint, URI path) static ThrowableconvertCause(Throwable error) protected voidprotected voidprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.protected HttpClientprotected WebSocketCoreClientstatic voidsetShutdownContainer(ContainerLifeCycle container) Methods inherited from class JakartaWebSocketContainer
addSessionListener, dump, getByteBufferPool, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getExtensionRegistry, getInstalledExtensions, getObjectFactory, getOpenSessions, getWebSocketComponents, newFrameHandler, notifySessionListeners, removeSessionListener, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSizeMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods 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 aWebSocketContainerusing the suppliedHttpClientfor 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:
connectToServerin interfacejakarta.websocket.WebSocketContainer- Throws:
jakarta.websocket.DeploymentExceptionIOException
-
connectToServer
public jakarta.websocket.Session connectToServer(Class<?> annotatedEndpointClass, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServerin interfacejakarta.websocket.WebSocketContainer- Throws:
jakarta.websocket.DeploymentExceptionIOException
-
connectToServer
public jakarta.websocket.Session connectToServer(jakarta.websocket.Endpoint endpoint, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServerin interfacejakarta.websocket.WebSocketContainer- Throws:
jakarta.websocket.DeploymentExceptionIOException
-
connectToServer
public jakarta.websocket.Session connectToServer(Object endpoint, URI path) throws jakarta.websocket.DeploymentException, IOException - Specified by:
connectToServerin interfacejakarta.websocket.WebSocketContainer- Throws:
jakarta.websocket.DeploymentExceptionIOException
-
getFrameHandlerFactory
- Specified by:
getFrameHandlerFactoryin classJakartaWebSocketContainer
-
getExecutor
- Specified by:
getExecutorin classJakartaWebSocketContainer
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
doClientStart
protected void doClientStart() -
doClientStop
protected void doClientStop() -
getContextHandler
-