@Metadata(label="configuration") public class PolicyDefinition extends OutputDefinition<PolicyDefinition>
| Modifier and Type | Field and Description |
|---|---|
protected String |
ref |
protected Class<? extends Policy> |
type |
outputsinheritErrorHandler, log| Constructor and Description |
|---|
PolicyDefinition() |
PolicyDefinition(Policy policy) |
| 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.
|
protected String |
description() |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
String |
getRef() |
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images
|
boolean |
isAbstract()
Whether this model is abstract or not.
|
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. |
PolicyDefinition |
ref(String ref)
Sets a reference to use for lookup the policy in the registry.
|
protected Policy |
resolvePolicy(RouteContext routeContext) |
void |
setRef(String ref) |
void |
setType(Class<? extends Policy> type)
Sets a policy type that this definition should scope within.
|
String |
toString() |
getOutputs, isOutputSupported, setOutputsaddInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createOutputsProcessorImpl, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrichRef, enrichRef, enrichRef, filter, filter, filter, filter, getIndex, getInterceptStrategies, getOtherAttributes, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isInheritErrorHandler, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, 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, pollEnrichRef, pollEnrichRef, preCreateProcessor, process, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routeDescription, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, script, script, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, startupOrder, stop, threads, threads, threads, threads, 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, wrapInErrorHandler, wrapProcessordescription, description, getCustomId, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setIdpublic PolicyDefinition()
public PolicyDefinition(Policy policy)
public String toString()
toString in class OutputDefinition<PolicyDefinition>protected String description()
public String getShortName()
OptionalIdentifiedDefinitiongetShortName in interface NamedNodegetShortName in class OptionalIdentifiedDefinition<PolicyDefinition>public String getLabel()
ProcessorDefinitiongetLabel in interface NamedNodegetLabel in class ProcessorDefinition<PolicyDefinition>public boolean isAbstract()
ProcessorDefinitionisAbstract in class ProcessorDefinition<PolicyDefinition>public boolean isTopLevelOnly()
ProcessorDefinitionProcessorDefinition.addOutput(ProcessorDefinition)
method.isTopLevelOnly in class ProcessorDefinition<PolicyDefinition>public void setType(Class<? extends Policy> type)
TransactedPolicy
can be set as type for easy transaction configuration.
Will by default scope to the wide Policytype - the policy typepublic PolicyDefinition ref(String ref)
ref - the referencepublic Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinitioncreateProcessor in class ProcessorDefinition<PolicyDefinition>Exceptionprotected Policy resolvePolicy(RouteContext routeContext)
Apache Camel