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,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.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
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
-
-
Constructor Summary
Constructors Constructor Description AbstractHandlerContainer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoShutdown(List<Future<Void>> futures)Shutdown nested Gracefule handlersprotected voidexpandChildren(List<Handler> list, Class<?> byClass)protected voidexpandHandler(Handler handler, List<Handler> list, Class<?> byClass)static <T extends HandlerContainer>
TfindContainerOf(HandlerContainer root, Class<T> type, Handler handler)<T extends Handler>
TgetChildHandlerByClass(Class<T> byclass)Handler[]getChildHandlers()Handler[]getChildHandlersByClass(Class<?> byclass)voidsetServer(Server server)-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doError, doStart, doStop, getServer, handle
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.server.HandlerContainer
getHandlers
-
-
-
-
Method Detail
-
getChildHandlers
public Handler[] getChildHandlers()
- Specified by:
getChildHandlersin interfaceHandlerContainer- Returns:
- array of all handlers contained by this handler and it's children
-
getChildHandlersByClass
public Handler[] getChildHandlersByClass(Class<?> byclass)
- Specified by:
getChildHandlersByClassin 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(Class<T> byclass)
- Specified by:
getChildHandlerByClassin 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, Class<T> type, Handler handler)
-
setServer
public void setServer(Server server)
- Specified by:
setServerin interfaceHandler- Overrides:
setServerin classAbstractHandler
-
doShutdown
protected void doShutdown(List<Future<Void>> futures) throws org.eclipse.jetty.util.MultiException
Shutdown nested Gracefule handlers- Parameters:
futures- A list of Futures which must also be waited on for the shutdown (or null) returns A MultiException to which any failures are added or null- Throws:
org.eclipse.jetty.util.MultiException
-
-