@Metadata(label="configuration") public class OnCompletionDefinition extends ProcessorDefinition<OnCompletionDefinition> implements ExecutorServiceAwareDefinition<OnCompletionDefinition>
inheritErrorHandler, log
Constructor and Description |
---|
OnCompletionDefinition() |
Modifier and Type | Method and Description |
---|---|
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor
based on the definition model.
|
ProcessorDefinition<?> |
end()
Ends the current block
|
OnCompletionDefinition |
executorService(ExecutorService executorService)
To use a custom Thread Pool to be used for parallel processing.
|
OnCompletionDefinition |
executorServiceRef(String executorServiceRef)
Refers to a custom Thread Pool to be used for parallel processing.
|
ExecutorService |
getExecutorService()
Gets the executor service
|
String |
getExecutorServiceRef()
Gets the reference to lookup in the
Registry for the executor service to be used. |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
OnCompletionMode |
getMode() |
Boolean |
getOnCompleteOnly() |
Processor |
getOnCompletion(String routeId) |
Collection<Processor> |
getOnCompletions() |
Boolean |
getOnFailureOnly() |
WhenDefinition |
getOnWhen() |
List<ProcessorDefinition<?>> |
getOutputs() |
Boolean |
getParallelProcessing() |
Boolean |
getUseOriginalMessagePolicy() |
boolean |
isAbstract()
Whether this model is abstract or not.
|
boolean |
isOutputSupported() |
boolean |
isRouteScoped() |
boolean |
isTopLevelOnly()
Whether this definition can only be added as top-level directly on the route itself (such as onException,onCompletion,intercept, etc.)
If trying to add a top-level only definition to a nested output would fail in the
ProcessorDefinition.addOutput(ProcessorDefinition)
method. |
OnCompletionDefinition |
modeAfterConsumer()
Sets the mode to be after route is done (default due backwards compatible).
|
OnCompletionDefinition |
modeBeforeConsumer()
Sets the mode to be before consumer is done.
|
OnCompletionDefinition |
onCompleteOnly()
Will only synchronize when the
Exchange completed successfully (no errors). |
OnCompletionDefinition |
onFailureOnly()
Will only synchronize when the
Exchange ended with failure (exception or FAULT message). |
OnCompletionDefinition |
onWhen(Predicate predicate)
Sets an additional predicate that should be true before the onCompletion is triggered.
|
OnCompletionDefinition |
parallelProcessing()
If enabled then the on completion process will run asynchronously by a separate thread from a thread pool.
|
OnCompletionDefinition |
parallelProcessing(boolean parallelProcessing)
If enabled then the on completion process will run asynchronously by a separate thread from a thread pool.
|
void |
removeAllOnCompletionDefinition(ProcessorDefinition<?> definition)
Removes all existing
OnCompletionDefinition from the definition. |
void |
setExecutorService(ExecutorService executorService)
Sets the executor service to be used.
|
void |
setExecutorServiceRef(String executorServiceRef)
Sets a reference to lookup in the
Registry for the executor service to be used. |
void |
setMode(OnCompletionMode mode)
Sets the on completion mode.
|
void |
setOnCompleteOnly(Boolean onCompleteOnly) |
void |
setOnFailureOnly(Boolean onFailureOnly) |
void |
setOnWhen(WhenDefinition onWhen) |
void |
setOutputs(List<ProcessorDefinition<?>> outputs) |
void |
setParallelProcessing(Boolean parallelProcessing) |
void |
setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
Will use the original input body when an
Exchange for this on completion. |
String |
toString() |
OnCompletionDefinition |
useOriginalBody()
Will use the original input body when an
Exchange for this on completion. |
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, beanRef, choice, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createOutputsProcessorImpl, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, endChoice, endDoTry, endHystrix, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrichRef, enrichRef, enrichRef, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getIndex, getInterceptStrategies, getOtherAttributes, getParent, hystrix, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isInheritErrorHandler, isWrappingEntireOutput, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, pollEnrichRef, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setHeader, setInheritErrorHandler, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, startupOrder, stop, threads, threads, threads, threads, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapChannel, wrapInErrorHandler, wrapProcessor
description, description, getCustomId, getDescription, getDescriptionText, getId, getShortName, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setId
public OnCompletionDefinition()
public boolean isRouteScoped()
public Processor getOnCompletion(String routeId)
public Collection<Processor> getOnCompletions()
public String getLabel()
ProcessorDefinition
getLabel
in interface NamedNode
getLabel
in class ProcessorDefinition<OnCompletionDefinition>
public boolean isAbstract()
ProcessorDefinition
isAbstract
in class ProcessorDefinition<OnCompletionDefinition>
public boolean isTopLevelOnly()
ProcessorDefinition
ProcessorDefinition.addOutput(ProcessorDefinition)
method.isTopLevelOnly
in class ProcessorDefinition<OnCompletionDefinition>
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<OnCompletionDefinition>
Exception
public void removeAllOnCompletionDefinition(ProcessorDefinition<?> definition)
OnCompletionDefinition
from the definition.
This is used to let route scoped onCompletion overrule any global onCompletion.
Hence we remove all existing as they are global.definition
- the parent definition that is the routepublic ProcessorDefinition<?> end()
ProcessorDefinition
end
in class ProcessorDefinition<OnCompletionDefinition>
public OnCompletionDefinition modeAfterConsumer()
public OnCompletionDefinition modeBeforeConsumer()
public OnCompletionDefinition onCompleteOnly()
Exchange
completed successfully (no errors).public OnCompletionDefinition onFailureOnly()
Exchange
ended with failure (exception or FAULT message).public OnCompletionDefinition onWhen(@AsPredicate Predicate predicate)
predicate
- predicate that determines true or falsepublic OnCompletionDefinition useOriginalBody()
Exchange
for this on completion.
By default this feature is off.public OnCompletionDefinition executorService(ExecutorService executorService)
executorService
in interface ExecutorServiceAwareDefinition<OnCompletionDefinition>
executorService
- the executor servicepublic OnCompletionDefinition executorServiceRef(String executorServiceRef)
executorServiceRef
in interface ExecutorServiceAwareDefinition<OnCompletionDefinition>
executorServiceRef
- reference for a ExecutorService
to lookup in the Registry
public OnCompletionDefinition parallelProcessing()
public OnCompletionDefinition parallelProcessing(boolean parallelProcessing)
public List<ProcessorDefinition<?>> getOutputs()
getOutputs
in class ProcessorDefinition<OnCompletionDefinition>
public void setOutputs(List<ProcessorDefinition<?>> outputs)
public boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<OnCompletionDefinition>
public OnCompletionMode getMode()
public void setMode(OnCompletionMode mode)
public Boolean getOnCompleteOnly()
public void setOnCompleteOnly(Boolean onCompleteOnly)
public Boolean getOnFailureOnly()
public void setOnFailureOnly(Boolean onFailureOnly)
public WhenDefinition getOnWhen()
public void setOnWhen(WhenDefinition onWhen)
public ExecutorService getExecutorService()
ExecutorServiceAware
getExecutorService
in interface ExecutorServiceAware
public void setExecutorService(ExecutorService executorService)
ExecutorServiceAware
setExecutorService
in interface ExecutorServiceAware
executorService
- the executorpublic String getExecutorServiceRef()
ExecutorServiceAware
Registry
for the executor service to be used.getExecutorServiceRef
in interface ExecutorServiceAware
public void setExecutorServiceRef(String executorServiceRef)
ExecutorServiceAware
Registry
for the executor service to be used.setExecutorServiceRef
in interface ExecutorServiceAware
executorServiceRef
- reference for the executorpublic Boolean getUseOriginalMessagePolicy()
public void setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
Exchange
for this on completion.
By default this feature is off.public Boolean getParallelProcessing()
public void setParallelProcessing(Boolean parallelProcessing)
Apache Camel