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).
    • Field Detail

      • _source

        protected final Source _source
      • _class

        protected transient Class<? extends T> _class
      • _className

        protected String _className
      • _extInstance

        protected boolean _extInstance
    • Constructor Detail

      • BaseHolder

        protected BaseHolder​(Source source)
    • Method Detail

      • getSource

        public Source getSource()
      • initialize

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

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

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

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

        public 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​(String className)
        Parameters:
        className - The className to set.
      • setHeldClass

        public void setHeldClass​(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 String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable