Class InProcessChannelFactory
java.lang.Object
net.devh.boot.grpc.client.channelfactory.AbstractChannelFactory<InProcessChannelBuilder>
net.devh.boot.grpc.client.channelfactory.InProcessChannelFactory
- All Implemented Interfaces:
AutoCloseable,GrpcChannelFactory
This channel factory creates and manages in-process
GrpcChannelFactorys.
This class utilizes connection pooling and thus needs to be closed after usage.
-
Field Summary
Fields inherited from class net.devh.boot.grpc.client.channelfactory.AbstractChannelFactory
channelConfigurers, globalClientInterceptorRegistry -
Constructor Summary
ConstructorsConstructorDescriptionInProcessChannelFactory(GrpcChannelsProperties properties, GlobalClientInterceptorRegistry globalClientInterceptorRegistry) Creates a new InProcessChannelFactory with the given properties.InProcessChannelFactory(GrpcChannelsProperties properties, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, List<GrpcChannelConfigurer> channelConfigurers) Creates a new InProcessChannelFactory with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureSecurity(InProcessChannelBuilder builder, String name) Configures the security options that should be used by the channel.protected InProcessChannelBuildernewChannelBuilder(String name) Creates a newManagedChannelBuilderfor the given client name.Methods inherited from class net.devh.boot.grpc.client.channelfactory.AbstractChannelFactory
close, configure, configureCompression, configureKeepAlive, configureLimits, configureUserAgent, createChannel, createChannel, getConnectivityState, getDefaultScheme, getPropertiesFor, isNonNullAndNonBlank, newManagedChannel, watchConnectivityStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.devh.boot.grpc.client.channelfactory.GrpcChannelFactory
createChannel
-
Constructor Details
-
InProcessChannelFactory
public InProcessChannelFactory(GrpcChannelsProperties properties, GlobalClientInterceptorRegistry globalClientInterceptorRegistry) Creates a new InProcessChannelFactory with the given properties.- Parameters:
properties- The properties for the channels to create.globalClientInterceptorRegistry- The interceptor registry to use.
-
InProcessChannelFactory
public InProcessChannelFactory(GrpcChannelsProperties properties, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, List<GrpcChannelConfigurer> channelConfigurers) Creates a new InProcessChannelFactory with the given properties.- Parameters:
properties- The properties for the channels to create.globalClientInterceptorRegistry- The interceptor registry to use.channelConfigurers- The channel configurers to use. Can be empty.
-
-
Method Details
-
newChannelBuilder
Description copied from class:AbstractChannelFactoryCreates a newManagedChannelBuilderfor the given client name.- Specified by:
newChannelBuilderin classAbstractChannelFactory<InProcessChannelBuilder>- Parameters:
name- The name to create the channel builder for.- Returns:
- The newly created channel builder.
-
configureSecurity
Description copied from class:AbstractChannelFactoryConfigures the security options that should be used by the channel.- Overrides:
configureSecurityin classAbstractChannelFactory<InProcessChannelBuilder>- Parameters:
builder- The channel builder to configure.name- The name of the client to configure.
-