Package org.pipservices4.grpc.test
Class TestCommandableGrpcClient
java.lang.Object
org.pipservices4.grpc.clients.GrpcClient
org.pipservices4.grpc.clients.CommandableGrpcClient
org.pipservices4.grpc.test.TestCommandableGrpcClient
- All Implemented Interfaces:
org.pipservices4.components.config.IConfigurable,org.pipservices4.components.refer.IReferenceable,org.pipservices4.components.run.IClosable,org.pipservices4.components.run.IOpenable
-
Field Summary
Fields inherited from class org.pipservices4.grpc.clients.CommandableGrpcClient
_nameFields inherited from class org.pipservices4.grpc.clients.GrpcClient
_channel, _connectionResolver, _connectTimeout, _counters, _logger, _options, _timeout, _tracer, _uri -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the client. -
Method Summary
Modifier and TypeMethodDescription<T> TcallCommand(Class<T> returnType, String name, org.pipservices4.components.context.IContext context, Object params) Calls a remote method via GRPC commadable protocol.Methods inherited from class org.pipservices4.grpc.clients.GrpcClient
call, close, configure, instrument, isOpen, open, setReferences
-
Constructor Details
-
TestCommandableGrpcClient
Creates a new instance of the client.- Parameters:
name- a service name.
-
-
Method Details
-
callCommand
public <T> T callCommand(Class<T> returnType, String name, org.pipservices4.components.context.IContext context, Object params) Calls a remote method via GRPC commadable protocol. The call is made via Invoke method and all parameters are sent in args object. The complete route to remote method is defined as serviceName + "." + name.- Overrides:
callCommandin classCommandableGrpcClient- Parameters:
returnType- generic type of the return objectname- a name of the command to call.context- (optional) a context to trace execution through call chain.params- command parameters.- Returns:
- the received result.
-