Package org.apache.camel.impl.engine
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.impl.engine.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.spi.InternalProcessor
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
DefaultChannel
public class CamelInternalProcessor
extends org.apache.camel.support.processor.DelegateAsyncProcessor
implements org.apache.camel.spi.InternalProcessor
Internal
Processor
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 the CamelInternalProcessorAdvice.before(org.apache.camel.Exchange)
and
CamelInternalProcessorAdvice.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 the
process(org.apache.camel.Exchange, org.apache.camel.AsyncCallback)
method.
The added advices can implement Ordered
to control in which order the advices are executed.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Advice to execute theBacklogDebugger
if enabled.static final class
Advice to execute theBacklogTracer
if enabled.static class
Advice when an EIP uses the shareUnitOfWork functionality.static final class
Advice to execute when using custom debugger.static class
Advice for delayingstatic class
Advice when Message History has been enabled.static class
Advice that stores the node id and label of the processor that is processing the exchange.static class
Advice to keep theInflightRepository
up to date.static class
Advice to invoke callbacks for before and after routing.static class
Advice to execute anyRoutePolicy
a route may have been configured with.static class
Advice forStreamCachingStrategy
static class
Advice for tracingstatic class
Advice to inject newUnitOfWork
to theExchange
if needed, and as well to ensure theUnitOfWork
is done and stopped. -
Field Summary
Fields inherited from class org.apache.camel.support.processor.DelegateAsyncProcessor
processor
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
ConstructorDescriptionCamelInternalProcessor
(org.apache.camel.CamelContext camelContext) CamelInternalProcessor
(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdvice
(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice) void
addManagementInterceptStrategy
(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor processor) void
addRouteInflightRepositoryAdvice
(org.apache.camel.spi.InflightRepository inflightRepository, String routeId) void
void
addRoutePolicyAdvice
(List<org.apache.camel.spi.RoutePolicy> routePolicyList) protected void
doBuild()
protected void
<T> T
boolean
process
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback) void
setRouteOnAdvices
(org.apache.camel.Route route) 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 CamelInternalProcessorAdviceMethods inherited from class org.apache.camel.support.processor.DelegateAsyncProcessor
doInit, doStart, doStop, getProcessor, hasNext, next, setProcessor, setProcessor
Methods inherited from class org.apache.camel.support.AsyncProcessorSupport
process, processAsync
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, 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
Methods inherited from interface org.apache.camel.AsyncProcessor
processAsync
Methods inherited from interface org.apache.camel.Processor
process
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
CamelInternalProcessor
public CamelInternalProcessor(org.apache.camel.CamelContext camelContext) -
CamelInternalProcessor
public CamelInternalProcessor(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor)
-
-
Method Details
-
doBuild
- Overrides:
doBuild
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
- Throws:
Exception
-
doShutdown
- Overrides:
doShutdown
in classorg.apache.camel.support.processor.DelegateAsyncProcessor
- Throws:
Exception
-
addAdvice
public void addAdvice(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice) - Specified by:
addAdvice
in interfaceorg.apache.camel.spi.InternalProcessor
-
getAdvice
- Specified by:
getAdvice
in interfaceorg.apache.camel.spi.InternalProcessor
-
addRoutePolicyAdvice
- Specified by:
addRoutePolicyAdvice
in interfaceorg.apache.camel.spi.InternalProcessor
-
addRouteInflightRepositoryAdvice
public void addRouteInflightRepositoryAdvice(org.apache.camel.spi.InflightRepository inflightRepository, String routeId) - Specified by:
addRouteInflightRepositoryAdvice
in interfaceorg.apache.camel.spi.InternalProcessor
-
addRouteLifecycleAdvice
public void addRouteLifecycleAdvice()- Specified by:
addRouteLifecycleAdvice
in interfaceorg.apache.camel.spi.InternalProcessor
-
addManagementInterceptStrategy
public void addManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor processor) - Specified by:
addManagementInterceptStrategy
in interfaceorg.apache.camel.spi.InternalProcessor
-
setRouteOnAdvices
public void setRouteOnAdvices(org.apache.camel.Route route) - Specified by:
setRouteOnAdvices
in interfaceorg.apache.camel.spi.InternalProcessor
-
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
- 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
-