Class TransactedDefinition

  • All Implemented Interfaces:
    org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, Block, OutputNode, org.apache.camel.NamedNode, org.apache.camel.spi.HasId, org.apache.camel.spi.IdAware

    @Metadata(label="configuration")
    public class TransactedDefinition
    extends OutputDefinition<TransactedDefinition>
    Enables transaction on the route
    • Constructor Detail

      • TransactedDefinition

        public TransactedDefinition()
      • TransactedDefinition

        public TransactedDefinition​(org.apache.camel.spi.Policy policy)
    • Method Detail

      • description

        protected String description()
      • isAbstract

        public boolean isAbstract()
        Description copied from class: ProcessorDefinition
        Whether this model is abstract or not.

        An abstract model is something that is used for configuring cross cutting concerns such as error handling, transaction policies, interceptors etc.

        Regular definitions is what is part of the route, such as ToDefinition, WireTapDefinition and the likes.

        Will by default return false to indicate regular definition, so all the abstract definitions must override this method and return true instead.

        This information is used in camel-spring to let Camel work a bit on the model provided by JAXB from the Spring XML file. This is needed to handle those cross cutting concerns properly. The Java DSL does not have this issue as it can work this out directly using the fluent builder methods.

        Overrides:
        isAbstract in class ProcessorDefinition<TransactedDefinition>
        Returns:
        true for abstract, otherwise false for regular.
      • isWrappingEntireOutput

        public boolean isWrappingEntireOutput()
        Description copied from class: ProcessorDefinition
        Whether this definition is wrapping the entire output.

        When a definition is wrapping the entire output, the check to ensure that a route definition is empty should be done on the wrapped output.

        Overrides:
        isWrappingEntireOutput in class ProcessorDefinition<TransactedDefinition>
        Returns:
        true when wrapping the entire output.
      • getPolicy

        public org.apache.camel.spi.Policy getPolicy()
      • getRef

        public String getRef()
      • setRef

        public void setRef​(String ref)
      • getType

        public Class<? extends org.apache.camel.spi.Policy> getType()
      • setType

        public void setType​(Class<? extends org.apache.camel.spi.Policy> type)
        Sets a policy type that this definition should scope within.

        Is used for convention over configuration situations where the policy should be automatic looked up in the registry and it should be based on this type. For instance a TransactedPolicy can be set as type for easy transaction configuration.

        Will by default scope to the wide Policy

        Parameters:
        type - the policy type
      • ref

        public TransactedDefinition ref​(String ref)
        Sets a reference to use for lookup the policy in the registry.
        Parameters:
        ref - the reference
        Returns:
        the builder