Class JavaxWebSocketShutdownContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.javax.client.JavaxWebSocketShutdownContainer
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContainerInitializer
,javax.servlet.ServletContextListener
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
public class JavaxWebSocketShutdownContainer
extends ContainerLifeCycle
implements javax.servlet.ServletContainerInitializer, javax.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 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextDestroyed
(javax.servlet.ServletContextEvent sce) void
contextInitialized
(javax.servlet.ServletContextEvent sce) void
toString()
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, 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
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
-
Constructor Details
-
JavaxWebSocketShutdownContainer
public JavaxWebSocketShutdownContainer()
-
-
Method Details
-
onStartup
public void onStartup(Set<Class<?>> c, javax.servlet.ServletContext ctx) throws javax.servlet.ServletException - Specified by:
onStartup
in interfacejavax.servlet.ServletContainerInitializer
- Throws:
javax.servlet.ServletException
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent sce) - Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce) - Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
toString
- Overrides:
toString
in classAbstractLifeCycle
-