Interface Handler.Singleton
- All Superinterfaces:
Destroyable
,Handler
,Handler.Container
,Invocable
,LifeCycle
,Request.Handler
- All Known Implementing Classes:
BufferedResponseHandler
,ConditionalHandler
,ConditionalHandler.Abstract
,ConditionalHandler.DontHandle
,ConditionalHandler.ElseNext
,ConditionalHandler.Reject
,ConditionalHandler.SkipNext
,ConnectHandler
,ConstraintSecurityHandler
,ContextHandler
,CrossOriginHandler
,DebugHandler
,DelayedHandler
,EagerFormHandler
,EventsHandler
,GracefulHandler
,GzipHandler
,Handler.Wrapper
,HotSwapHandler
,HttpSpiContextHandler
,IdleTimeoutHandler
,InetAccessHandler
,LatencyRecordingHandler
,MovedContextHandler
,QoSHandler
,ResourceHandler
,ResourceHandler.ResourceContext
,RewriteHandler
,SecuredRedirectHandler
,SecurityHandler
,SecurityHandler.PathMapped
,Server
,ServletContextHandler
,ServletHandler
,SessionHandler
,SessionHandler
,ShutdownHandler
,SizeLimitHandler
,StateTrackingHandler
,StatisticsHandler
,StatisticsHandler.MinimumDataRateHandler
,ThreadLimitHandler
,TryPathsHandler
,WebAppContext
,WebSocketUpgradeHandler
,WebSocketUpgradeHandler
- 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.
-
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.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
Request.Handler.AbortException
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP
-
Method Summary
Modifier and TypeMethodDescriptionstatic Handler
checkHandler
(Handler.Singleton singleton, Handler handler) Utility method to perform sanity checks on a {Handler
to be added to the givenSingleton
.default Handler.Singleton
getTail()
default void
insertHandler
(Handler.Singleton handler) Inserts the givenHandler
(and possible chain ofHandler
s) between thisHandler
and its currentchild
.default void
setHandler
(Supplier<Handler> supplier) Sets the childHandler
supplied by the givenSupplier
.void
setHandler
(Handler handler) static Handler
updateHandler
(Handler.Singleton singleton, Handler handler) Utility method to perform sanity checks before updating the givenHandler
to the givenSingleton
, typically used in implementations ofsetHandler(Handler)
.Methods inherited from interface org.eclipse.jetty.util.component.Destroyable
destroy
Methods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendants
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
Methods inherited from interface org.eclipse.jetty.server.Request.Handler
getInvocationType, handle
-
Method Details
-
getHandler
- Returns:
- the child
Handler
-
setHandler
- Parameters:
handler
- TheHandler
to set as a child
-
setHandler
Sets the child
Handler
supplied by the givenSupplier
.- Parameters:
supplier
- theHandler
supplier
-
getHandlers
- Specified by:
getHandlers
in interfaceHandler.Container
- Returns:
- an immutable collection of
Handler
s directly contained by thisHandler
.
-
insertHandler
Inserts the given
Handler
(and possible chain ofHandler
s) between thisHandler
and its currentchild
.For example, if this
Handler
A
has a childB
, insertingHandler
X
built as a chainHandler
sX-Y-Z
results in the structureA-X-Y-Z-B
.- Parameters:
handler
- theHandler
to insert
-
getTail
- Returns:
- the tail
Handler.Singleton
of a chain ofHandler.Singleton
s
-
updateHandler
Utility method to perform sanity checks before updating the given
Handler
to 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
Handler
loops - Sets the
Server
on theHandler
- Update the beans on the
Singleton
if it is aContainerLifeCycle
- Parameters:
singleton
- theSingleton
to set theHandler
handler
- theHandler
to set- Returns:
- The
Handler
to set - See Also:
-
checkHandler
Utility method to perform sanity checks on a {
Handler
to be added to the givenSingleton
.The sanity checks are:
- Check for the server start state and whether the invocation type is compatible
- Check for
Handler
loops - Sets the
Server
on theHandler
- Update the beans on the
Singleton
if it is aContainerLifeCycle
- Parameters:
singleton
- theSingleton
to set theHandler
handler
- theHandler
to set- Returns:
- The
Handler
to set
-