Top Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common

public abstract Class JakartaWebSocketContainer

extends ContainerLifeCycle
implements WebSocketContainer, Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable, jakarta.websocket.WebSocketContainer
Imports
java.io.IOException, java.time.Duration, java.util.ArrayList, .HashSet, .List, .Set, java.util.concurrent.Executor, java.util.function.Consumer, jakarta.websocket.Extension, .WebSocketContainer, org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.util.DecoratedObjectFactory, org.eclipse.jetty.util.component.ContainerLifeCycle, .Dumpable, org.eclipse.jetty.websocket.core.Configuration, .WebSocketComponents, .WebSocketExtensionRegistry, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
protected final WebSocketComponents
protected final Configuration.ConfigurationCustomizer
private static final Logger
private final List<JakartaWebSocketSessionListener>
protected final SessionTracker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addSessionListener(JakartaWebSocketSessionListener
the listener
listener
)

Register a WebSocketSessionListener with the container

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public ByteBufferPool
public long
getDefaultAsyncSendTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container.

public int
getDefaultMaxBinaryMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Returns the default maximum size of incoming binary message that this container will buffer.

public long
getDefaultMaxSessionIdleTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Return the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive.

public int
getDefaultMaxTextMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Returns the default maximum size of incoming text message that this container will buffer.

public abstract Executor
public WebSocketExtensionRegistry
protected abstract JakartaWebSocketFrameHandlerFactory
public Set<Extension>
getInstalledExtensions()

Implements jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Return the set of Extensions installed in the container.

public DecoratedObjectFactory
public Set<Session>

Returns:

the set of open sessions
getOpenSessions
()

Used in jakarta.websocket.Session#getOpenSessions()

public WebSocketComponents
public JakartaWebSocketFrameHandler
newFrameHandler(Object websocketPojo, UpgradeRequest upgradeRequest)

public void
notifySessionListeners(Consumer<JakartaWebSocketSessionListener>
the consumer to pass to each listener
consumer
)

Notify Session Listeners of events

public boolean

Returns:

true if listener was present and removed
removeSessionListener
(JakartaWebSocketSessionListener
the listener
listener
)

Remove a WebSocketSessionListener from the container

public void
setAsyncSendTimeout(long
the timeout in milliseconds; use zero or negative value for no timeout
ms
)

Implements jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container.

public void
setDefaultMaxBinaryMessageBufferSize(int
the maximum size of binary message in number of bytes.
max
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Sets the default maximum size of incoming binary message that this container will buffer.

public void
setDefaultMaxSessionIdleTimeout(long
the maximum time in milliseconds; use zero or negative value for no timeout
ms
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Sets the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive.

public void
setDefaultMaxTextMessageBufferSize(int
the maximum size of text message in number of bytes.
max
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Sets the maximum size of incoming text message that this container will buffer.

Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydoStartdoStopdumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans

Field Detail

componentsback to summary
protected final WebSocketComponents components
defaultCustomizerback to summary
protected final Configuration.ConfigurationCustomizer defaultCustomizer
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.ContainerLifeCycle.LOG.

sessionListenersback to summary
private final List<JakartaWebSocketSessionListener> sessionListeners
sessionTrackerback to summary
protected final SessionTracker sessionTracker

Constructor Detail

JakartaWebSocketContainerback to summary
public JakartaWebSocketContainer(WebSocketComponents components)

Method Detail

addSessionListenerback to summary
public void addSessionListener(JakartaWebSocketSessionListener listener)

Register a WebSocketSessionListener with the container

Parameters
listener:JakartaWebSocketSessionListener

the listener

dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
getByteBufferPoolback to summary
public ByteBufferPool getByteBufferPool()
getDefaultAsyncSendTimeoutback to summary
public long getDefaultAsyncSendTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Doc from jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each RemoteEndpoint.

Returns:long

the timeout time in milliseconds.

getDefaultMaxBinaryMessageBufferSizeback to summary
public int getDefaultMaxBinaryMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Returns the default maximum size of incoming binary message that this container will buffer. This default may be overridden on a per session basis using Session#setMaxBinaryMessageBufferSize(int)

Returns:int

the maximum size of incoming binary message in number of bytes.

Annotations
@Override
getDefaultMaxSessionIdleTimeoutback to summary
public long getDefaultMaxSessionIdleTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Return the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. The value may be overridden on a per session basis using Session#setMaxIdleTimeout(long)

Returns:long

the default number of milliseconds after which an idle session in this container will be closed

Annotations
@Override
getDefaultMaxTextMessageBufferSizeback to summary
public int getDefaultMaxTextMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Returns the default maximum size of incoming text message that this container will buffer. This default may be overridden on a per session basis using Session#setMaxTextMessageBufferSize(int)

Returns:int

the maximum size of incoming text message in number of bytes.

Annotations
@Override
getExecutorback to summary
public abstract Executor getExecutor()
getExtensionRegistryback to summary
public WebSocketExtensionRegistry getExtensionRegistry()
getFrameHandlerFactoryback to summary
protected abstract JakartaWebSocketFrameHandlerFactory getFrameHandlerFactory()
getInstalledExtensionsback to summary
public Set<Extension> getInstalledExtensions()

Implements jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Doc from jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Return the set of Extensions installed in the container.

Returns:Set<Extension>

the set of extensions.

Annotations
@Override
Since
JSR356 v1.0
See Also
WebSocketContainer#getInstalledExtensions()
getObjectFactoryback to summary
public DecoratedObjectFactory getObjectFactory()
getOpenSessionsback to summary
public Set<Session> getOpenSessions()

Used in jakarta.websocket.Session#getOpenSessions()

Returns:Set<Session>

the set of open sessions

getWebSocketComponentsback to summary
public WebSocketComponents getWebSocketComponents()
newFrameHandlerback to summary
public JakartaWebSocketFrameHandler newFrameHandler(Object websocketPojo, UpgradeRequest upgradeRequest)
notifySessionListenersback to summary
public void notifySessionListeners(Consumer<JakartaWebSocketSessionListener> consumer)

Notify Session Listeners of events

Parameters
consumer:Consumer<JakartaWebSocketSessionListener>

the consumer to pass to each listener

removeSessionListenerback to summary
public boolean removeSessionListener(JakartaWebSocketSessionListener listener)

Remove a WebSocketSessionListener from the container

Parameters
listener:JakartaWebSocketSessionListener

the listener

Returns:boolean

true if listener was present and removed

setAsyncSendTimeoutback to summary
public void setAsyncSendTimeout(long ms)

Implements jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Doc from jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each RemoteEndpoint.

Parameters
ms:long

the timeout in milliseconds; use zero or negative value for no timeout

Annotations
@Override
setDefaultMaxBinaryMessageBufferSizeback to summary
public void setDefaultMaxBinaryMessageBufferSize(int max)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Sets the default maximum size of incoming binary message that this container will buffer.

Parameters
max:int

the maximum size of binary message in number of bytes.

Annotations
@Override
setDefaultMaxSessionIdleTimeoutback to summary
public void setDefaultMaxSessionIdleTimeout(long ms)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Sets the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. The value may be overridden on a per session basis using Session#setMaxIdleTimeout(long)

Parameters
ms:long

the maximum time in milliseconds; use zero or negative value for no timeout

Annotations
@Override
setDefaultMaxTextMessageBufferSizeback to summary
public void setDefaultMaxTextMessageBufferSize(int max)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Sets the maximum size of incoming text message that this container will buffer.

Parameters
max:int

the maximum size of text message in number of bytes.

Annotations
@Override