Package io.servicetalk.grpc.api
Class GrpcClientFactory<Client extends GrpcClient<BlockingClient>,BlockingClient extends BlockingGrpcClient<Client>>
java.lang.Object
io.servicetalk.grpc.api.GrpcClientFactory<Client,BlockingClient>
- Type Parameters:
Client- gRPC service that any client built from this factory represents.BlockingClient- Blocking gRPC service that any client built from this builder represents.
- Direct Known Subclasses:
Health.ClientFactory
public abstract class GrpcClientFactory<Client extends GrpcClient<BlockingClient>,BlockingClient extends BlockingGrpcClient<Client>>
extends Object
A factory for creating clients that follows the specified gRPC
GrpcClientFactory
contract.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BufferDecoderGroupGet the supportedBufferDecoderGroupfor this client factory.bufferDecoderGroup(BufferDecoderGroup bufferDecoderGroup) Sets the supportedBufferDecoderGroupfor this client factory.protected abstract BlockingClientnewBlockingClient(GrpcClientCallFactory clientCallFactory) Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.final BlockingClientnewBlockingClientForCallFactory(GrpcClientCallFactory clientCallFactory) Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.protected abstract ClientnewClient(GrpcClientCallFactory clientCallFactory) Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.final ClientnewClientForCallFactory(GrpcClientCallFactory clientCallFactory) Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.protected List<ContentCodec>Deprecated.supportedMessageCodings(List<ContentCodec> codings) Deprecated.
-
Constructor Details
-
GrpcClientFactory
public GrpcClientFactory()
-
-
Method Details
-
newClientForCallFactory
Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.- Parameters:
clientCallFactory-GrpcClientCallFactoryto use for creating client calls. The returnedGrpcClientFactoryshould own the lifecycle of this factory.- Returns:
- A new gRPC client following the specified
gRPC
GrpcClientFactorycontract.
-
newBlockingClientForCallFactory
public final BlockingClient newBlockingClientForCallFactory(GrpcClientCallFactory clientCallFactory) Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.- Parameters:
clientCallFactory-GrpcClientCallFactoryto use for creating client calls. The returnedGrpcClientFactoryshould own the lifecycle of this factory.- Returns:
- A new gRPC client following the specified
gRPC
GrpcClientFactorycontract.
-
supportedMessageCodings
@Deprecated public GrpcClientFactory<Client,BlockingClient> supportedMessageCodings(List<ContentCodec> codings) Deprecated.Sets the supported message encodings for this client factory. By default onlyIdentity.identity()is supported- Parameters:
codings- The supported encodingsContentCodecs for this client.- Returns:
this
-
supportedMessageCodings
Deprecated.Return the supportedContentCodecs for this client factory.- Returns:
- the supported
ContentCodecs for this client factory.
-
bufferDecoderGroup
public GrpcClientFactory<Client,BlockingClient> bufferDecoderGroup(BufferDecoderGroup bufferDecoderGroup) Sets the supportedBufferDecoderGroupfor this client factory. By default onlyIdentity.identityEncoder()is supportedBufferDecoderGroup.- Parameters:
bufferDecoderGroup- The supportedBufferDecoderGroupfor this client.- Returns:
this
-
bufferDecoderGroup
Get the supportedBufferDecoderGroupfor this client factory.- Returns:
- the supported
BufferDecoderGroupfor this client factory.
-
newClient
Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.- Parameters:
clientCallFactory-GrpcClientCallFactoryto use for creating client calls. The returnedGrpcClientFactoryshould own the lifecycle of this factory.- Returns:
- A new gRPC client following the specified
gRPC
GrpcClientFactorycontract.
-
newBlockingClient
Create a new client that follows the specified gRPCGrpcClientFactorycontract using the passedGrpcClientCallFactory.- Parameters:
clientCallFactory-GrpcClientCallFactoryto use for creating client calls. The returnedGrpcClientFactoryshould own the lifecycle of this factory.- Returns:
- A new gRPC client following the specified
gRPC
GrpcClientFactorycontract.
-
ListofBufferEncoders andBufferDecoderGroup.