- 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
-
- org.eclipse.jetty.server.handler.HotSwapHandler
-
- 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.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
public class HotSwapHandler extends AbstractHandlerContainer
AHandlerContainerthat allows a hot swap of a wrapped handler.
-
-
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, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
-
-
Constructor Summary
Constructors Constructor Description HotSwapHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected voiddoStart()protected voiddoStop()protected voidexpandChildren(java.util.List<Handler> list, java.lang.Class<?> byClass)HandlergetHandler()Handler[]getHandlers()voidhandle(java.lang.String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Handle a request.voidsetHandler(Handler handler)-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
doError, getServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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.util.component.Container
getCachedBeans, getEventListeners
-
-
-
-
Method Detail
-
getHandler
public Handler getHandler()
- Returns:
- Returns the handlers.
-
getHandlers
public Handler[] getHandlers()
- Returns:
- Returns the handlers.
-
setHandler
public void setHandler(Handler handler)
- Parameters:
handler- Set theHandlerwhich should be wrapped.
-
doStart
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classAbstractHandler- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception- Overrides:
doStopin classAbstractHandler- Throws:
java.lang.Exception
-
handle
public void handle(java.lang.String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws java.io.IOException, jakarta.servlet.ServletExceptionDescription copied from interface:HandlerHandle a request.- Specified by:
handlein interfaceHandler- Specified by:
handlein classAbstractHandler- 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. Themethod can be used access the Request object if required.HttpConnection.getCurrentConnection().getHttpChannel().getRequest()response- The response as theResponseobject or a wrapper of that request. Themethod can be used access the Response object if required.HttpConnection.getCurrentConnection().getHttpChannel().getResponse()- Throws:
java.io.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
-
expandChildren
protected void expandChildren(java.util.List<Handler> list, java.lang.Class<?> byClass)
- Overrides:
expandChildrenin classAbstractHandlerContainer
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.eclipse.jetty.util.component.Destroyable- Specified by:
destroyin interfaceHandler- Overrides:
destroyin classAbstractHandler
-
-