- All Superinterfaces:
org.eclipse.jetty.util.component.Destroyable,Handler,Handler.Container,org.eclipse.jetty.util.thread.Invocable,org.eclipse.jetty.util.component.LifeCycle,Request.Handler
- All Known Implementing Classes:
BufferedResponseHandler,ConditionalHandler,ConditionalHandler.Abstract,ConditionalHandler.DontHandle,ConditionalHandler.ElseNext,ConditionalHandler.Reject,ConditionalHandler.SkipNext,ConnectHandler,ContextHandler,DebugHandler,DelayedHandler,EventsHandler,GracefulHandler,GzipHandler,Handler.Wrapper,HotSwapHandler,IdleTimeoutHandler,InetAccessHandler,LatencyRecordingHandler,MovedContextHandler,ProxiedRequestHandler,QoSHandler,ResourceHandler,ResourceHandler.ResourceContext,SecuredRedirectHandler,Server,ShutdownHandler,SizeLimitHandler,StatisticsHandler,StatisticsHandler.MinimumDataRateHandler,ThreadLimitHandler,TryPathsHandler
- Enclosing interface:
Handler
A Handler.Container that can contain one single other Handler.
This is a "singleton" in the sense of Collections.singleton(Object) and not
in the sense of the singleton pattern of a single instance per JVM.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler
Handler.Abstract, Handler.AbstractContainer, Handler.Collection, Handler.Container, Handler.Sequence, Handler.Singleton, Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Method Summary
Modifier and TypeMethodDescriptiondefault Handler.SingletongetTail()default voidinsertHandler(Handler.Singleton handler) Inserts the givenHandler(and its chain ofHandlers) in front of the child of thisHandler.default voidsetHandler(Supplier<Handler> supplier) Sets the childHandlersupplied by the givenSupplier.voidsetHandler(Handler handler) static HandlerupdateHandler(Handler.Singleton wrapper, Handler handler) Utility method to perform sanity checks before adding the givenHandlerto the givenSingleton, typically used in implementations ofsetHandler(Handler).Methods inherited from interface org.eclipse.jetty.util.component.Destroyable
destroyMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.util.thread.Invocable
getInvocationTypeMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stopMethods inherited from interface org.eclipse.jetty.server.Request.Handler
handle
-
Method Details
-
getHandler
Handler getHandler()- Returns:
- the child
Handler
-
setHandler
- Parameters:
handler- TheHandlerto set as a child
-
setHandler
Sets the child
Handlersupplied by the givenSupplier.- Parameters:
supplier- theHandlersupplier
-
getHandlers
- Specified by:
getHandlersin interfaceHandler.Container- Returns:
- an immutable collection of
Handlers directly contained by thisHandler.
-
insertHandler
Inserts the given
Handler(and its chain ofHandlers) in front of the child of thisHandler.For example, if this
HandlerAhas a childB, insertingHandlerXbuilt as a chainHandlersX-Y-Zresults in the structureA-X-Y-Z-B.- Parameters:
handler- theHandlerto insert
-
getTail
- Returns:
- the tail
Handler.Singletonof a chain ofHandler.Singletons
-
updateHandler
Utility method to perform sanity checks before adding the given
Handlerto the givenSingleton, typically used in implementations ofsetHandler(Handler).The sanity checks are:
- Check for the server start state and whether the invocation type is compatible
- Check for
Handlerloops - Sets the
Serveron theHandler - Update the beans on the
Singletonif it is aContainerLifeCycle
- Parameters:
wrapper- theSingletonto set theHandlerhandler- theHandlerto set- Returns:
- The
Handlerto set
-