Class InProcessGrpcChannelFactory
java.lang.Object
org.springframework.grpc.client.DefaultGrpcChannelFactory<io.grpc.inprocess.InProcessChannelBuilder>
org.springframework.grpc.client.InProcessGrpcChannelFactory
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, GrpcChannelFactory
public class InProcessGrpcChannelFactory
extends DefaultGrpcChannelFactory<io.grpc.inprocess.InProcessChannelBuilder>
GrpcChannelFactory that creates in-process gRPC channels.- Author:
- Chris Bono
-
Field Summary
Fields inherited from class DefaultGrpcChannelFactory
targets -
Constructor Summary
ConstructorsConstructorDescriptionInProcessGrpcChannelFactory(List<GrpcChannelBuilderCustomizer<io.grpc.inprocess.InProcessChannelBuilder>> globalCustomizers, ClientInterceptorsConfigurer interceptorsConfigurer) Construct an in-process channel factory instance and sets thevirtualTargetsto the identity function so that the exact passed in target string is used as the target of the channel factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.grpc.inprocess.InProcessChannelBuildernewChannelBuilder(String target, io.grpc.ChannelCredentials creds) Creates a newManagedChannelBuilderinstance for the given target and credentials.booleanWhether this factory supports the given target string.Methods inherited from class DefaultGrpcChannelFactory
createChannel, destroy, setCredentialsProvider, setInterceptorFilter, setVirtualTargets, supportsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GrpcChannelFactory
createChannel
-
Constructor Details
-
InProcessGrpcChannelFactory
public InProcessGrpcChannelFactory(List<GrpcChannelBuilderCustomizer<io.grpc.inprocess.InProcessChannelBuilder>> globalCustomizers, ClientInterceptorsConfigurer interceptorsConfigurer) Construct an in-process channel factory instance and sets thevirtualTargetsto the identity function so that the exact passed in target string is used as the target of the channel factory.- Parameters:
globalCustomizers- the global customizers to apply to all created channelsinterceptorsConfigurer- configures the client interceptors on the created channels
-
-
Method Details
-
supports
Whether this factory supports the given target string.The target can be either a valid nameresolver-compliant URI or an authority string as described in
Grpc.newChannelBuilder(String, ChannelCredentials), or the name of a user-configured channel (e.g. 'my-channel').- Specified by:
supportsin interfaceGrpcChannelFactory- Overrides:
supportsin classDefaultGrpcChannelFactory<io.grpc.inprocess.InProcessChannelBuilder>- Parameters:
target- the target string- Returns:
- true if the target begins with 'in-process:'
-
newChannelBuilder
protected io.grpc.inprocess.InProcessChannelBuilder newChannelBuilder(String target, io.grpc.ChannelCredentials creds) Description copied from class:DefaultGrpcChannelFactoryCreates a newManagedChannelBuilderinstance for the given target and credentials. Thetargetis a valid nameresolver-compliant URI or an authority string as described inGrpc.newChannelBuilder(String, ChannelCredentials).- Overrides:
newChannelBuilderin classDefaultGrpcChannelFactory<io.grpc.inprocess.InProcessChannelBuilder>- Parameters:
target- the target of the channelcreds- the credentials for the channel- Returns:
- a new builder for the given target and credentials
-