Package io.micronaut.grpc.channels
Class GrpcManagedChannelFactory
java.lang.Object
io.micronaut.grpc.channels.GrpcManagedChannelFactory
- All Implemented Interfaces:
AutoCloseable
Factory bean for creating
ManagedChannel
instances.- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorDescriptionGrpcManagedChannelFactory
(io.micronaut.context.ApplicationContext beanContext) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected io.grpc.ManagedChannel
managedChannel
(io.micronaut.inject.InjectionPoint<io.grpc.Channel> injectionPoint) Builds a managed channel for the given target.
-
Constructor Details
-
GrpcManagedChannelFactory
public GrpcManagedChannelFactory(io.micronaut.context.ApplicationContext beanContext) Default constructor.- Parameters:
beanContext
- The bean context
-
-
Method Details
-
managedChannel
@Bean @Primary protected io.grpc.ManagedChannel managedChannel(io.micronaut.inject.InjectionPoint<io.grpc.Channel> injectionPoint) Builds a managed channel for the given target.- Parameters:
injectionPoint
- The injection point- Returns:
- The channel
-
close
@PreDestroy public void close()- Specified by:
close
in interfaceAutoCloseable
-