Package org.eclipse.jetty.server.handler
Class AbstractHandlerContainer
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.handler.AbstractHandler
-
- org.eclipse.jetty.server.handler.AbstractHandlerContainer
-
- All Implemented Interfaces:
Handler
,HandlerContainer
,Container
,Destroyable
,Dumpable
,LifeCycle
- Direct Known Subclasses:
HandlerCollection
,HandlerWrapper
,HotSwapHandler
public abstract class AbstractHandlerContainer extends AbstractHandler implements HandlerContainer
Abstract Handler Container. This is the base class for handlers that may contain other handlers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description AbstractHandlerContainer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends HandlerContainer>
TfindContainerOf(HandlerContainer root, java.lang.Class<T> type, Handler handler)
<T extends Handler>
TgetChildHandlerByClass(java.lang.Class<T> byclass)
Handler[]
getChildHandlers()
Handler[]
getChildHandlersByClass(java.lang.Class<?> byclass)
void
setServer(Server server)
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, getServer, handle
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.server.HandlerContainer
getHandlers
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Method Detail
-
getChildHandlers
public Handler[] getChildHandlers()
- Specified by:
getChildHandlers
in interfaceHandlerContainer
- Returns:
- array of all handlers contained by this handler and it's children
-
getChildHandlersByClass
public Handler[] getChildHandlersByClass(java.lang.Class<?> byclass)
- Specified by:
getChildHandlersByClass
in interfaceHandlerContainer
- Parameters:
byclass
- the child handler class to get- Returns:
- array of all handlers contained by this handler and it's children of the passed type.
-
getChildHandlerByClass
public <T extends Handler> T getChildHandlerByClass(java.lang.Class<T> byclass)
- Specified by:
getChildHandlerByClass
in interfaceHandlerContainer
- Type Parameters:
T
- the type of handler- Parameters:
byclass
- the child handler class to get- Returns:
- first handler of all handlers contained by this handler and it's children of the passed type.
-
findContainerOf
public static <T extends HandlerContainer> T findContainerOf(HandlerContainer root, java.lang.Class<T> type, Handler handler)
-
setServer
public void setServer(Server server)
- Specified by:
setServer
in interfaceHandler
- Overrides:
setServer
in classAbstractHandler
-
-