- All Implemented Interfaces:
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
Constructor SummaryConstructorDescriptionCreates a new extension instance.
Method SummaryModifier and TypeMethodDescription
voidCleans up any data structures created during annotation processing but which are not needed once the CDI container has started.
protected ConfigSE Configuration of the current compoennt.
voidRecords an observer of metric annotation discoveries.
voidRecords an observer of metric registrations.
protected voidDeals with a managed bean that survived vetoing, provided by concrete extension implementations.
voidRegister the Metrics observer with server observer feature.
Methods inherited from class io.helidon.microprofile.servicecommon.HelidonRestCdiExtension
isConcreteNonInterceptor, isOwnProducerOrNonDefaultQualified, nestedConfigKey, observeManagedBeans, prepareRuntime, producers, recordAnnotatedType, recordProducerField, recordProducerMethod, rootConfig, routingBuilder
MetricsCdiExtensionpublic MetricsCdiExtension()Creates a new extension instance.
enrollpublic void enroll
(MetricAnnotationDiscoveryObserver metricAnnotationDiscoveryObserver)Records an observer of metric annotation discoveries.
metricAnnotationDiscoveryObserver- the observer to enroll
enrollpublic void enroll
(MetricRegistrationObserver metricRegistrationObserver)Records an observer of metric registrations.
metricRegistrationObserver- the observer to enroll
clearAnnotationInfoCleans up any data structures created during annotation processing but which are not needed once the CDI container has started.
registerServicepublic void registerService
(@Observes @Priority(1010) @Initialized(jakarta.enterprise.context.ApplicationScoped.class) Object event, BeanManager bm, ServerCdiExtension server)Register the Metrics observer with server observer feature. This is a CDI observer method invoked by CDI machinery.
event- event object
bm- CDI bean manager
server- Server CDI extension
processManagedBeanprotected void processManagedBean
(ProcessManagedBean<?> pmb)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.
componentConfigprotected Config componentConfig()SE Configuration of the current compoennt.