public class OperationMessageProcessor extends ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel> implements Processor, ParametersResolverProcessor, org.mule.runtime.api.metadata.EntityMetadataProvider, org.mule.runtime.api.lifecycle.Lifecycle
Processor capable of executing extension operations.
It obtains a configuration instance, evaluate all the operation parameters and executes a OperationModel by using a
operationExecutor. This message processor is capable of serving the execution of any OperationModel of any
ExtensionModel.
A operationExecutor is obtained by testing the OperationModel for a OperationExecutorModelProperty
through which a OperationExecutorFactory is obtained. Models with no such property cannot be used with this class. The
obtained OperationExecutor serve all invocations of process(InternalEvent) on this instance but will
not be shared with other instances of OperationMessageProcessor. All the Lifecycle events that this
instance receives will be propagated to the operationExecutor.
The operationExecutor 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.api.meta.model.ExtensionModel |
extensionModel |
protected org.mule.runtime.api.meta.model.operation.OperationModel |
operationModel |
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate |
returnDelegate |
classLoader, componentModel, connectionManager, extensionManager, muleContext, streamingManager, transactionFactoryLocator| Constructor and Description |
|---|
OperationMessageProcessor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.operation.OperationModel operationModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
String target,
String targetValue,
ResolverSet resolverSet,
CursorProviderFactory cursorProviderFactory,
RetryPolicyTemplate retryPolicyTemplate,
ExtensionManager extensionManager,
PolicyManager policyManager) |
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<InternalEvent> |
apply(org.reactivestreams.Publisher<InternalEvent> publisher) |
protected ExecutionMediator |
createExecutionMediator() |
void |
disposeResolvedParameters(org.mule.runtime.extension.api.runtime.operation.ExecutionContext<org.mule.runtime.api.meta.model.operation.OperationModel> 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<InternalEvent> |
doProcess(InternalEvent event,
ExecutionContextAdapter<org.mule.runtime.api.meta.model.operation.OperationModel> 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
|
org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.MetadataKeysContainer> |
getEntityKeys() |
org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.TypeMetadataDescriptor> |
getEntityMetadata(org.mule.runtime.api.metadata.MetadataKey key) |
protected ParameterValueResolver |
getParameterValueResolver() |
ReactiveProcessor.ProcessingType |
getProcessingType() |
protected Optional<String> |
getTarget() |
InternalEvent |
process(InternalEvent event) |
void |
resolveParameters(InternalEvent.Builder eventBuilder,
BiConsumer<Map<String,Object>,org.mule.runtime.extension.api.runtime.operation.ExecutionContext> afterConfigurer) |
protected void |
validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
Validates that the
operationModel is valid for the given configurationProvider |
dispose, getConfiguration, getCursorProviderFactory, getExtensionModel, getMetadata, getMetadata, getMetadataKeys, getModels, getValues, initialise, runWithMetadataContext, setMuleContext, start, stopgetAnnotation, getAnnotations, getLocation, getRootContainerName, setAnnotationsprotected final org.mule.runtime.api.meta.model.ExtensionModel extensionModel
protected final org.mule.runtime.api.meta.model.operation.OperationModel operationModel
protected org.mule.runtime.module.extension.internal.runtime.operation.ReturnDelegate returnDelegate
public OperationMessageProcessor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.operation.OperationModel operationModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
String target,
String targetValue,
ResolverSet resolverSet,
CursorProviderFactory cursorProviderFactory,
RetryPolicyTemplate retryPolicyTemplate,
ExtensionManager extensionManager,
PolicyManager policyManager)
public InternalEvent process(InternalEvent event) throws org.mule.runtime.api.exception.MuleException
public org.reactivestreams.Publisher<InternalEvent> apply(org.reactivestreams.Publisher<InternalEvent> publisher)
apply in interface Function<org.reactivestreams.Publisher<InternalEvent>,org.reactivestreams.Publisher<InternalEvent>>apply in interface Processorprotected reactor.core.publisher.Mono<InternalEvent> doProcess(InternalEvent event, ExecutionContextAdapter<org.mule.runtime.api.meta.model.operation.OperationModel> operationContext)
protected void doInitialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
ExtensionComponentdoInitialise in class ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel>org.mule.runtime.api.lifecycle.InitialisationException - if a fatal error occurs causing the Mule instance to shutdownpublic void doStart()
throws org.mule.runtime.api.exception.MuleException
ExtensionComponentdoStart in class ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel>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<org.mule.runtime.api.meta.model.operation.OperationModel>org.mule.runtime.api.exception.MuleException - if the component could not stoppublic void doDispose()
ExtensionComponentdoDispose in class ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel>public org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.MetadataKeysContainer> getEntityKeys()
throws org.mule.runtime.api.metadata.MetadataResolvingException
getEntityKeys in interface org.mule.runtime.api.metadata.EntityMetadataProviderorg.mule.runtime.api.metadata.MetadataResolvingExceptionpublic org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.TypeMetadataDescriptor> getEntityMetadata(org.mule.runtime.api.metadata.MetadataKey key)
throws org.mule.runtime.api.metadata.MetadataResolvingException
getEntityMetadata in interface org.mule.runtime.api.metadata.EntityMetadataProviderorg.mule.runtime.api.metadata.MetadataResolvingExceptionprotected ExecutionMediator createExecutionMediator()
protected void validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
operationModel is valid for the given configurationProvidervalidateOperationConfiguration in class ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel>IllegalOperationException - If the validation failsprotected ParameterValueResolver getParameterValueResolver()
getParameterValueResolver in class ExtensionComponent<org.mule.runtime.api.meta.model.operation.OperationModel>public ReactiveProcessor.ProcessingType getProcessingType()
getProcessingType in interface ReactiveProcessorpublic void resolveParameters(InternalEvent.Builder eventBuilder, BiConsumer<Map<String,Object>,org.mule.runtime.extension.api.runtime.operation.ExecutionContext> afterConfigurer) throws org.mule.runtime.api.exception.MuleException
resolveParameters in interface ParametersResolverProcessororg.mule.runtime.api.exception.MuleExceptionpublic void disposeResolvedParameters(org.mule.runtime.extension.api.runtime.operation.ExecutionContext<org.mule.runtime.api.meta.model.operation.OperationModel> executionContext)
disposeResolvedParameters in interface ParametersResolverProcessorCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.