Class JettyWebSocketServerContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer
- All Implemented Interfaces:
EventListener
,org.eclipse.jetty.util.component.Container
,org.eclipse.jetty.util.component.Destroyable
,org.eclipse.jetty.util.component.Dumpable
,org.eclipse.jetty.util.component.Dumpable.DumpableContainer
,org.eclipse.jetty.util.component.LifeCycle
,org.eclipse.jetty.util.component.LifeCycle.Listener
,org.eclipse.jetty.websocket.api.WebSocketContainer
,org.eclipse.jetty.websocket.api.WebSocketPolicy
public class JettyWebSocketServerContainer
extends org.eclipse.jetty.util.component.ContainerLifeCycle
implements org.eclipse.jetty.websocket.api.WebSocketContainer, org.eclipse.jetty.websocket.api.WebSocketPolicy, org.eclipse.jetty.util.component.LifeCycle.Listener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
-
Field Summary
FieldsFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING
Fields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapping
(String pathSpec, Class<?> endpointClass) void
addMapping
(String pathSpec, JettyWebSocketCreator creator) void
addSessionListener
(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener) void
dump
(Appendable out, String indent) ensureContainer
(jakarta.servlet.ServletContext servletContext) org.eclipse.jetty.websocket.api.WebSocketBehavior
getContainer
(jakarta.servlet.ServletContext servletContext) int
long
long
long
Collection<org.eclipse.jetty.websocket.api.Session>
int
boolean
void
notifySessionListeners
(Consumer<org.eclipse.jetty.websocket.api.WebSocketSessionListener> consumer) boolean
removeSessionListener
(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener) void
setAutoFragment
(boolean autoFragment) void
setIdleTimeout
(Duration duration) void
setInputBufferSize
(int size) void
setMaxBinaryMessageSize
(long size) void
setMaxFrameSize
(long maxFrameSize) void
setMaxTextMessageSize
(long size) void
setOutputBufferSize
(int size) boolean
upgrade
(JettyWebSocketCreator creator, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) An immediate programmatic WebSocket upgrade that does not register a mapping or create aWebSocketUpgradeFilter
.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, 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
dumpSelf
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
-
Field Details
-
JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE
-
-
Method Details
-
getContainer
public static JettyWebSocketServerContainer getContainer(jakarta.servlet.ServletContext servletContext) -
ensureContainer
public static JettyWebSocketServerContainer ensureContainer(jakarta.servlet.ServletContext servletContext) -
addMapping
-
addMapping
-
upgrade
public boolean upgrade(JettyWebSocketCreator creator, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException An immediate programmatic WebSocket upgrade that does not register a mapping or create aWebSocketUpgradeFilter
.- Parameters:
creator
- the WebSocketCreator to use.request
- the HttpServletRequest.response
- the HttpServletResponse.- Returns:
- true if the connection was successfully upgraded to WebSocket.
- Throws:
IOException
- if an I/O error occurs.
-
getExecutor
- Specified by:
getExecutor
in interfaceorg.eclipse.jetty.websocket.api.WebSocketContainer
-
addSessionListener
public void addSessionListener(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener) - Specified by:
addSessionListener
in interfaceorg.eclipse.jetty.websocket.api.WebSocketContainer
-
removeSessionListener
public boolean removeSessionListener(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener) - Specified by:
removeSessionListener
in interfaceorg.eclipse.jetty.websocket.api.WebSocketContainer
-
notifySessionListeners
public void notifySessionListeners(Consumer<org.eclipse.jetty.websocket.api.WebSocketSessionListener> consumer) - Specified by:
notifySessionListeners
in interfaceorg.eclipse.jetty.websocket.api.WebSocketContainer
-
getOpenSessions
- Specified by:
getOpenSessions
in interfaceorg.eclipse.jetty.websocket.api.WebSocketContainer
-
getBehavior
public org.eclipse.jetty.websocket.api.WebSocketBehavior getBehavior()- Specified by:
getBehavior
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getIdleTimeout
- Specified by:
getIdleTimeout
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getInputBufferSize
public int getInputBufferSize()- Specified by:
getInputBufferSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getOutputBufferSize
public int getOutputBufferSize()- Specified by:
getOutputBufferSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getMaxBinaryMessageSize
public long getMaxBinaryMessageSize()- Specified by:
getMaxBinaryMessageSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getMaxTextMessageSize
public long getMaxTextMessageSize()- Specified by:
getMaxTextMessageSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
getMaxFrameSize
public long getMaxFrameSize()- Specified by:
getMaxFrameSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
isAutoFragment
public boolean isAutoFragment()- Specified by:
isAutoFragment
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setIdleTimeout
- Specified by:
setIdleTimeout
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setInputBufferSize
public void setInputBufferSize(int size) - Specified by:
setInputBufferSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setOutputBufferSize
public void setOutputBufferSize(int size) - Specified by:
setOutputBufferSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setMaxBinaryMessageSize
public void setMaxBinaryMessageSize(long size) - Specified by:
setMaxBinaryMessageSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setMaxTextMessageSize
public void setMaxTextMessageSize(long size) - Specified by:
setMaxTextMessageSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setMaxFrameSize
public void setMaxFrameSize(long maxFrameSize) - Specified by:
setMaxFrameSize
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
setAutoFragment
public void setAutoFragment(boolean autoFragment) - Specified by:
setAutoFragment
in interfaceorg.eclipse.jetty.websocket.api.WebSocketPolicy
-
dump
- Specified by:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
- Overrides:
dump
in classorg.eclipse.jetty.util.component.ContainerLifeCycle
- Throws:
IOException
-