Package org.apache.camel.impl.engine
Class MDCUnitOfWork
java.lang.Object
org.apache.camel.impl.engine.DefaultUnitOfWork
org.apache.camel.impl.engine.MDCUnitOfWork
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.spi.UnitOfWork
This unit of work supports MDC.
-
Field Summary
Fields inherited from interface org.apache.camel.spi.UnitOfWork
MDC_BREADCRUMB_ID, MDC_CAMEL_CONTEXT_ID, MDC_CORRELATION_ID, MDC_EXCHANGE_ID, MDC_MESSAGE_ID, MDC_ROUTE_ID, MDC_STEP_ID, MDC_TRANSACTION_KEY -
Constructor Summary
ConstructorsConstructorDescriptionMDCUnitOfWork(org.apache.camel.Exchange exchange, org.apache.camel.spi.InflightRepository inflightRepository, String pattern, boolean allowUseOriginalMessage, boolean useBreadcrumb) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterProcess(org.apache.camel.Processor processor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, boolean doneSync) org.apache.camel.AsyncCallbackbeforeProcess(org.apache.camel.Processor processor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) voidbeginTransactedBy(Object key) voidclear()Clears information put on the MDC by thisMDCUnitOfWorkprotected voidclearCustom(org.apache.camel.Exchange exchange) Clear custom MDC values based on the configured MDC patternvoiddone(org.apache.camel.Exchange exchange) voidendTransactedBy(Object key) booleanorg.apache.camel.spi.UnitOfWorknewInstance(org.apache.camel.Exchange exchange) protected voidonDone()org.apache.camel.RoutepopRoute()protected voidprepareMDC(org.apache.camel.Exchange exchange) voidpushRoute(org.apache.camel.Route route) voidreset()voidstart()voidstop()toString()Methods inherited from class org.apache.camel.impl.engine.DefaultUnitOfWork
addSynchronization, afterRoute, beforeRoute, containsSynchronization, createChildUnitOfWork, getOriginalInMessage, getRoute, handoverSynchronization, handoverSynchronization, isTransacted, isTransactedBy, onPrepare, removeSynchronization, routeStackLevel, routeStackLevel, setParentUnitOfWorkMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init
-
Constructor Details
-
MDCUnitOfWork
public MDCUnitOfWork(org.apache.camel.Exchange exchange, org.apache.camel.spi.InflightRepository inflightRepository, String pattern, boolean allowUseOriginalMessage, boolean useBreadcrumb)
-
-
Method Details
-
prepareMDC
protected void prepareMDC(org.apache.camel.Exchange exchange) -
newInstance
public org.apache.camel.spi.UnitOfWork newInstance(org.apache.camel.Exchange exchange) -
pushRoute
public void pushRoute(org.apache.camel.Route route) - Specified by:
pushRoutein interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
pushRoutein classDefaultUnitOfWork
-
popRoute
public org.apache.camel.Route popRoute()- Specified by:
popRoutein interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
popRoutein classDefaultUnitOfWork
-
beginTransactedBy
- Specified by:
beginTransactedByin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
beginTransactedByin classDefaultUnitOfWork
-
endTransactedBy
- Specified by:
endTransactedByin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
endTransactedByin classDefaultUnitOfWork
-
isBeforeAfterProcess
public boolean isBeforeAfterProcess()- Specified by:
isBeforeAfterProcessin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
isBeforeAfterProcessin classDefaultUnitOfWork
-
beforeProcess
public org.apache.camel.AsyncCallback beforeProcess(org.apache.camel.Processor processor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) - Specified by:
beforeProcessin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
beforeProcessin classDefaultUnitOfWork
-
afterProcess
public void afterProcess(org.apache.camel.Processor processor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, boolean doneSync) - Specified by:
afterProcessin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
afterProcessin classDefaultUnitOfWork
-
clear
public void clear()Clears information put on the MDC by thisMDCUnitOfWork -
clearCustom
protected void clearCustom(org.apache.camel.Exchange exchange) Clear custom MDC values based on the configured MDC pattern -
done
public void done(org.apache.camel.Exchange exchange) - Specified by:
donein interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
donein classDefaultUnitOfWork
-
onDone
protected void onDone()- Overrides:
onDonein classDefaultUnitOfWork
-
reset
public void reset()- Specified by:
resetin interfaceorg.apache.camel.spi.UnitOfWork- Overrides:
resetin classDefaultUnitOfWork
-
start
public void start()- Specified by:
startin interfaceorg.apache.camel.Service
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.camel.Service
-
toString
- Overrides:
toStringin classDefaultUnitOfWork
-