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 ComponentExecutorModelProperty through which a
ComponentExecutorFactory is obtained. Models with no such property cannot be used with this class. The obtained
ComponentExecutor 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.ComponentExecutor |
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, componentModel, connectionManager, cursorProviderFactory, 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) |
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<CoreEvent> |
apply(org.reactivestreams.Publisher<CoreEvent> publisher) |
protected ExecutionMediator |
createExecutionMediator() |
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
|
protected reactor.core.publisher.Mono<CoreEvent> |
doProcess(CoreEvent event,
ExecutionContextAdapter<T> operationContext) |
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 ParameterValueResolver |
getParameterValueResolver() |
abstract ReactiveProcessor.ProcessingType |
getProcessingType() |
protected Optional<String> |
getTarget() |
protected org.mule.runtime.module.extension.internal.runtime.operation.TargetReturnDelegate |
getTargetReturnDelegate() |
protected org.mule.runtime.module.extension.internal.runtime.operation.ValueReturnDelegate |
getValueReturnDelegate() |
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) |
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, getCursorProviderFactory, getExtensionModel, getMetadata, getMetadata, getMetadataKeys, getModels, getStaticConfiguration, getValues, initialise, runWithMetadataContext, setCacheIdGeneratorFactory, setMuleContext, setStreamingManager, start, stopgetAnnotation, getAnnotations, getLocation, getRootContainerLocation, setAnnotationsprotected 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.ComponentExecutor componentExecutor
protected PolicyManager policyManager
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate returnDelegate
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)
public CoreEvent process(CoreEvent event) throws org.mule.runtime.api.exception.MuleException
public org.reactivestreams.Publisher<CoreEvent> apply(org.reactivestreams.Publisher<CoreEvent> publisher)
protected reactor.core.publisher.Mono<CoreEvent> doProcess(CoreEvent event, ExecutionContextAdapter<T> operationContext)
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.TargetReturnDelegate getTargetReturnDelegate()
protected org.mule.runtime.module.extension.internal.runtime.operation.ValueReturnDelegate getValueReturnDelegate()
protected boolean isTargetPresent()
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 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 abstract ReactiveProcessor.ProcessingType getProcessingType()
getProcessingType in interface ReactiveProcessorpublic 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.