Class BaseHolder<T>

  • Type Parameters:
    T - the type of holder
    All Implemented Interfaces:
    org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    Holder, ListenerHolder

    public abstract class BaseHolder<T>
    extends org.eclipse.jetty.util.component.AbstractLifeCycle
    implements org.eclipse.jetty.util.component.Dumpable
    AbstractHolder Base class for all servlet-related classes that may be lazily instantiated (eg servlet, filter, listener), and/or require metadata to be held regarding their origin (web.xml, annotation, programmatic api etc).
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<? extends T> _class  
      protected java.lang.String _className  
      protected boolean _extInstance  
      protected ServletHandler _servletHandler  
      protected Source _source  
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaseHolder​(Source source)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doStart()  
      void doStop()  
      java.lang.String dump()  
      void dump​(java.lang.Appendable out, java.lang.String indent)  
      java.lang.String getClassName()  
      java.lang.Class<? extends T> getHeldClass()  
      ServletHandler getServletHandler()  
      Source getSource()  
      protected void illegalStateIfContextStarted()  
      void initialize()
      Do any setup necessary after starting
      boolean isInstance()  
      void setClassName​(java.lang.String className)  
      void setHeldClass​(java.lang.Class<? extends T> held)  
      void setServletHandler​(ServletHandler servletHandler)  
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
      • 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.Dumpable

        dumpSelf
    • Field Detail

      • _source

        protected final Source _source
      • _class

        protected transient java.lang.Class<? extends T> _class
      • _className

        protected java.lang.String _className
      • _extInstance

        protected boolean _extInstance
    • Constructor Detail

      • BaseHolder

        protected BaseHolder​(Source source)
    • Method Detail

      • getSource

        public Source getSource()
      • initialize

        public void initialize()
                        throws java.lang.Exception
        Do any setup necessary after starting
        Throws:
        java.lang.Exception - if unable to initialize
      • doStart

        public void doStart()
                     throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        java.lang.Exception
      • doStop

        public void doStop()
                    throws java.lang.Exception
        Overrides:
        doStop in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        java.lang.Exception
      • getClassName

        @ManagedAttribute(value="Class Name",
                          readonly=true)
        public java.lang.String getClassName()
      • getHeldClass

        public java.lang.Class<? extends T> getHeldClass()
      • getServletHandler

        public ServletHandler getServletHandler()
        Returns:
        Returns the servletHandler.
      • setServletHandler

        public void setServletHandler​(ServletHandler servletHandler)
        Parameters:
        servletHandler - The ServletHandler that will handle requests dispatched to this servlet.
      • setClassName

        public void setClassName​(java.lang.String className)
        Parameters:
        className - The className to set.
      • setHeldClass

        public void setHeldClass​(java.lang.Class<? extends T> held)
        Parameters:
        held - The class to hold
      • illegalStateIfContextStarted

        protected void illegalStateIfContextStarted()
      • isInstance

        public boolean isInstance()
        Returns:
        True if this holder was created for a specific instance.
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Throws:
        java.io.IOException
      • dump

        public java.lang.String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable