Class AnyRpcPlugin

java.lang.Object
com.google.apphosting.runtime.anyrpc.AnyRpcPlugin
Direct Known Subclasses:
GrpcPlugin, NullRpcPlugin

public abstract class AnyRpcPlugin extends Object
Base class for RPC-specific plugins.
  • Constructor Details

    • AnyRpcPlugin

      protected AnyRpcPlugin()
  • Method Details

    • initialize

      public abstract void initialize(int serverPort)
      Initializes the plugin, possibly creating any sockets/files/channels/connections needed.
      Parameters:
      serverPort - the port to listen for RPCs on.
    • startServer

      public abstract void startServer(EvaluationRuntimeServerInterface evaluationRuntime, CloneControllerServerInterface cloneController)
      Starts the server using the two specified implementations of the RPC-agnostic EvaluationRuntime and CloneController interfaces.
      Parameters:
      evaluationRuntime - the evaluation runtime service implementation
      cloneController - the clone controller service implementation
    • serverStarted

      public abstract boolean serverStarted()
      Returns true if the server has been started and has not stopped.
    • blockUntilShutdown

      public abstract void blockUntilShutdown()
      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 startServer(EvaluationRuntimeServerInterface, CloneControllerServerInterface).

      Throws:
      AssertionError - if startServer was not called or didn't complete successfully
    • stopServer

      public abstract void stopServer()
      Stops the server.
      Throws:
      AssertionError - if startServer was not called or didn't complete successfully
    • shutdown

      public abstract void shutdown()
      Performs any actions that are necessary to shut down any clients or servers started from this plugin.
    • traceContextPropagating

      public abstract Runnable traceContextPropagating(Runnable runnable)
      Wraps the provided Runnable so as to assure propagation of the tracing context.
      Parameters:
      runnable - the Runnable to wrap
      Returns:
      a Runnable that sets up propagation of the tracing context and then invokes the original one