Class InProcessTestAutoConfiguration.TestInProcessGrpcChannelFactory
java.lang.Object
org.springframework.grpc.client.DefaultGrpcChannelFactory<io.grpc.inprocess.InProcessChannelBuilder>
org.springframework.grpc.client.InProcessGrpcChannelFactory
org.springframework.boot.grpc.test.autoconfigure.InProcessTestAutoConfiguration.TestInProcessGrpcChannelFactory
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, GrpcChannelFactory
- Enclosing class:
InProcessTestAutoConfiguration
public static class InProcessTestAutoConfiguration.TestInProcessGrpcChannelFactory
extends InProcessGrpcChannelFactory
Specialization of
InProcessGrpcChannelFactory that allows the channel
factory to support all targets, not just those that start with 'in-process:'.- Since:
- 1.0.0
- Author:
- Chris Bono, Dave Syer, Andrey Litvitski
-
Field Summary
Fields inherited from class DefaultGrpcChannelFactory
targets -
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
-
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 classInProcessGrpcChannelFactory- Parameters:
target- the target string as described in method javadocs- Returns:
trueso that the test factory can handle all targets not just those prefixed with 'in-process:'
-
newChannelBuilder
protected io.grpc.inprocess.InProcessChannelBuilder newChannelBuilder(String target, io.grpc.ChannelCredentials creds) Creates 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 the parent behavior so that the channel factory can handle all targets, not just those that prefixed with 'in-process:'.
- Overrides:
newChannelBuilderin classInProcessGrpcChannelFactory- Parameters:
target- the target of the channelcreds- the credentials for the channel which are ignored in this case- Returns:
- a new inprocess channel builder instance
-