Class DefaultChannel

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.AsyncProcessor, org.apache.camel.Channel, org.apache.camel.DelegateProcessor, org.apache.camel.Navigate<org.apache.camel.Processor>, org.apache.camel.Processor, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    public class DefaultChannel
    extends CamelInternalProcessor
    implements org.apache.camel.Channel
    DefaultChannel is the default Channel.

    The current implementation is just a composite containing the interceptors and error handler that beforehand was added to the route graph directly.
    With this Channel we can in the future implement better strategies for routing the Exchange in the route graph, as we have a Channel between each and every node in the graph.

    • Constructor Detail

      • DefaultChannel

        public DefaultChannel​(org.apache.camel.CamelContext camelContext)
    • Method Detail

      • getOutput

        public org.apache.camel.Processor getOutput()
        Specified by:
        getOutput in interface org.apache.camel.Channel
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface org.apache.camel.Navigate<org.apache.camel.Processor>
        Overrides:
        hasNext in class org.apache.camel.support.processor.DelegateAsyncProcessor
      • next

        public List<org.apache.camel.Processor> next()
        Specified by:
        next in interface org.apache.camel.Navigate<org.apache.camel.Processor>
        Overrides:
        next in class org.apache.camel.support.processor.DelegateAsyncProcessor
      • setOutput

        public void setOutput​(org.apache.camel.Processor output)
      • getNextProcessor

        public org.apache.camel.Processor getNextProcessor()
        Specified by:
        getNextProcessor in interface org.apache.camel.Channel
      • setErrorHandler

        public void setErrorHandler​(org.apache.camel.Processor errorHandler)
        Sets the ErrorHandler this Channel uses.
        Parameters:
        errorHandler - the error handler
      • getErrorHandler

        public org.apache.camel.Processor getErrorHandler()
        Specified by:
        getErrorHandler in interface org.apache.camel.Channel
      • getProcessorDefinition

        public org.apache.camel.NamedNode getProcessorDefinition()
        Specified by:
        getProcessorDefinition in interface org.apache.camel.Channel
      • clearModelReferences

        public void clearModelReferences()
      • getRoute

        public org.apache.camel.Route getRoute()
        Specified by:
        getRoute in interface org.apache.camel.Channel
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.support.processor.DelegateAsyncProcessor
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.processor.DelegateAsyncProcessor
        Throws:
        Exception
      • doShutdown

        protected void doShutdown()
                           throws Exception
        Overrides:
        doShutdown in class org.apache.camel.support.processor.DelegateAsyncProcessor
        Throws:
        Exception
      • initChannel

        public void initChannel​(org.apache.camel.Route route,
                                org.apache.camel.NamedNode definition,
                                org.apache.camel.NamedNode childDefinition,
                                List<org.apache.camel.spi.InterceptStrategy> interceptors,
                                org.apache.camel.Processor nextProcessor,
                                org.apache.camel.NamedRoute routeDefinition,
                                boolean first)
                         throws Exception
        Initializes the channel. If the initialized output definition contained outputs (children) then the childDefinition will be set so we can leverage fine grained tracing
        Parameters:
        route - the route context
        definition - the route definition the Channel represents
        childDefinition - the child definition
        Throws:
        Exception - is thrown if some error occurred
      • postInitChannel

        public void postInitChannel()
                             throws Exception
        Post initializes the channel.
        Throws:
        Exception - is thrown if some error occurred