Class MetricsCdiExtension
- All Implemented Interfaces:
Extension
Earlier versions of this class detected app-provided producer fields and methods and triggered creation and registration
of the corresponding metrics upon such detection. As explained in this
MP metrics issue
and this MP metrics PR,
this probably was never correct and does not work because @Metric
no longer applies to producers per the
MP metrics 3.0 spec. The issue and PR discussion explain how developers who provide their own producers should use
CDI qualifiers on the producers (and, therefore, injection points) to avoid ambiguity between their own producers and
producers written by vendors implementing MP metrics.
For Helidon, this means we no longer need to track producer fields and methods, nor do we need to augment injection points
with our own VendorProvided
qualifier to disambiguate, because we now rely on developers who write their own
producers to avoid the ambiguity using qualifiers.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.helidon.servicecommon.restcdi.HelidonRestCdiExtension
HelidonRestCdiExtension.WorkItemsManager<W>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cleans up any data structures created during annotation processing but which are not needed once the CDI container has started.void
enroll
(MetricAnnotationDiscoveryObserver metricAnnotationDiscoveryObserver) Records an observer of metric annotation discoveries.void
enroll
(MetricRegistrationObserver metricRegistrationObserver) Records an observer of metric registrations.protected void
processManagedBean
(ProcessManagedBean<?> pmb) Deals with a managed bean that survived vetoing, provided by concrete extension implementations.registerService
(Object adv, BeanManager bm, ServerCdiExtension server) Registers the service-related endpoint, after security and as CDI initializes the app scope, returning the default routing for optional use by the caller.protected Config
Returns the SE config to use in setting up the component's SE service.Methods inherited from class io.helidon.servicecommon.restcdi.HelidonRestCdiExtension
isConcreteNonInterceptor, isOwnProducerOrNonDefaultQualified, observeManagedBeans, producers, recordAnnotatedType, recordProducerField, recordProducerMethod, serviceSupport
-
Constructor Details
-
MetricsCdiExtension
public MetricsCdiExtension()Creates a new extension instance.
-
-
Method Details
-
enroll
Records an observer of metric annotation discoveries.- Parameters:
metricAnnotationDiscoveryObserver
- the observer to enroll
-
enroll
Records an observer of metric registrations.- Parameters:
metricRegistrationObserver
- the observer to enroll
-
processManagedBean
Description copied from class:HelidonRestCdiExtension
Deals with a managed bean that survived vetoing, provided by concrete extension implementations.The meaning of "process" varies among the concrete implementations. At this point, this base implementation has managed the annotation processing in a general way (e.g., only non-vetoed beans survive) and now delegates to the concrete implementations to actually respond appropriately to the bean and whichever of its members are annotated.
- Specified by:
processManagedBean
in classHelidonRestCdiExtension<MetricsSupport>
- Parameters:
pmb
- the managed bean, with at least one annotation of interest to the extension
-
clearAnnotationInfo
Description copied from class:HelidonRestCdiExtension
Cleans up any data structures created during annotation processing but which are not needed once the CDI container has started.- Overrides:
clearAnnotationInfo
in classHelidonRestCdiExtension<MetricsSupport>
- Parameters:
adv
- theAfterDeploymentValidation
event
-
registerService
public Routing.Builder registerService(@Observes @Priority(1010) @Initialized(jakarta.enterprise.context.ApplicationScoped.class) Object adv, BeanManager bm, ServerCdiExtension server) Description copied from class:HelidonRestCdiExtension
Registers the service-related endpoint, after security and as CDI initializes the app scope, returning the default routing for optional use by the caller.- Overrides:
registerService
in classHelidonRestCdiExtension<MetricsSupport>
- Parameters:
adv
- app-scoped initialization eventbm
- BeanManagerserver
- the ServerCdiExtension- Returns:
- default routing
-
seComponentConfig
Description copied from class:HelidonRestCdiExtension
Returns the SE config to use in setting up the component's SE service.- Overrides:
seComponentConfig
in classHelidonRestCdiExtension<MetricsSupport>
- Returns:
- the SE config node for the component-specific configuration
-