Class InProcessGRPCServer
java.lang.Object
io.temporal.internal.testservice.InProcessGRPCServer
Generates an in-process service and the channel for it. Useful for testing, usually with mock and
spy services.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis interceptor is needed for testing RESOURCE_EXHAUSTED error handling because in-process gRPC server doesn't check and cannot be configured to check message size. -
Constructor Summary
ConstructorsConstructorDescriptionInProcessGRPCServer(Collection<io.grpc.BindableService> services) Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them.InProcessGRPCServer(Collection<io.grpc.BindableService> services, boolean createChannel) Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) io.grpc.ManagedChannelio.grpc.Serverbooleanbooleanvoidshutdown()void
-
Constructor Details
-
InProcessGRPCServer
Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them. Also provides a channel to access the created server, seegetChannel()- Parameters:
services- implementations of the gRPC services. For example, one of them can be an instance extendingWorkflowServiceGrpc.WorkflowServiceImplBase
-
InProcessGRPCServer
Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them.- Parameters:
services- implementations of the gRPC services. For example, one of them can be an instance extendingWorkflowServiceGrpc.WorkflowServiceImplBasecreateChannel- defines if a channel to access the created server should be created. If true, the created channel will be accessible usinggetChannel()
-
-
Method Details
-
shutdown
public void shutdown() -
shutdownNow
public void shutdownNow() -
isShutdown
public boolean isShutdown() -
isTerminated
public boolean isTerminated() -
awaitTermination
-
getServer
public io.grpc.Server getServer() -
getChannel
@Nullable public io.grpc.ManagedChannel getChannel()
-