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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields 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 Type
    Method
    Description
    void
    addMapping(String pathSpec, Class<?> endpointClass)
     
    void
     
    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
     
    void
     
    void
     
    void
    setMaxFrameSize(long maxFrameSize)
     
    void
     
    void
     
    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 a WebSocketUpgradeFilter.

    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

      public static final String 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

      public void addMapping(String pathSpec, JettyWebSocketCreator creator)
    • addMapping

      public void addMapping(String pathSpec, Class<?> endpointClass)
    • 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 a WebSocketUpgradeFilter.
      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

      public Executor getExecutor()
      Specified by:
      getExecutor in interface org.eclipse.jetty.websocket.api.WebSocketContainer
    • addSessionListener

      public void addSessionListener(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener)
      Specified by:
      addSessionListener in interface org.eclipse.jetty.websocket.api.WebSocketContainer
    • removeSessionListener

      public boolean removeSessionListener(org.eclipse.jetty.websocket.api.WebSocketSessionListener listener)
      Specified by:
      removeSessionListener in interface org.eclipse.jetty.websocket.api.WebSocketContainer
    • notifySessionListeners

      public void notifySessionListeners(Consumer<org.eclipse.jetty.websocket.api.WebSocketSessionListener> consumer)
      Specified by:
      notifySessionListeners in interface org.eclipse.jetty.websocket.api.WebSocketContainer
    • getOpenSessions

      public Collection<org.eclipse.jetty.websocket.api.Session> getOpenSessions()
      Specified by:
      getOpenSessions in interface org.eclipse.jetty.websocket.api.WebSocketContainer
    • getBehavior

      public org.eclipse.jetty.websocket.api.WebSocketBehavior getBehavior()
      Specified by:
      getBehavior in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getIdleTimeout

      public Duration getIdleTimeout()
      Specified by:
      getIdleTimeout in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getInputBufferSize

      public int getInputBufferSize()
      Specified by:
      getInputBufferSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getOutputBufferSize

      public int getOutputBufferSize()
      Specified by:
      getOutputBufferSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getMaxBinaryMessageSize

      public long getMaxBinaryMessageSize()
      Specified by:
      getMaxBinaryMessageSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getMaxTextMessageSize

      public long getMaxTextMessageSize()
      Specified by:
      getMaxTextMessageSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • getMaxFrameSize

      public long getMaxFrameSize()
      Specified by:
      getMaxFrameSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • isAutoFragment

      public boolean isAutoFragment()
      Specified by:
      isAutoFragment in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setIdleTimeout

      public void setIdleTimeout(Duration duration)
      Specified by:
      setIdleTimeout in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setInputBufferSize

      public void setInputBufferSize(int size)
      Specified by:
      setInputBufferSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setOutputBufferSize

      public void setOutputBufferSize(int size)
      Specified by:
      setOutputBufferSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setMaxBinaryMessageSize

      public void setMaxBinaryMessageSize(long size)
      Specified by:
      setMaxBinaryMessageSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setMaxTextMessageSize

      public void setMaxTextMessageSize(long size)
      Specified by:
      setMaxTextMessageSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setMaxFrameSize

      public void setMaxFrameSize(long maxFrameSize)
      Specified by:
      setMaxFrameSize in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • setAutoFragment

      public void setAutoFragment(boolean autoFragment)
      Specified by:
      setAutoFragment in interface org.eclipse.jetty.websocket.api.WebSocketPolicy
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Overrides:
      dump in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      IOException