Class AbstractHandler
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.ee9.nested.AbstractHandler
- All Implemented Interfaces:
Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
- Direct Known Subclasses:
AbstractHandler.ErrorDispatchHandler, AbstractHandlerContainer, ErrorHandler
@ManagedObject("Jetty Handler")
public abstract class AbstractHandler
extends ContainerLifeCycle
implements Handler
AbstractHandler.
A convenience implementation of Handler that uses the
ContainerLifeCycle to provide:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.This class is no longer required as ERROR dispatch is only done if there is an error page target.Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys the managed Destroyable beans in the reverse order they were added.protected voiddoError(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Deprecated.protected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.abstract voidhandle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handle a request.voidMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Constructor Details
-
AbstractHandler
public AbstractHandler()
-
-
Method Details
-
handle
public abstract void handle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException Description copied from interface:HandlerHandle a request.- Specified by:
handlein interfaceHandler- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
-
doError
@Deprecated protected void doError(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException Deprecated.Deprecated error page generation- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
setServer
-
getServer
-
destroy
public void destroy()Description copied from class:ContainerLifeCycleDestroys the managed Destroyable beans in the reverse order they were added.- Specified by:
destroyin interfaceDestroyable- Specified by:
destroyin interfaceHandler- Overrides:
destroyin classContainerLifeCycle
-