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 Summary
Constructors Modifier Constructor Description protectedAnyRpcPlugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidblockUntilShutdown()Runs the main loop for the server and waits for the server to shutdown.abstract voidinitialize(int serverPort)Initializes the plugin, possibly creating any sockets/files/channels/connections needed.abstract booleanserverStarted()Returns true if the server has been started and has not stopped.abstract voidshutdown()Performs any actions that are necessary to shut down any clients or servers started from this plugin.abstract voidstartServer(EvaluationRuntimeServerInterface evaluationRuntime, CloneControllerServerInterface cloneController)Starts the server using the two specified implementations of the RPC-agnostic EvaluationRuntime and CloneController interfaces.abstract voidstopServer()Stops the server.abstract RunnabletraceContextPropagating(Runnable runnable)Wraps the providedRunnableso as to assure propagation of the tracing context.
-
-
-
Method Detail
-
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 implementationcloneController- 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- ifstartServerwas not called or didn't complete successfully
-
stopServer
public abstract void stopServer()
Stops the server.- Throws:
AssertionError- ifstartServerwas 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 providedRunnableso 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
-
-