T
- the type of holderpublic abstract class BaseHolder<T> extends AbstractLifeCycle implements Dumpable
AbstractLifeCycle.AbstractLifeCycleListener
Dumpable.DumpableContainer
LifeCycle.Listener
Modifier | Constructor and Description |
---|---|
protected |
BaseHolder(Source source) |
Modifier and Type | Method and Description |
---|---|
void |
doStart() |
void |
doStop() |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
java.lang.String |
getClassName() |
java.lang.Class<? extends T> |
getHeldClass() |
protected T |
getInstance() |
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) |
protected void |
setInstance(T instance) |
void |
setServletHandler(ServletHandler servletHandler) |
protected T |
unwrap(T component) |
protected <W> T |
wrap(T component,
java.lang.Class<W> wrapperFunctionType,
java.util.function.BiFunction<W,T,T> function)
Wrap component using component specific Wrapper Function beans.
|
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, named
protected BaseHolder(Source source)
public Source getSource()
public void initialize() throws java.lang.Exception
java.lang.Exception
- if unable to initializepublic void doStart() throws java.lang.Exception
doStart
in class AbstractLifeCycle
java.lang.Exception
public void doStop() throws java.lang.Exception
doStop
in class AbstractLifeCycle
java.lang.Exception
@ManagedAttribute(value="Class Name", readonly=true) public java.lang.String getClassName()
public java.lang.Class<? extends T> getHeldClass()
public ServletHandler getServletHandler()
public void setServletHandler(ServletHandler servletHandler)
servletHandler
- The ServletHandler
that will handle requests dispatched to this servlet.public void setClassName(java.lang.String className)
className
- The className to set.public void setHeldClass(java.lang.Class<? extends T> held)
held
- The class to holdprotected void illegalStateIfContextStarted()
protected void setInstance(T instance)
protected T getInstance()
public boolean isInstance()
protected <W> T wrap(T component, java.lang.Class<W> wrapperFunctionType, java.util.function.BiFunction<W,T,T> function)
W
- the "wrapper function" implementation. (eg: ServletHolder.WrapperFunction
or FilterHolder.WrapperFunction
, etc)component
- the component to optionally wrapwrapperFunctionType
- the bean class type to look for in the ServletContextHandler
function
- the BiFunction to execute for each wrapperFunctionType
Bean found (passing in the component and component type)public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Dumpable
Copyright © 1995–2021 Webtide. All rights reserved.