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 PolicyManager |
policyManager |
protected ResolverSet |
resolverSet |
protected RetryPolicyTemplate |
retryPolicyTemplate |
protected org.mule.runtime.module.extension.internal.runtime.operation.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,
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 org.mule.runtime.module.extension.internal.runtime.operation.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 ParameterValueResolver |
getParameterValueResolver() |
ReactiveProcessor.ProcessingType |
getProcessingType() |
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate |
getTargetReturnDelegate() |
protected org.mule.runtime.module.extension.internal.runtime.operation.ValueReturnDelegate |
getValueReturnDelegate() |
protected boolean |
isAsync() |
protected boolean |
isTargetPresent() |
CoreEvent |
process(CoreEvent event) |
void |
resolveParameters(CoreEvent.Builder eventBuilder,
BiConsumer<Map<String,Supplier<Object>>,org.mule.runtime.extension.api.runtime.operation.ExecutionContext> afterConfigurer) |
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, getErrorMappings, getExtensionModel, getMetadata, getMetadata, getMetadataKeys, getModels, getStaticConfiguration, getValues, initialise, requiresConfig, runWithMetadataContext, setAnnotations, setCacheIdGeneratorFactory, setComponentLocator, setMuleContext, start, stop, usesDynamicConfigurationgetAnnotation, getAnnotations, getDslSource, getIdentifier, getLocation, getRepresentation, getRootContainerLocation, initRootContainerNameprotected 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 ExecutionMediator executionMediator
protected org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor componentExecutor
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate returnDelegate
protected PolicyManager policyManager
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,
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 org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate createReturnDelegate()
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate getTargetReturnDelegate()
protected org.mule.runtime.module.extension.internal.runtime.operation.ValueReturnDelegate getValueReturnDelegate()
protected boolean isTargetPresent()
protected boolean isAsync()
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–2020 MuleSoft, Inc.. All rights reserved.