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
GrpcChannelFactory
s.
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 void
configureSecurity
(InProcessChannelBuilder builder, String name) Configures the security options that should be used by the channel.protected InProcessChannelBuilder
newChannelBuilder
(String name) Creates a newManagedChannelBuilder
for 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, watchConnectivityState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:AbstractChannelFactory
Creates a newManagedChannelBuilder
for the given client name.- Specified by:
newChannelBuilder
in classAbstractChannelFactory<InProcessChannelBuilder>
- Parameters:
name
- The name to create the channel builder for.- Returns:
- The newly created channel builder.
-
configureSecurity
Description copied from class:AbstractChannelFactory
Configures the security options that should be used by the channel.- Overrides:
configureSecurity
in classAbstractChannelFactory<InProcessChannelBuilder>
- Parameters:
builder
- The channel builder to configure.name
- The name of the client to configure.
-