Package com.google.apphosting.runtime
Class JavaRuntime
- java.lang.Object
-
- com.google.apphosting.runtime.JavaRuntime
-
- All Implemented Interfaces:
EvaluationRuntimeServerInterface
public class JavaRuntime extends Object implements EvaluationRuntimeServerInterface
JavaRuntime implements the Prometheus EvaluationRuntime service. It handles any requests for the "java" runtime. At the moment, this only includes requests whose handler type is SERVLET. The handler path is assumed to be the full class name of a class that extendsGenericServlet
.JavaRuntime
is not responsible for configuringApiProxy
with a delegate. This class should probably be instantiated byJavaRuntimeFactory
, which also sets upApiProxy
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaRuntime.Builder
Builder for JavaRuntime.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAppVersion(AnyRpcServerContext rpc, com.google.apphosting.base.protos.AppinfoPb.AppInfo appInfo)
Adds the specified application version so that it can be used for future requests.static JavaRuntime.Builder
builder()
Get a partly-initialized builder.void
deleteAppVersion(AnyRpcServerContext rpc, com.google.apphosting.base.protos.AppinfoPb.AppInfo appInfo)
Obsolete operation.void
handleRequest(AnyRpcServerContext rpc, com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest)
Translate the specified UPRequest from Prometheus into aHttpServletRequest
, invoke the specified servlet, and translate the response back into an UPResponse.static void
killCloneIfSeriousException(Throwable th)
void
start(ServletEngineAdapter.Config runtimeOptions)
Starts the Stubby service, and then perform any initialization that the servlet engine requires.void
stop()
Perform a graceful shutdown of our RPC service, and then shut down our servlet engine.
-
-
-
Method Detail
-
builder
public static JavaRuntime.Builder builder()
Get a partly-initialized builder.
-
start
public void start(ServletEngineAdapter.Config runtimeOptions)
Starts the Stubby service, and then perform any initialization that the servlet engine requires.
-
stop
public void stop()
Perform a graceful shutdown of our RPC service, and then shut down our servlet engine.
-
handleRequest
public void handleRequest(AnyRpcServerContext rpc, com.google.apphosting.base.protos.RuntimePb.UPRequest upRequest)
Translate the specified UPRequest from Prometheus into aHttpServletRequest
, invoke the specified servlet, and translate the response back into an UPResponse.- Specified by:
handleRequest
in interfaceEvaluationRuntimeServerInterface
-
addAppVersion
public void addAppVersion(AnyRpcServerContext rpc, com.google.apphosting.base.protos.AppinfoPb.AppInfo appInfo)
Adds the specified application version so that it can be used for future requests.- Specified by:
addAppVersion
in interfaceEvaluationRuntimeServerInterface
-
deleteAppVersion
public void deleteAppVersion(AnyRpcServerContext rpc, com.google.apphosting.base.protos.AppinfoPb.AppInfo appInfo)
Obsolete operation. Deleting app versions has always been theoretically possible but never actually implemented in App Engine.- Specified by:
deleteAppVersion
in interfaceEvaluationRuntimeServerInterface
-
killCloneIfSeriousException
public static void killCloneIfSeriousException(Throwable th)
-
-