Class ProcessorTracingInterceptor
- java.lang.Object
-
- com.avioconsulting.mule.opentelemetry.internal.interceptor.ProcessorTracingInterceptor
-
- All Implemented Interfaces:
org.mule.runtime.api.interception.ProcessorInterceptor
@ThreadSafe public class ProcessorTracingInterceptor extends Object implements org.mule.runtime.api.interception.ProcessorInterceptor
Interceptor to set tracing context information in flow a variable namedTransactionStore.TRACE_CONTEXT_MAP_KEY. SeeTransactionStore.getTransactionContext(String, ComponentLocation)for possible entries in the map.
-
-
Constructor Summary
Constructors Constructor Description ProcessorTracingInterceptor(MuleNotificationProcessor muleNotificationProcessor, org.mule.runtime.api.component.location.ConfigurationComponentLocator configurationComponentLocator)Interceptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter(org.mule.runtime.api.component.location.ComponentLocation location, org.mule.runtime.api.interception.InterceptionEvent event, Optional<Throwable> thrown)CompletableFuture<org.mule.runtime.api.interception.InterceptionEvent>around(org.mule.runtime.api.component.location.ComponentLocation location, Map<String,org.mule.runtime.api.interception.ProcessorParameterValue> parameters, org.mule.runtime.api.interception.InterceptionEvent event, org.mule.runtime.api.interception.InterceptionAction action)NOTE: Without this #around method, the context variable set in #before do not reflect in final event passed to the intercepted processor.voidbefore(org.mule.runtime.api.component.location.ComponentLocation location, Map<String,org.mule.runtime.api.interception.ProcessorParameterValue> parameters, org.mule.runtime.api.interception.InterceptionEvent event)
-
-
-
Constructor Detail
-
ProcessorTracingInterceptor
public ProcessorTracingInterceptor(MuleNotificationProcessor muleNotificationProcessor, org.mule.runtime.api.component.location.ConfigurationComponentLocator configurationComponentLocator)
Interceptor.- Parameters:
muleNotificationProcessor-MuleNotificationProcessorif configured fully to acquire connection supplier.configurationComponentLocator-
-
-
Method Detail
-
before
public void before(org.mule.runtime.api.component.location.ComponentLocation location, Map<String,org.mule.runtime.api.interception.ProcessorParameterValue> parameters, org.mule.runtime.api.interception.InterceptionEvent event)- Specified by:
beforein interfaceorg.mule.runtime.api.interception.ProcessorInterceptor
-
after
public void after(org.mule.runtime.api.component.location.ComponentLocation location, org.mule.runtime.api.interception.InterceptionEvent event, Optional<Throwable> thrown)- Specified by:
afterin interfaceorg.mule.runtime.api.interception.ProcessorInterceptor
-
around
public CompletableFuture<org.mule.runtime.api.interception.InterceptionEvent> around(org.mule.runtime.api.component.location.ComponentLocation location, Map<String,org.mule.runtime.api.interception.ProcessorParameterValue> parameters, org.mule.runtime.api.interception.InterceptionEvent event, org.mule.runtime.api.interception.InterceptionAction action)
NOTE: Without this #around method, the context variable set in #before do not reflect in final event passed to the intercepted processor.- Specified by:
aroundin interfaceorg.mule.runtime.api.interception.ProcessorInterceptor- Parameters:
location- the location and identification properties of the intercepted component in the mule app configuration.parameters- the parameters of the component as defined in the configuration. All the values are lazily evaluated so they will be calculated whenProcessorParameterValue.resolveValue()method gets invoked.event- an object that contains the state of the event to be sent to the component. It may be modified by calling its mutator methods.action- when something other than continuing the interception is desired, the corresponding method on this object must be called. The methods on this object return aCompletableFuturethat may be used to return from this method.- Returns:
- a non-null
CompletableFuture<InterceptionEvent>
-
-