Class DefaultChannel
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.AsyncProcessorSupport
-
- org.apache.camel.support.processor.DelegateAsyncProcessor
-
- org.apache.camel.processor.CamelInternalProcessor
-
- org.apache.camel.processor.channel.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 defaultChannel
. The current implementation is just a composite containing the interceptors and error handler that beforehand was added to the route graph directly.
With thisChannel
we can in the future implement better strategies for routing theExchange
in the route graph, as we have aChannel
between each and every node in the graph.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.camel.processor.CamelInternalProcessor
CamelInternalProcessor.BacklogDebuggerAdvice, CamelInternalProcessor.BacklogTracerAdvice, CamelInternalProcessor.ChildUnitOfWorkProcessorAdvice, CamelInternalProcessor.DebuggerAdvice, CamelInternalProcessor.DelayerAdvice, CamelInternalProcessor.MessageHistoryAdvice, CamelInternalProcessor.NodeHistoryAdvice, CamelInternalProcessor.RouteInflightRepositoryAdvice, CamelInternalProcessor.RouteLifecycleAdvice, CamelInternalProcessor.RoutePolicyAdvice, CamelInternalProcessor.StreamCachingAdvice, CamelInternalProcessor.TracingAdvice, CamelInternalProcessor.UnitOfWorkProcessorAdvice
-
-
Constructor Summary
Constructors Constructor Description DefaultChannel(org.apache.camel.CamelContext camelContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearModelReferences()
protected void
doShutdown()
protected void
doStart()
protected void
doStop()
org.apache.camel.Processor
getErrorHandler()
org.apache.camel.Processor
getNextProcessor()
org.apache.camel.Processor
getOutput()
org.apache.camel.NamedNode
getProcessorDefinition()
org.apache.camel.Route
getRoute()
boolean
hasNext()
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)
Initializes the channel.List<org.apache.camel.Processor>
next()
void
postInitChannel()
Post initializes the channel.void
setErrorHandler(org.apache.camel.Processor errorHandler)
Sets theErrorHandler
this Channel uses.void
setOutput(org.apache.camel.Processor output)
String
toString()
-
Methods inherited from class org.apache.camel.processor.CamelInternalProcessor
addAdvice, getAdvice, process, unwrap, wrap
-
Methods inherited from class org.apache.camel.support.processor.DelegateAsyncProcessor
getProcessor, setProcessor, setProcessor
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getOutput
public org.apache.camel.Processor getOutput()
- Specified by:
getOutput
in interfaceorg.apache.camel.Channel
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceorg.apache.camel.Navigate<org.apache.camel.Processor>
- Overrides:
hasNext
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
-
next
public List<org.apache.camel.Processor> next()
- Specified by:
next
in interfaceorg.apache.camel.Navigate<org.apache.camel.Processor>
- Overrides:
next
in classorg.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 interfaceorg.apache.camel.Channel
-
setErrorHandler
public void setErrorHandler(org.apache.camel.Processor errorHandler)
Sets theErrorHandler
this Channel uses.- Parameters:
errorHandler
- the error handler
-
getErrorHandler
public org.apache.camel.Processor getErrorHandler()
- Specified by:
getErrorHandler
in interfaceorg.apache.camel.Channel
-
getProcessorDefinition
public org.apache.camel.NamedNode getProcessorDefinition()
- Specified by:
getProcessorDefinition
in interfaceorg.apache.camel.Channel
-
clearModelReferences
public void clearModelReferences()
-
getRoute
public org.apache.camel.Route getRoute()
- Specified by:
getRoute
in interfaceorg.apache.camel.Channel
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
- Throws:
Exception
-
doShutdown
protected void doShutdown() throws Exception
- Overrides:
doShutdown
in classorg.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 contextdefinition
- the route definition theChannel
representschildDefinition
- 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
-
toString
public String toString()
- Overrides:
toString
in classCamelInternalProcessor
-
-