Class GrpcServiceRegistrar
java.lang.Object
io.micronaut.protobuf.json.registry.GrpcServiceRegistrar
- All Implemented Interfaces:
io.micronaut.context.processor.AnnotationProcessor<GrpcRestJsonExposed,
,io.micronaut.inject.ExecutableMethod<?, ?>> io.micronaut.context.processor.ExecutableMethodProcessor<GrpcRestJsonExposed>
@Singleton
public class GrpcServiceRegistrar
extends Object
implements io.micronaut.context.processor.ExecutableMethodProcessor<GrpcRestJsonExposed>
The
This class implements the
The registrar operates at startup to facilitate the integration of gRPC services with REST-based clients by leveraging JSON payloads.
It uses the
Annotations: -
Constructor: - Requires a
Logging: - Maintains an internal logger to track the registration process of gRPC methods.
GrpcServiceRegistrar
is responsible for processing methods annotated with
@GrpcRestJsonExposed
during application startup and registering them with the
GrpcServiceRegistry
. This enables gRPC methods to be invoked via JSON over REST.
This class implements the
ExecutableMethodProcessor
interface for the
@GrpcRestJsonExposed
annotation and ensures that the annotated methods are
identified and registered.
The registrar operates at startup to facilitate the integration of gRPC services with REST-based clients by leveraging JSON payloads.
It uses the
GrpcServiceRegistry
to maintain a mapping of registered methods.
Annotations: -
@Singleton
: Indicates that this class is a singleton within the application context.
- @Experimental
: Denotes that the class features experimental functionality
and may be prone to modifications in future versions.
Constructor: - Requires a
GrpcServiceRegistry
instance for method registration.
Logging: - Maintains an internal logger to track the registration process of gRPC methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
process
(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) Processes a bean definition and its executable method annotated with@GrpcRestJsonExposed
.
-
Constructor Details
-
GrpcServiceRegistrar
-
-
Method Details
-
process
public void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) Processes a bean definition and its executable method annotated with@GrpcRestJsonExposed
. Registers the annotated gRPC method with theGrpcServiceRegistry
, enabling the method to be invoked via JSON over REST.- Specified by:
process
in interfaceio.micronaut.context.processor.AnnotationProcessor<GrpcRestJsonExposed,
io.micronaut.inject.ExecutableMethod<?, ?>> - Specified by:
process
in interfaceio.micronaut.context.processor.ExecutableMethodProcessor<GrpcRestJsonExposed>
- Parameters:
beanDefinition
- the bean definition containing the gRPC service class where the method is definedmethod
- the executable method annotated with@GrpcRestJsonExposed
to be registered
-