Package org.apache.camel.processor
Class CamelInternalProcessor
- 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
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.AsyncProcessor
,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
- Direct Known Subclasses:
DefaultChannel
public class CamelInternalProcessor extends org.apache.camel.support.processor.DelegateAsyncProcessor
InternalProcessor
that Camel routing engine used during routing for cross cutting functionality such as:- Execute
UnitOfWork
- Keeping track which route currently is being routed
- Execute
RoutePolicy
- Gather JMX performance statics
- Tracing
- Debugging
- Message History
- Stream Caching
Transformer
CamelInternalProcessorAdvice
advice (before and after advice) by executing theCamelInternalProcessorAdvice.before(org.apache.camel.Exchange)
andCamelInternalProcessorAdvice.after(org.apache.camel.Exchange, Object)
callbacks in correct order during routing. This reduces number of stack frames needed during routing, and reduce the number of lines in stacktraces, as well makes debugging the routing engine easier for end users. Debugging tips: Camel end users whom want to debug their Camel applications with the Camel source code, then make sure to read the source code of this class about the debugging tips, which you can find in theprocess(org.apache.camel.Exchange, org.apache.camel.AsyncCallback)
method. The added advices can implementOrdered
to control in which order the advices are executed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CamelInternalProcessor.BacklogDebuggerAdvice
Advice to execute theBacklogDebugger
if enabled.static class
CamelInternalProcessor.BacklogTracerAdvice
Advice to execute theBacklogTracer
if enabled.static class
CamelInternalProcessor.ChildUnitOfWorkProcessorAdvice
Advice when an EIP uses the shareUnitOfWork functionality.static class
CamelInternalProcessor.DebuggerAdvice
Advice to execute when using custom debugger.static class
CamelInternalProcessor.DelayerAdvice
Advice for delayingstatic class
CamelInternalProcessor.MessageHistoryAdvice
Advice when Message History has been enabled.static class
CamelInternalProcessor.NodeHistoryAdvice
Advice that stores the node id and label of the processor that is processing the exchange.static class
CamelInternalProcessor.RouteInflightRepositoryAdvice
Advice to keep theInflightRepository
up to date.static class
CamelInternalProcessor.RouteLifecycleAdvice
Advice to invoke callbacks for before and after routing.static class
CamelInternalProcessor.RoutePolicyAdvice
Advice to execute anyRoutePolicy
a route may have been configured with.static class
CamelInternalProcessor.StreamCachingAdvice
Advice forStreamCachingStrategy
static class
CamelInternalProcessor.TracingAdvice
Advice for tracingstatic class
CamelInternalProcessor.UnitOfWorkProcessorAdvice
Advice to inject newUnitOfWork
to theExchange
if needed, and as well to ensure theUnitOfWork
is done and stopped.
-
Constructor Summary
Constructors Constructor Description CamelInternalProcessor(org.apache.camel.CamelContext camelContext)
CamelInternalProcessor(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdvice(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)
Adds anCamelInternalProcessorAdvice
advice to the list of advices to execute by this internal processor.<T> T
getAdvice(Class<T> type)
Gets the advice with the given type.boolean
process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback)
String
toString()
static Object
unwrap(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)
static <T> org.apache.camel.spi.CamelInternalProcessorAdvice<T>
wrap(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor<T> instrumentationProcessor)
Wrap an InstrumentationProcessor into a CamelInternalProcessorAdvice-
Methods inherited from class org.apache.camel.support.processor.DelegateAsyncProcessor
doShutdown, doStart, doStop, getProcessor, hasNext, next, 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
-
addAdvice
public void addAdvice(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)
Adds anCamelInternalProcessorAdvice
advice to the list of advices to execute by this internal processor.- Parameters:
advice
- the advice to add
-
getAdvice
public <T> T getAdvice(Class<T> type)
Gets the advice with the given type.- Parameters:
type
- the type of the advice- Returns:
- the advice if exists, or null if no advices has been added with the given type.
-
process
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback)
- Specified by:
process
in interfaceorg.apache.camel.AsyncProcessor
- Overrides:
process
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
-
toString
public String toString()
- Overrides:
toString
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
-
wrap
public static <T> org.apache.camel.spi.CamelInternalProcessorAdvice<T> wrap(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor<T> instrumentationProcessor)
Wrap an InstrumentationProcessor into a CamelInternalProcessorAdvice
-
unwrap
public static Object unwrap(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)
-
-