Class AppVersionHandlerMap
- 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
-
- com.google.apphosting.runtime.jetty94.AppVersionHandlerMap
-
- All Implemented Interfaces:
org.eclipse.jetty.server.Handler,org.eclipse.jetty.server.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 AppVersionHandlerMap extends org.eclipse.jetty.server.handler.AbstractHandlerContainerAppVersionHandlerMapis aHandlerContainerthat identifies each childHandlerwith a particularAppVersionKey.In order to identify which application version each request should be sent to, this class assumes that an attribute will be set on the
HttpServletRequestwith a value of theAppVersionKeythat should be used.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
-
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 AppVersionHandlerMap(AppVersionHandlerFactory appVersionHandlerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAppVersion(AppVersion appVersion)voidaddHandler(org.eclipse.jetty.server.Handler handler)Not supported.protected voiddoStart()protected voiddoStop()protected voidexpandChildren(List<org.eclipse.jetty.server.Handler> list, Class<?> byClass)org.eclipse.jetty.server.HandlergetHandler(AppVersionKey appVersionKey)Returns theHandlerthat will handle requests for the specified application version.org.eclipse.jetty.server.Handler[]getHandlers()voidhandle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Forward the specified request on to theHandlerassociated with its application version.voidremoveAppVersion(AppVersionKey appVersionKey)voidremoveHandler(org.eclipse.jetty.server.Handler handler)Not supported.voidsetHandlers(org.eclipse.jetty.server.Handler[] handlers)Not supported.voidsetServer(org.eclipse.jetty.server.Server server)voidsetSessionStoreFactory(SessionStoreFactory factory)Sets theSessionStoreFactorythat will be used for generating the list ofSessionStoresthat will be passed toSessionManagerfor apps for which sessions are enabled.-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doError, getServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
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
-
-
-
-
Constructor Detail
-
AppVersionHandlerMap
public AppVersionHandlerMap(AppVersionHandlerFactory appVersionHandlerFactory)
-
-
Method Detail
-
addAppVersion
public void addAppVersion(AppVersion appVersion)
-
removeAppVersion
public void removeAppVersion(AppVersionKey appVersionKey)
-
setSessionStoreFactory
public void setSessionStoreFactory(SessionStoreFactory factory)
Sets theSessionStoreFactorythat will be used for generating the list ofSessionStoresthat will be passed toSessionManagerfor apps for which sessions are enabled. This setter is currently used only for testing purposes. Normally the default factory is sufficient.
-
getHandler
public org.eclipse.jetty.server.Handler getHandler(AppVersionKey appVersionKey) throws javax.servlet.ServletException
Returns theHandlerthat will handle requests for the specified application version.- Throws:
javax.servlet.ServletException
-
handle
public void handle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
Forward the specified request on to theHandlerassociated with its application version.- Specified by:
handlein interfaceorg.eclipse.jetty.server.Handler- Specified by:
handlein classorg.eclipse.jetty.server.handler.AbstractHandler- Throws:
IOExceptionjavax.servlet.ServletException
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.eclipse.jetty.server.handler.AbstractHandler- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.eclipse.jetty.server.handler.AbstractHandler- Throws:
Exception
-
setServer
public void setServer(org.eclipse.jetty.server.Server server)
- Specified by:
setServerin interfaceorg.eclipse.jetty.server.Handler- Overrides:
setServerin classorg.eclipse.jetty.server.handler.AbstractHandlerContainer
-
getHandlers
public org.eclipse.jetty.server.Handler[] getHandlers()
-
setHandlers
public void setHandlers(org.eclipse.jetty.server.Handler[] handlers)
Not supported.- Throws:
UnsupportedOperationException
-
addHandler
public void addHandler(org.eclipse.jetty.server.Handler handler)
Not supported.- Throws:
UnsupportedOperationException
-
removeHandler
public void removeHandler(org.eclipse.jetty.server.Handler handler)
Not supported.- Throws:
UnsupportedOperationException
-
-