Class JakartaWebSocketShutdownContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.ee9.websocket.jakarta.client.webapp.JakartaWebSocketShutdownContainer
- All Implemented Interfaces:
jakarta.servlet.ServletContainerInitializer, jakarta.servlet.ServletContextListener, EventListener, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
public class JakartaWebSocketShutdownContainer
extends ContainerLifeCycle
implements jakarta.servlet.ServletContainerInitializer, jakarta.servlet.ServletContextListener
This manages the LifeCycle of WebSocketContainer instances that are created with
ContainerProvider, if this code is being run from another ServletContainer, or if run inside a
Jetty Server with the WebSocket client classes provided by the webapp.
This mechanism will not work if run with embedded Jetty or if the WebSocket client classes are provided by the server.
In this case then the client WebSocketContainer will register itself to be automatically shutdown
with the Jetty ContextHandler.
-
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(jakarta.servlet.ServletContextEvent sce) voidcontextInitialized(jakarta.servlet.ServletContextEvent sce) voidtoString()Methods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, 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, stopMethods 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
isDumpable
-
Constructor Details
-
JakartaWebSocketShutdownContainer
public JakartaWebSocketShutdownContainer()
-
-
Method Details
-
onStartup
-
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent sce) - Specified by:
contextInitializedin interfacejakarta.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent sce) - Specified by:
contextDestroyedin interfacejakarta.servlet.ServletContextListener
-
toString
- Overrides:
toStringin classAbstractLifeCycle
-