Class ListenerHolder

  • All Implemented Interfaces:
    Dumpable, LifeCycle

    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.
    • 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.
        Parameters:
        listener - The listener instance
      • doStart

        public void doStart()
                     throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to start the lifecycle
        Overrides:
        doStart in class BaseHolder<java.util.EventListener>
        Throws:
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state
      • createInstance

        protected java.util.EventListener createInstance()
                                                  throws java.lang.Exception
        Overrides:
        createInstance in class BaseHolder<java.util.EventListener>
        Throws:
        java.lang.Exception
      • doStop

        public void doStop()
                    throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to stop the lifecycle
        Overrides:
        doStop in class BaseHolder<java.util.EventListener>
        Throws:
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state