InvocationHandler used for proxying Jakarta MessageConsumer.
Each invocation to a setMessageListener method is intercepted and the given
MessageListener is wrapped to create a
dedicated observation. This
instrumentation also creates an Observation. to propagate the observation
context in the listener callback.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final JmsProcessObservationConvention | |
| private final ObservationRegistry | |
| private final MessageConsumer |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| DEFAULT_CONVENTION | back to summary |
|---|---|
| private static final JmsProcessObservationConvention DEFAULT_CONVENTION | |
| registry | back to summary |
|---|---|
| private final ObservationRegistry registry | |
| target | back to summary |
|---|---|
| private final MessageConsumer target | |
| MessageConsumerInvocationHandler | back to summary |
|---|---|
| pack-priv MessageConsumerInvocationHandler(MessageConsumer target, ObservationRegistry registry) | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final MessageListener | |
| private final ObservationRegistry |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | onMessage(Message
the message passed to the listener message)Implements jakarta. Passes a message to the listener. |
| delegate | back to summary |
|---|---|
| private final MessageListener delegate | |
| registry | back to summary |
|---|---|
| private final ObservationRegistry registry | |
| ObservedMessageListener | back to summary |
|---|---|
| pack-priv ObservedMessageListener(MessageListener delegate, ObservationRegistry registry) | |
| onMessage | back to summary |
|---|---|
| public void onMessage(Message message) Implements jakarta. Doc from jakarta. Passes a message to the listener. | |