Class JettyServletEngineAdapter
- java.lang.Object
-
- com.google.apphosting.runtime.jetty94.JettyServletEngineAdapter
-
- All Implemented Interfaces:
ServletEngineAdapter,UPRequestHandler
public class JettyServletEngineAdapter extends Object implements ServletEngineAdapter
This is an implementation of ServletEngineAdapter that uses the third-party Jetty servlet engine.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.apphosting.runtime.ServletEngineAdapter
ServletEngineAdapter.Config
-
-
Constructor Summary
Constructors Constructor Description JettyServletEngineAdapter()JettyServletEngineAdapter(Optional<WebAppContextFactory> contextFactory, Optional<com.google.apphosting.utils.config.AppYaml> appYaml)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAppVersion(AppVersion appVersion)Register the specified application version for future calls toserviceRequest.voiddeleteAppVersion(AppVersion appVersion)Remove the specified application version and free up any resources associated with it.voidserviceRequest(com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest, MutableUpResponse upResponse)Executes the HTTP request specified byupRequestand writes the response toupResponse.voidsetSessionStoreFactory(SessionStoreFactory factory)Sets theSessionStoreFactorythat will be used to create the list ofSessionStoresto which the HTTP Session will be stored, if sessions are enabled.voidstart(String serverInfo, ServletEngineAdapter.Config runtimeOptions)Performs whatever setup is necessary for this servlet container.voidstop()Perform any shutdown procedures necessary for this servlet container.
-
-
-
Constructor Detail
-
JettyServletEngineAdapter
public JettyServletEngineAdapter()
-
JettyServletEngineAdapter
public JettyServletEngineAdapter(Optional<WebAppContextFactory> contextFactory, Optional<com.google.apphosting.utils.config.AppYaml> appYaml)
-
-
Method Detail
-
start
public void start(String serverInfo, ServletEngineAdapter.Config runtimeOptions)
Description copied from interface:ServletEngineAdapterPerforms whatever setup is necessary for this servlet container. This method waits for setup to complete before returning.- Specified by:
startin interfaceServletEngineAdapter- Parameters:
serverInfo- The string that should be returned byServletContext.getServerInfo().runtimeOptions- Extra options, currently used for the Jetty HTTP adapter only.
-
stop
public void stop()
Description copied from interface:ServletEngineAdapterPerform any shutdown procedures necessary for this servlet container. This method should return once the shutdown has been completed.- Specified by:
stopin interfaceServletEngineAdapter
-
addAppVersion
public void addAppVersion(AppVersion appVersion) throws FileNotFoundException
Description copied from interface:ServletEngineAdapterRegister the specified application version for future calls toserviceRequest.- Specified by:
addAppVersionin interfaceServletEngineAdapter- Throws:
FileNotFoundException- If any of the specified files could not be located.
-
deleteAppVersion
public void deleteAppVersion(AppVersion appVersion)
Description copied from interface:ServletEngineAdapterRemove the specified application version and free up any resources associated with it.- Specified by:
deleteAppVersionin interfaceServletEngineAdapter
-
setSessionStoreFactory
public void setSessionStoreFactory(SessionStoreFactory factory)
Sets theSessionStoreFactorythat will be used to create the list ofSessionStoresto which the HTTP Session will be stored, if sessions are enabled. This method must be invoked after#start(String).- Specified by:
setSessionStoreFactoryin interfaceServletEngineAdapter
-
serviceRequest
public void serviceRequest(com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest, MutableUpResponse upResponse) throws javax.servlet.ServletException, IOExceptionDescription copied from interface:UPRequestHandlerExecutes the HTTP request specified byupRequestand writes the response toupResponse.Finds, and if necessary, instantiates and initializes the appropriate servlet, invokes it, and copies the response into
upResponse.- Specified by:
serviceRequestin interfaceUPRequestHandler- Throws:
IOException- If any error related to the request buffer was detected.javax.servlet.ServletException
-
-