Package io.temporal.internal.testservice
Class InProcessGRPCServer
- java.lang.Object
-
- io.temporal.internal.testservice.InProcessGRPCServer
-
public class InProcessGRPCServer extends java.lang.Object
Generates an in-process service and the channel for it. Useful for testing, usually with mock and spy services.
-
-
Constructor Summary
Constructors Constructor Description InProcessGRPCServer(java.util.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(java.util.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
io.grpc.ManagedChannel
getChannel()
io.grpc.Server
getServer()
boolean
isShutdown()
boolean
isTerminated()
void
shutdown()
void
shutdownNow()
-
-
-
Constructor Detail
-
InProcessGRPCServer
public InProcessGRPCServer(java.util.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. 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
public InProcessGRPCServer(java.util.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.- Parameters:
services
- implementations of the gRPC services. For example, one of them can be an instance extendingWorkflowServiceGrpc.WorkflowServiceImplBase
createChannel
- defines if a channel to access the created server should be created. If true, the created channel will be accessible usinggetChannel()
-
-
Method Detail
-
shutdown
public void shutdown()
-
shutdownNow
public void shutdownNow()
-
isShutdown
public boolean isShutdown()
-
isTerminated
public boolean isTerminated()
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
-
getServer
public io.grpc.Server getServer()
-
getChannel
@Nullable public io.grpc.ManagedChannel getChannel()
-
-