Class GrpcPlugin
java.lang.Object
com.google.apphosting.runtime.anyrpc.AnyRpcPlugin
com.google.apphosting.runtime.grpc.GrpcPlugin
RPC plugin for gRPC.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRuns the main loop for the server and waits for the server to shutdown.intvoidinitialize(int serverPort) Initializes the plugin, possibly creating any sockets/files/channels/connections needed.booleanReturns true if the server has been started and has not stopped.voidshutdown()Performs any actions that are necessary to shut down any clients or servers started from this plugin.voidstartServer(EvaluationRuntimeServerInterface evaluationRuntime, CloneControllerServerInterface cloneController) Starts the server using the two specified implementations of the RPC-agnostic EvaluationRuntime and CloneController interfaces.voidStops the server.traceContextPropagating(Runnable runnable) Wraps the providedRunnableso as to assure propagation of the tracing context.
-
Constructor Details
-
GrpcPlugin
public GrpcPlugin()
-
-
Method Details
-
initialize
public void initialize(int serverPort) Description copied from class:AnyRpcPluginInitializes the plugin, possibly creating any sockets/files/channels/connections needed.- Specified by:
initializein classAnyRpcPlugin- Parameters:
serverPort- the port to listen for RPCs on.
-
startServer
public void startServer(EvaluationRuntimeServerInterface evaluationRuntime, CloneControllerServerInterface cloneController) Description copied from class:AnyRpcPluginStarts the server using the two specified implementations of the RPC-agnostic EvaluationRuntime and CloneController interfaces.- Specified by:
startServerin classAnyRpcPlugin- Parameters:
evaluationRuntime- the evaluation runtime service implementationcloneController- the clone controller service implementation
-
getServerPort
public int getServerPort() -
serverStarted
public boolean serverStarted()Description copied from class:AnyRpcPluginReturns true if the server has been started and has not stopped.- Specified by:
serverStartedin classAnyRpcPlugin
-
blockUntilShutdown
public void blockUntilShutdown()Description copied from class:AnyRpcPluginRuns 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:
blockUntilShutdownin classAnyRpcPlugin
-
stopServer
public void stopServer()Description copied from class:AnyRpcPluginStops the server.- Specified by:
stopServerin classAnyRpcPlugin
-
shutdown
public void shutdown()Description copied from class:AnyRpcPluginPerforms any actions that are necessary to shut down any clients or servers started from this plugin.- Specified by:
shutdownin classAnyRpcPlugin
-
traceContextPropagating
Description copied from class:AnyRpcPluginWraps the providedRunnableso as to assure propagation of the tracing context.- Specified by:
traceContextPropagatingin classAnyRpcPlugin- Parameters:
runnable- the Runnable to wrap- Returns:
- a Runnable that sets up propagation of the tracing context and then invokes the original one
-