Class GrpcPlugin

java.lang.Object
com.google.apphosting.runtime.anyrpc.AnyRpcPlugin
com.google.apphosting.runtime.grpc.GrpcPlugin

public class GrpcPlugin extends AnyRpcPlugin
RPC plugin for gRPC.
  • Constructor Details

    • GrpcPlugin

      public GrpcPlugin()
  • Method Details

    • initialize

      public void initialize(int serverPort)
      Description copied from class: AnyRpcPlugin
      Initializes the plugin, possibly creating any sockets/files/channels/connections needed.
      Specified by:
      initialize in class AnyRpcPlugin
      Parameters:
      serverPort - the port to listen for RPCs on.
    • startServer

      public void startServer(EvaluationRuntimeServerInterface evaluationRuntime, CloneControllerServerInterface cloneController)
      Description copied from class: AnyRpcPlugin
      Starts the server using the two specified implementations of the RPC-agnostic EvaluationRuntime and CloneController interfaces.
      Specified by:
      startServer in class AnyRpcPlugin
      Parameters:
      evaluationRuntime - the evaluation runtime service implementation
      cloneController - the clone controller service implementation
    • getServerPort

      public int getServerPort()
    • serverStarted

      public boolean serverStarted()
      Description copied from class: AnyRpcPlugin
      Returns true if the server has been started and has not stopped.
      Specified by:
      serverStarted in class AnyRpcPlugin
    • blockUntilShutdown

      public void blockUntilShutdown()
      Description copied from class: AnyRpcPlugin
      Runs the main loop for the server and waits for the server to shutdown.

      This method MUST be called from the same thread that called AnyRpcPlugin.startServer(EvaluationRuntimeServerInterface, CloneControllerServerInterface).

      Specified by:
      blockUntilShutdown in class AnyRpcPlugin
    • stopServer

      public void stopServer()
      Description copied from class: AnyRpcPlugin
      Stops the server.
      Specified by:
      stopServer in class AnyRpcPlugin
    • shutdown

      public void shutdown()
      Description copied from class: AnyRpcPlugin
      Performs any actions that are necessary to shut down any clients or servers started from this plugin.
      Specified by:
      shutdown in class AnyRpcPlugin
    • traceContextPropagating

      public Runnable traceContextPropagating(Runnable runnable)
      Description copied from class: AnyRpcPlugin
      Wraps the provided Runnable so as to assure propagation of the tracing context.
      Specified by:
      traceContextPropagating in class AnyRpcPlugin
      Parameters:
      runnable - the Runnable to wrap
      Returns:
      a Runnable that sets up propagation of the tracing context and then invokes the original one