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.InternalProcessorInternalProcessorthat 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
CamelInternalProcessorAdviceadvice (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 implementOrderedto control in which order the advices are executed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCamelInternalProcessor.BacklogDebuggerAdviceAdvice to execute theBacklogDebuggerif enabled.static classCamelInternalProcessor.BacklogTracerAdviceAdvice to execute theBacklogTracerif enabled.static classCamelInternalProcessor.ChildUnitOfWorkProcessorAdviceAdvice when an EIP uses the shareUnitOfWork functionality.static classCamelInternalProcessor.DebuggerAdviceAdvice to execute when using custom debugger.static classCamelInternalProcessor.DelayerAdviceAdvice for delayingstatic classCamelInternalProcessor.MessageHistoryAdviceAdvice when Message History has been enabled.static classCamelInternalProcessor.NodeHistoryAdviceAdvice that stores the node id and label of the processor that is processing the exchange.static classCamelInternalProcessor.RouteInflightRepositoryAdviceAdvice to keep theInflightRepositoryup to date.static classCamelInternalProcessor.RouteLifecycleAdviceAdvice to invoke callbacks for before and after routing.static classCamelInternalProcessor.RoutePolicyAdviceAdvice to execute anyRoutePolicya route may have been configured with.static classCamelInternalProcessor.StreamCachingAdviceAdvice forStreamCachingStrategystatic classCamelInternalProcessor.TracingAdviceAdvice for tracingstatic classCamelInternalProcessor.UnitOfWorkProcessorAdviceAdvice to inject newUnitOfWorkto theExchangeif needed, and as well to ensure theUnitOfWorkis 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 voidaddAdvice(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)voidaddManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor processor)voidaddRouteInflightRepositoryAdvice(org.apache.camel.spi.InflightRepository inflightRepository, String routeId)voidaddRouteLifecycleAdvice()voidaddRoutePolicyAdvice(List<org.apache.camel.spi.RoutePolicy> routePolicyList)protected voiddoBuild()protected voiddoShutdown()<T> TgetAdvice(Class<T> type)static voidonClassloaded(org.slf4j.Logger log)booleanprocess(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback)voidsetRouteOnAdvices(org.apache.camel.Route route)StringtoString()static Objectunwrap(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
doInit, doStart, doStop, getProcessor, hasNext, next, setProcessor, setProcessor
-
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
-
-
-
-
Method Detail
-
onClassloaded
public static void onClassloaded(org.slf4j.Logger log)
-
doBuild
protected void doBuild() throws Exception- Overrides:
doBuildin classorg.apache.camel.support.processor.DelegateAsyncProcessor- Throws:
Exception
-
doShutdown
protected void doShutdown() throws Exception- Overrides:
doShutdownin classorg.apache.camel.support.processor.DelegateAsyncProcessor- Throws:
Exception
-
addAdvice
public void addAdvice(org.apache.camel.spi.CamelInternalProcessorAdvice<?> advice)
- Specified by:
addAdvicein interfaceorg.apache.camel.spi.InternalProcessor
-
getAdvice
public <T> T getAdvice(Class<T> type)
- Specified by:
getAdvicein interfaceorg.apache.camel.spi.InternalProcessor
-
addRoutePolicyAdvice
public void addRoutePolicyAdvice(List<org.apache.camel.spi.RoutePolicy> routePolicyList)
- Specified by:
addRoutePolicyAdvicein interfaceorg.apache.camel.spi.InternalProcessor
-
addRouteInflightRepositoryAdvice
public void addRouteInflightRepositoryAdvice(org.apache.camel.spi.InflightRepository inflightRepository, String routeId)- Specified by:
addRouteInflightRepositoryAdvicein interfaceorg.apache.camel.spi.InternalProcessor
-
addRouteLifecycleAdvice
public void addRouteLifecycleAdvice()
- Specified by:
addRouteLifecycleAdvicein interfaceorg.apache.camel.spi.InternalProcessor
-
addManagementInterceptStrategy
public void addManagementInterceptStrategy(org.apache.camel.spi.ManagementInterceptStrategy.InstrumentationProcessor processor)
- Specified by:
addManagementInterceptStrategyin interfaceorg.apache.camel.spi.InternalProcessor
-
setRouteOnAdvices
public void setRouteOnAdvices(org.apache.camel.Route route)
- Specified by:
setRouteOnAdvicesin interfaceorg.apache.camel.spi.InternalProcessor
-
process
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback)- Specified by:
processin interfaceorg.apache.camel.AsyncProcessor- Overrides:
processin classorg.apache.camel.support.processor.DelegateAsyncProcessor
-
toString
public String toString()
- Overrides:
toStringin 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)
-
-