Class BaseHolder<T>
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.ee10.servlet.BaseHolder<T>
- Type Parameters:
T- the type of holder
- Direct Known Subclasses:
Holder, ListenerHolder, ServletContainerInitializerHolder
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 AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TvoiddoStart()Method to override to start the lifecyclevoiddoStop()Method to override to stop the lifecycledump()voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.protected Tjakarta.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 AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toString
-
Constructor Details
-
BaseHolder
-
-
Method Details
-
getSource
-
initialize
-
doStart
Description copied from class:AbstractLifeCycleMethod to override to start the lifecycle- Overrides:
doStartin classAbstractLifeCycle- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:AbstractLifeCycleMethod to override to stop the lifecycle- Overrides:
doStopin classAbstractLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
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
-
illegalStateIfContextStarted
protected void illegalStateIfContextStarted() -
setInstance
-
getInstance
-
createInstance
-
getServletContext
public jakarta.servlet.ServletContext getServletContext() -
getServletContextHandler
-
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
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
dump
-