java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.servlet.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,ServletContainerInitializerHolder
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, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TvoiddoStart()voiddoStop()dump()voiddump(Appendable out, String indent) protected Tjavax.servlet.ServletContextprotected voidvoidDo any setup necessary after startingbooleanvoidsetClassName(String className) voidsetHeldClass(Class<? extends T> held) protected voidsetInstance(T instance) voidsetServletHandler(ServletHandler servletHandler) protected Tprotected <W> TWrap component using component specific Wrapper Function beans.Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelf
-
Constructor Details
-
BaseHolder
-
-
Method Details
-
getSource
-
initialize
Do any setup necessary after starting- Throws:
Exception- if unable to initialize
-
doStart
- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
getClassName
-
getHeldClass
-
getServletHandler
- Returns:
- Returns the servletHandler.
-
setServletHandler
- Parameters:
servletHandler- TheServletHandlerthat will handle requests dispatched to this servlet.
-
setClassName
- Parameters:
className- The className to set.
-
setHeldClass
- Parameters:
held- The class to hold
-
illegalStateIfContextStarted
protected void illegalStateIfContextStarted() -
setInstance
-
getInstance
-
createInstance
- Throws:
Exception
-
getServletContext
public javax.servlet.ServletContext getServletContext() -
isInstance
public boolean isInstance()- Returns:
- True if this holder was created for a specific instance.
-
wrap
Wrap component using component specific Wrapper Function beans.- Type Parameters:
W- the "wrapper function" implementation. (eg:ServletHolder.WrapperFunctionorFilterHolder.WrapperFunction, etc)- Parameters:
component- the component to optionally wrapwrapperFunctionType- the bean class type to look for in theServletContextHandlerfunction- the BiFunction to execute for eachwrapperFunctionTypeBean found (passing in the component and component type)- Returns:
- the component that has passed through all Wrapper Function beans found.
-
unwrap
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable
-