Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public abstract Class BaseHolder<T>

extends AbstractLifeCycle
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Known Direct Subclasses
org.eclipse.jetty.ee10.servlet.Holder, org.eclipse.jetty.ee10.servlet.ListenerHolder, org.eclipse.jetty.ee10.servlet.ServletContainerInitializerHolder
Type Parameters
<T>
the type of holder
Imports
java.io.IOException, java.util.function.BiFunction, jakarta.servlet.ServletContext, .UnavailableException, org.eclipse.jetty.server.handler.ContextHandler, org.eclipse.jetty.util.Loader, org.eclipse.jetty.util.annotation.ManagedAttribute, org.eclipse.jetty.util.component.AbstractLifeCycle, .Dumpable, org.eclipse.jetty.util.thread.AutoLock, org.slf4j.Logger, .LoggerFactory

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 and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private Class<? extends T>
private String
private T
private final AutoLock
private ServletHandler
private final Source
private static final Logger
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected T
public void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

public void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public String
public String
public Class<? extends T>
protected T
public ServletContext
public ServletContextHandler
public ServletHandler
getServletHandler()

Returns: Returns the servletHandler.

public Source
protected void
public void
initialize()

Do any setup necessary after starting

public boolean
isInstance()

Returns: True if this holder was created for a specific instance.

pack-priv AutoLock
lock()

pack-priv boolean
public void
setClassName(String
The className to set.
className
)

public void
setHeldClass(Class<? extends T>
The class to hold
held
)

protected void
setInstance(T instance)

public void
setServletHandler(ServletHandler
The ServletHandler that will handle requests dispatched to this servlet.
servletHandler
)

protected T
unwrap(final T component)

protected <
the "wrapper function" implementation. (eg: ServletHolder.WrapperFunction or FilterHolder.WrapperFunction, etc)
W
>
T

Returns:

the component that has passed through all Wrapper Function beans found.
wrap
(final T
the component to optionally wrap
component
,
final Class<W>
the bean class type to look for in the ServletContextHandler
wrapperFunctionType
,
final BiFunction<W, T, T>
the BiFunction to execute for each wrapperFunctionType Bean found (passing in the component and component type)
function
)

Wrap component using component specific Wrapper Function beans.

Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

_classback to summary
private Class<? extends T> _class
_classNameback to summary
private String _className
_instanceback to summary
private T _instance
_lockback to summary
private final AutoLock _lock

Hides org.eclipse.jetty.util.component.AbstractLifeCycle._lock.

_servletHandlerback to summary
private ServletHandler _servletHandler
_sourceback to summary
private final Source _source
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.AbstractLifeCycle.LOG.

Constructor Detail

BaseHolderback to summary
protected BaseHolder(Source source)

Method Detail

createInstanceback to summary
protected T createInstance() throws Exception
doStartback to summary
public void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@SuppressWarnings:unchecked
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
public void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump 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.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
dumpback to summary
public String dump()

Overrides default org.eclipse.jetty.util.component.Dumpable.dump.

Annotations
@Override
getClassNameback to summary
public String getClassName()
Annotations
@ManagedAttribute:Class Name
readonly:true
getHeldClassback to summary
public Class<? extends T> getHeldClass()
getInstanceback to summary
protected T getInstance()
getServletContextback to summary
public ServletContext getServletContext()
getServletContextHandlerback to summary
public ServletContextHandler getServletContextHandler()
getServletHandlerback to summary
public ServletHandler getServletHandler()
Returns:ServletHandler

Returns the servletHandler.

getSourceback to summary
public Source getSource()
illegalStateIfContextStartedback to summary
protected void illegalStateIfContextStarted()
initializeback to summary
public void initialize() throws Exception

Do any setup necessary after starting

Exceptions
Exception:
if unable to initialize
isInstanceback to summary
public boolean isInstance()
Returns:boolean

True if this holder was created for a specific instance.

lockback to summary
pack-priv AutoLock lock()
lockIsHeldByCurrentThreadback to summary
pack-priv boolean lockIsHeldByCurrentThread()
setClassNameback to summary
public void setClassName(String className)
Parameters
className:String

The className to set.

setHeldClassback to summary
public void setHeldClass(Class<? extends T> held)
Parameters
held:Class<? extends T>

The class to hold

setInstanceback to summary
protected void setInstance(T instance)
setServletHandlerback to summary
public void setServletHandler(ServletHandler servletHandler)
Parameters
servletHandler:ServletHandler

The ServletHandler that will handle requests dispatched to this servlet.

unwrapback to summary
protected T unwrap(final T component)
wrapback to summary
protected <W> T wrap(final T component, final Class<W> wrapperFunctionType, final BiFunction<W, T, T> function)

Wrap component using component specific Wrapper Function beans.

Parameters
<W>
the "wrapper function" implementation. (eg: ServletHolder.WrapperFunction or FilterHolder.WrapperFunction, etc)
component:T

the component to optionally wrap

wrapperFunctionType:Class<W>

the bean class type to look for in the ServletContextHandler

function:BiFunction<W, T, T>

the BiFunction to execute for each wrapperFunctionType Bean found (passing in the component and component type)

Returns:T

the component that has passed through all Wrapper Function beans found.

org.eclipse.jetty.ee10.servlet back to summary

pack-priv Interface BaseHolder.Wrapped<C>

Known Direct Implementers
org.eclipse.jetty.ee10.servlet.FilterHolder.Wrapper, org.eclipse.jetty.ee10.servlet.ListenerHolder.Wrapper, org.eclipse.jetty.ee10.servlet.ServletContainerInitializerHolder.Wrapper, org.eclipse.jetty.ee10.servlet.ServletHolder.Wrapper

Method Summary

Modifier and TypeMethod and Description
public C

Method Detail

getWrappedback to summary
public C getWrapped()