Package org.eclipse.jetty.servlet
Class ListenerHolder
ListenerHolder
Specialization of BaseHolder for servlet listeners. This
allows us to record where the listener originated - web.xml,
annotation, api etc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Experimental Wrapper mechanism for Servlet EventListeners.static class
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.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionListenerHolder
(Class<? extends EventListener> listenerClass) ListenerHolder
(Source source) -
Method Summary
Modifier and TypeMethodDescriptionprotected EventListener
void
doStart()
Method to override to start the lifecyclevoid
doStop()
Method to override to stop the lifecyclevoid
setListener
(EventListener listener) Set an explicit instance.toString()
Methods inherited from class org.eclipse.jetty.servlet.BaseHolder
dump, dump, getClassName, getHeldClass, getInstance, getServletContext, getServletHandler, getSource, illegalStateIfContextStarted, initialize, isInstance, setClassName, setHeldClass, setInstance, setServletHandler, unwrap, wrap
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop
-
Constructor Details
-
ListenerHolder
public ListenerHolder() -
ListenerHolder
-
ListenerHolder
-
-
Method Details
-
getListener
-
setListener
Set an explicit instance. In this case, just like ServletHolder and FilterHolder, the listener will not be introspected for annotations like Resource etc.- Parameters:
listener
- The listener instance
-
doStart
Description copied from class:AbstractLifeCycle
Method to override to start the lifecycle- Overrides:
doStart
in classBaseHolder<EventListener>
- Throws:
AbstractLifeCycle.StopException
- If thrown, the lifecycle will immediately be stopped.Exception
- If there was a problem starting. Will cause a transition to FAILED state
-
createInstance
- Overrides:
createInstance
in classBaseHolder<EventListener>
- Throws:
Exception
-
doStop
Description copied from class:AbstractLifeCycle
Method to override to stop the lifecycle- Overrides:
doStop
in classBaseHolder<EventListener>
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
toString
- Overrides:
toString
in classAbstractLifeCycle
-