Package org.eclipse.jetty.servlet
Class ListenerHolder
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.servlet.BaseHolder<java.util.EventListener>
-
- org.eclipse.jetty.servlet.ListenerHolder
-
public class ListenerHolder extends BaseHolder<java.util.EventListener>
ListenerHolder Specialization of BaseHolder for servlet listeners. This allows us to record where the listener originated - web.xml, annotation, api etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ListenerHolder.WrapFunction
Experimental Wrapper mechanism for Servlet EventListeners.static class
ListenerHolder.Wrapper
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
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
-
-
Constructor Summary
Constructors Constructor Description ListenerHolder()
ListenerHolder(java.lang.Class<? extends java.util.EventListener> listenerClass)
ListenerHolder(Source source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doStart()
void
doStop()
java.util.EventListener
getListener()
void
setListener(java.util.EventListener listener)
Set an explicit instance.java.lang.String
toString()
-
Methods inherited from class org.eclipse.jetty.servlet.BaseHolder
dump, dump, getClassName, getHeldClass, getInstance, getServletHandler, getSource, illegalStateIfContextStarted, initialize, isInstance, setClassName, setHeldClass, setInstance, setServletHandler, unwrap, wrap
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
-
-
-
Constructor Detail
-
ListenerHolder
public ListenerHolder()
-
ListenerHolder
public ListenerHolder(Source source)
-
ListenerHolder
public ListenerHolder(java.lang.Class<? extends java.util.EventListener> listenerClass)
-
-
Method Detail
-
getListener
public java.util.EventListener getListener()
-
setListener
public void setListener(java.util.EventListener listener)
Set an explicit instance. In this case, just like ServletHolder and FilterHolder, the listener will not be introspected for annotations like Resource etc.
-
doStart
public void doStart() throws java.lang.Exception
- Overrides:
doStart
in classBaseHolder<java.util.EventListener>
- Throws:
java.lang.Exception
-
doStop
public void doStop() throws java.lang.Exception
- Overrides:
doStop
in classBaseHolder<java.util.EventListener>
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractLifeCycle
-
-