org.apache.camel
Interface Channel

All Superinterfaces:
AsyncProcessor, Navigate<Processor>, Processor
All Known Implementing Classes:
DefaultChannel

public interface Channel
extends AsyncProcessor, Navigate<Processor>

Channel acts as a channel between Processors in the route graph.

The channel is responsible for routing the Exchange to the next Processor in the route graph.

Version:

Method Summary
 void addInterceptStrategies(List<InterceptStrategy> strategy)
          Adds a list of InterceptStrategy to apply each Exchange before its routed to the next Processor.
 void addInterceptStrategy(InterceptStrategy strategy)
          Adds a InterceptStrategy to apply each Exchange before its routed to the next Processor.
 Processor getErrorHandler()
          Gets the ErrorHandler this Channel uses.
 List<InterceptStrategy> getInterceptStrategies()
          Gets the list of InterceptStrategy registered to this Channel.
 Processor getNextProcessor()
          Gets the next Processor to route to (not wrapped)
 Processor getOutput()
          Gets the wrapped output that at runtime should be delegated to.
 ProcessorDefinition<?> getProcessorDefinition()
          Gets the definition of the next processor
 RouteContext getRouteContext()
          Gets the RouteContext
 void initChannel(ProcessorDefinition<?> outputDefinition, RouteContext routeContext)
          Initializes the channel.
 void postInitChannel(ProcessorDefinition<?> outputDefinition, RouteContext routeContext)
          Post initializes the channel.
 void setChildDefinition(ProcessorDefinition<?> child)
          If the initialized output definition contained outputs (children) then we need to set the child so we can leverage fine grained tracing
 void setErrorHandler(Processor errorHandler)
          Sets the ErrorHandler this Channel uses.
 void setNextProcessor(Processor next)
          Sets the processor that the channel should route the Exchange to.
 void setOutput(Processor output)
          Sets the wrapped output that at runtime should be delegated to.
 
Methods inherited from interface org.apache.camel.AsyncProcessor
process
 
Methods inherited from interface org.apache.camel.Processor
process
 
Methods inherited from interface org.apache.camel.Navigate
hasNext, next
 

Method Detail

setNextProcessor

void setNextProcessor(Processor next)
Sets the processor that the channel should route the Exchange to.

Parameters:
next - the next processor

setErrorHandler

void setErrorHandler(Processor errorHandler)
Sets the ErrorHandler this Channel uses.

Parameters:
errorHandler - the error handler

getErrorHandler

Processor getErrorHandler()
Gets the ErrorHandler this Channel uses.

Returns:
the error handler, or null if no error handler is used.

addInterceptStrategy

void addInterceptStrategy(InterceptStrategy strategy)
Adds a InterceptStrategy to apply each Exchange before its routed to the next Processor.

Parameters:
strategy - the intercept strategy

addInterceptStrategies

void addInterceptStrategies(List<InterceptStrategy> strategy)
Adds a list of InterceptStrategy to apply each Exchange before its routed to the next Processor.

Parameters:
strategy - list of strategies

getInterceptStrategies

List<InterceptStrategy> getInterceptStrategies()
Gets the list of InterceptStrategy registered to this Channel.

Returns:
list of strategies, returns an empty list if no strategies is registered.

initChannel

void initChannel(ProcessorDefinition<?> outputDefinition,
                 RouteContext routeContext)
                 throws Exception
Initializes the channel.

Parameters:
outputDefinition - the route definition the Channel represents
routeContext - the route context
Throws:
Exception - is thrown if some error occurred

postInitChannel

void postInitChannel(ProcessorDefinition<?> outputDefinition,
                     RouteContext routeContext)
                     throws Exception
Post initializes the channel.

Parameters:
outputDefinition - the route definition the Channel represents
routeContext - the route context
Throws:
Exception - is thrown if some error occurred

setChildDefinition

void setChildDefinition(ProcessorDefinition<?> child)
If the initialized output definition contained outputs (children) then we need to set the child so we can leverage fine grained tracing

Parameters:
child - the child

getOutput

Processor getOutput()
Gets the wrapped output that at runtime should be delegated to.

Returns:
the output to route the Exchange to

setOutput

void setOutput(Processor output)
Sets the wrapped output that at runtime should be delegated to.

Parameters:
output - the output to route the Exchange to

getNextProcessor

Processor getNextProcessor()
Gets the next Processor to route to (not wrapped)

Returns:
the next processor

getProcessorDefinition

ProcessorDefinition<?> getProcessorDefinition()
Gets the definition of the next processor

Returns:
the processor definition

getRouteContext

RouteContext getRouteContext()
Gets the RouteContext

Returns:
the route context


Apache CAMEL