public abstract class ComponentMessageProcessor<T extends org.mule.runtime.api.meta.model.ComponentModel> extends ExtensionComponent<T> implements Processor, ParametersResolverProcessor<T>, org.mule.runtime.api.lifecycle.Lifecycle
Processor capable of executing extension components.
If required, it obtains a configuration instance, evaluate all the operation parameters and executes it by using a
componentExecutor. This message processor is capable of serving the execution of any of any
ExtensionModel.
A componentExecutor is obtained by testing the T for a CompletableComponentExecutorModelProperty
through which a CompletableComponentExecutorFactory is obtained. Models with no such property cannot be used with this
class. The obtained CompletableComponentExecutor serve all invocations of process(CoreEvent) on this
instance but will not be shared with other instances of ComponentMessageProcessor. All the Lifecycle events
that this instance receives will be propagated to the componentExecutor.
The componentExecutor is executed directly but by the means of a DefaultExecutionMediator
Before executing the operation will use the PolicyManager to lookup for a OperationPolicy that must be applied
to the operation. If there's a policy to be applied then it will interleave the operation execution with the policy logic
allowing the policy to execute logic over the operation parameters, change those parameters and then execute logic with the
operation response.
ReactiveProcessor.ProcessingType| Modifier and Type | Field and Description |
|---|---|
protected org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor |
componentExecutor |
protected ExecutionMediator |
executionMediator |
protected org.mule.runtime.api.meta.model.ExtensionModel |
extensionModel |
protected MessageProcessorChain |
nestedChain |
protected ClassLoader |
nestedChainClassLoader |
protected PolicyManager |
policyManager |
static String |
PROCESSOR_PATH_MDC_KEY |
protected ResolverSet |
resolverSet |
protected RetryPolicyTemplate |
retryPolicyTemplate |
protected ReturnDelegate |
returnDelegate |
protected String |
target |
protected String |
targetValue |
cacheIdGenerator, classLoader, componentLocator, componentModel, connectionManager, cursorProviderFactory, errorTypeRepository, expressionManager, extensionManager, metadataService, muleContext, streamingManager, transactionFactoryLocator| Constructor and Description |
|---|
ComponentMessageProcessor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
T componentModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
String target,
String targetValue,
ResolverSet resolverSet,
CursorProviderFactory cursorProviderFactory,
RetryPolicyTemplate retryPolicyTemplate,
MessageProcessorChain nestedChain,
ClassLoader classLoader,
ExtensionManager extensionManager,
PolicyManager policyManager,
ReflectionCache reflectionCache,
DefaultExecutionMediator.ResultTransformer resultTransformer,
long terminationTimeout) |
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<CoreEvent> |
apply(org.reactivestreams.Publisher<CoreEvent> publisher) |
protected ExecutionMediator |
createExecutionMediator() |
protected InterceptorChain |
createInterceptorChain() |
protected ReturnDelegate |
createReturnDelegate() |
void |
disposeResolvedParameters(org.mule.runtime.extension.api.runtime.operation.ExecutionContext<T> executionContext) |
void |
doDispose()
Implementors will use this method to perform their own disposing logic
|
protected void |
doInitialise()
Implementors will use this method to perform their own initialisation logic
|
void |
doStart()
Implementors will use this method to perform their own starting logic
|
void |
doStop()
Implementors will use this method to perform their own stopping logic
|
protected void |
executeOperation(ExecutionContextAdapter<T> operationContext,
org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor.ExecutorCallback callback) |
ReactiveProcessor.ProcessingType |
getInnerProcessingType()
This is the processing type that is actually taken into account when the processing strategy is applied.
|
protected SdkInternalContext.OperationExecutionParams |
getOperationExecutionParams(CoreEvent event) |
protected ParameterValueResolver |
getParameterValueResolver() |
ReactiveProcessor.ProcessingType |
getProcessingType() |
protected RetryPolicyTemplateResolver |
getRetryPolicyTemplateResolver() |
protected ReturnDelegate |
getTargetReturnDelegate() |
protected ValueReturnDelegate |
getValueReturnDelegate() |
protected boolean |
isAsyncExecutableBasedOn(Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> staticConfig) |
protected boolean |
isBlocking() |
protected boolean |
isTargetPresent() |
protected boolean |
mayCompleteInDifferentThread()
This indicates that the component message processor may jump threads under certain conditions (not necessarily always).
|
CoreEvent |
process(CoreEvent event) |
void |
resolveParameters(CoreEvent.Builder eventBuilder,
BiConsumer<Map<String,Supplier<Object>>,org.mule.runtime.extension.api.runtime.operation.ExecutionContext> afterConfigurer) |
protected void |
startIfNeededNestedChain()
If the
nestedChain is not null, it changes the current ClassLoader for the Application's ClassLoader
nestedChainClassLoader to start the processors, and then it goes back to the previous ClassLoader. |
String |
toString() |
protected abstract void |
validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
Validates that the
ExtensionComponent.componentModel is valid for the given configurationProvider |
dispose, getConfiguration, getConfigurationProvider, getCursorProviderFactory, getExtensionModel, getInputMetadata, getMetadata, getMetadata, getMetadataKeys, getMetadataKeys, getModels, getOutputMetadata, getSampleData, getStaticConfiguration, getValues, getValues, initialise, requiresConfig, runWithMetadataContext, setCacheIdGeneratorFactory, setComponentLocator, setMuleContext, start, stop, usesDynamicConfigurationgetAnnotation, getAnnotations, getDslSource, getIdentifier, getLocation, getRepresentation, getRootContainerLocation, initRootContainerName, setAnnotationspublic static final String PROCESSOR_PATH_MDC_KEY
protected final org.mule.runtime.api.meta.model.ExtensionModel extensionModel
protected final ResolverSet resolverSet
protected final String target
protected final String targetValue
protected final RetryPolicyTemplate retryPolicyTemplate
protected final MessageProcessorChain nestedChain
protected ExecutionMediator executionMediator
protected org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor componentExecutor
protected ReturnDelegate returnDelegate
protected PolicyManager policyManager
protected ClassLoader nestedChainClassLoader
public ComponentMessageProcessor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
T componentModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
String target,
String targetValue,
ResolverSet resolverSet,
CursorProviderFactory cursorProviderFactory,
RetryPolicyTemplate retryPolicyTemplate,
MessageProcessorChain nestedChain,
ClassLoader classLoader,
ExtensionManager extensionManager,
PolicyManager policyManager,
ReflectionCache reflectionCache,
DefaultExecutionMediator.ResultTransformer resultTransformer,
long terminationTimeout)
public CoreEvent process(CoreEvent event) throws org.mule.runtime.api.exception.MuleException
public org.reactivestreams.Publisher<CoreEvent> apply(org.reactivestreams.Publisher<CoreEvent> publisher)
public ReactiveProcessor.ProcessingType getProcessingType()
getProcessingType in interface ReactiveProcessorprotected void executeOperation(ExecutionContextAdapter<T> operationContext, org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor.ExecutorCallback callback)
protected void doInitialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
ExtensionComponentdoInitialise in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.lifecycle.InitialisationException - if a fatal error occurs causing the Mule instance to shutdownprotected SdkInternalContext.OperationExecutionParams getOperationExecutionParams(CoreEvent event)
protected RetryPolicyTemplateResolver getRetryPolicyTemplateResolver()
protected ReturnDelegate createReturnDelegate()
protected ReturnDelegate getTargetReturnDelegate()
protected ValueReturnDelegate getValueReturnDelegate()
protected boolean isTargetPresent()
protected boolean isBlocking()
protected boolean mayCompleteInDifferentThread()
protected boolean isAsyncExecutableBasedOn(Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> staticConfig)
protected void startIfNeededNestedChain()
throws org.mule.runtime.api.exception.MuleException
nestedChain is not null, it changes the current ClassLoader for the Application's ClassLoader
nestedChainClassLoader to start the processors, and then it goes back to the previous ClassLoader.org.mule.runtime.api.exception.MuleException - if the LifecycleUtils.startIfNeeded(java.lang.Object) fails.public void doStart()
throws org.mule.runtime.api.exception.MuleException
ExtensionComponentdoStart in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.exception.MuleException - if the component could not startpublic void doStop()
throws org.mule.runtime.api.exception.MuleException
ExtensionComponentdoStop in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.exception.MuleException - if the component could not stoppublic void doDispose()
ExtensionComponentdoDispose in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>protected ExecutionMediator createExecutionMediator()
protected InterceptorChain createInterceptorChain()
protected abstract void validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
ExtensionComponent.componentModel is valid for the given configurationProvidervalidateOperationConfiguration in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>IllegalOperationException - If the validation failsprotected ParameterValueResolver getParameterValueResolver()
getParameterValueResolver in class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel>public ReactiveProcessor.ProcessingType getInnerProcessingType()
startInnerFlux().public void resolveParameters(CoreEvent.Builder eventBuilder, BiConsumer<Map<String,Supplier<Object>>,org.mule.runtime.extension.api.runtime.operation.ExecutionContext> afterConfigurer) throws org.mule.runtime.api.exception.MuleException
resolveParameters in interface ParametersResolverProcessor<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.exception.MuleExceptionpublic void disposeResolvedParameters(org.mule.runtime.extension.api.runtime.operation.ExecutionContext<T> executionContext)
disposeResolvedParameters in interface ParametersResolverProcessor<T extends org.mule.runtime.api.meta.model.ComponentModel>Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.