@Metadata(label="configuration") public class PolicyDefinition extends OutputDefinition<PolicyDefinition>
Modifier and Type | Field and Description |
---|---|
protected String |
ref |
protected Class<? extends Policy> |
type |
outputs
inheritErrorHandler, 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, setOutputs
addInterceptStrategies, 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, 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, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessor
description, description, getCustomId, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setId
public PolicyDefinition()
public PolicyDefinition(Policy policy)
public String toString()
toString
in class OutputDefinition<PolicyDefinition>
protected String description()
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class OptionalIdentifiedDefinition<PolicyDefinition>
public String getLabel()
ProcessorDefinition
getLabel
in interface NamedNode
getLabel
in class ProcessorDefinition<PolicyDefinition>
public boolean isAbstract()
ProcessorDefinition
isAbstract
in class ProcessorDefinition<PolicyDefinition>
public boolean isTopLevelOnly()
ProcessorDefinition
ProcessorDefinition.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 Policy
type
- the policy typepublic PolicyDefinition ref(String ref)
ref
- the referencepublic Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<PolicyDefinition>
Exception
protected Policy resolvePolicy(RouteContext routeContext)
Apache Camel