Class JakartaWebSocketServerContainer
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
org.eclipse.jetty.websocket.jakarta.server.internal.JakartaWebSocketServerContainer
- All Implemented Interfaces:
jakarta.websocket.server.ServerContainer
,jakarta.websocket.WebSocketContainer
,EventListener
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,LifeCycle.Listener
@ManagedObject("JSR356 Server Container")
public class JakartaWebSocketServerContainer
extends JakartaWebSocketClientContainer
implements jakarta.websocket.server.ServerContainer, LifeCycle.Listener
-
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
Fields inherited from class org.eclipse.jetty.websocket.jakarta.client.internal.JakartaWebSocketClientContainer
coreClient, coreClientFactory
Fields inherited from class org.eclipse.jetty.websocket.jakarta.common.JakartaWebSocketContainer
components, defaultCustomizer, sessionTracker
-
Constructor Summary
ConstructorDescriptionJakartaWebSocketServerContainer
(WebSocketMappings webSocketMappings, WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientSupplier) Main entry point forJakartaWebSocketServletContainerInitializer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEndpoint
(jakarta.websocket.server.ServerEndpointConfig providedConfig) void
addEndpoint
(Class<?> endpointClass) protected void
protected void
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.ensureContainer
(jakarta.servlet.ServletContext servletContext) getContainer
(jakarta.servlet.ServletContext servletContext) void
upgradeHttpToWebSocket
(Object httpServletRequest, Object httpServletResponse, jakarta.websocket.server.ServerEndpointConfig sec, Map<String, String> pathParameters) Methods inherited from class org.eclipse.jetty.websocket.jakarta.client.internal.JakartaWebSocketClientContainer
connectToServer, connectToServer, connectToServer, connectToServer, convertCause, doStop, getExecutor, getHttpClient, getWebSocketCoreClient, setShutdownContainer
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 org.eclipse.jetty.util.component.LifeCycle.Listener
lifeCycleFailure, lifeCycleStarted, lifeCycleStarting, lifeCycleStopped, lifeCycleStopping
Methods inherited from interface jakarta.websocket.WebSocketContainer
connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
Field Details
-
PATH_PARAM_ATTRIBUTE
- See Also:
-
JAKARTA_WEBSOCKET_CONTAINER_ATTRIBUTE
-
-
Constructor Details
-
JakartaWebSocketServerContainer
public JakartaWebSocketServerContainer(WebSocketMappings webSocketMappings, WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientSupplier) Main entry point forJakartaWebSocketServletContainerInitializer
.- Parameters:
webSocketMappings
- theWebSocketMappings
that this container belongs tocomponents
- theWebSocketComponents
instance to usecoreClientSupplier
- the supplier of theWebSocketCoreClient
instance to use
-
-
Method Details
-
getContainer
public static JakartaWebSocketServerContainer getContainer(jakarta.servlet.ServletContext servletContext) -
ensureContainer
public static JakartaWebSocketServerContainer ensureContainer(jakarta.servlet.ServletContext servletContext) -
getFrameHandlerFactory
- Overrides:
getFrameHandlerFactory
in classJakartaWebSocketClientContainer
-
addEndpoint
- Specified by:
addEndpoint
in interfacejakarta.websocket.server.ServerContainer
- Throws:
jakarta.websocket.DeploymentException
-
addEndpoint
public void addEndpoint(jakarta.websocket.server.ServerEndpointConfig providedConfig) throws jakarta.websocket.DeploymentException - Specified by:
addEndpoint
in interfacejakarta.websocket.server.ServerContainer
- Throws:
jakarta.websocket.DeploymentException
-
upgradeHttpToWebSocket
public void upgradeHttpToWebSocket(Object httpServletRequest, Object httpServletResponse, jakarta.websocket.server.ServerEndpointConfig sec, Map<String, String> pathParameters) throws IOException, jakarta.websocket.DeploymentException- Throws:
IOException
jakarta.websocket.DeploymentException
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classJakartaWebSocketClientContainer
- 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
-
doClientStart
protected void doClientStart()- Overrides:
doClientStart
in classJakartaWebSocketClientContainer
-
doClientStop
protected void doClientStop()- Overrides:
doClientStop
in classJakartaWebSocketClientContainer
-