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 extends GenericServlet.

JavaRuntime is not responsible for configuring ApiProxy with a delegate. This class should probably be instantiated by JavaRuntimeFactory, which also sets up ApiProxy.

  • Method Details

    • 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 a HttpServletRequest, invoke the specified servlet, and translate the response back into an UPResponse.
      Specified by:
      handleRequest in interface EvaluationRuntimeServerInterface
    • 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 interface EvaluationRuntimeServerInterface
    • 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 interface EvaluationRuntimeServerInterface
    • killCloneIfSeriousException

      public static void killCloneIfSeriousException(Throwable th)