|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.DefaultUnitOfWork
org.apache.camel.impl.MDCUnitOfWork
public class MDCUnitOfWork
This unit of work supports MDC.
| Field Summary | |
|---|---|
static String |
MDC_BREADCRUMB_ID
|
static String |
MDC_CAMEL_CONTEXT_ID
|
static String |
MDC_CORRELATION_ID
|
static String |
MDC_EXCHANGE_ID
|
static String |
MDC_MESSAGE_ID
|
static String |
MDC_ROUTE_ID
|
static String |
MDC_TRANSACTION_KEY
|
| Constructor Summary | |
|---|---|
MDCUnitOfWork(Exchange exchange)
|
|
| Method Summary | |
|---|---|
void |
afterProcess(Processor processor,
Exchange exchange,
AsyncCallback callback,
boolean doneSync)
Strategy for optional work to be executed after the processing |
AsyncCallback |
beforeProcess(Processor processor,
Exchange exchange,
AsyncCallback callback)
Strategy for optional work to be execute before processing For example the MDCUnitOfWork leverages this
to ensure MDC is handled correctly during routing exchanges using the
asynchronous routing engine. |
void |
beginTransactedBy(Object key)
Mark this UnitOfWork as being transacted by the given transaction key. |
void |
clear()
Clears information put on the MDC by this MDCUnitOfWork |
void |
endTransactedBy(Object key)
Mark this UnitOfWork as not transacted anymore by the given transaction definition. |
UnitOfWork |
newInstance(Exchange exchange)
|
RouteContext |
popRouteContext()
When finished being routed under the current RouteContext
it should be removed. |
void |
pushRouteContext(RouteContext routeContext)
Pushes the RouteContext that this UnitOfWork currently is being routed through. |
void |
stop()
Stops the service |
String |
toString()
|
| Methods inherited from class org.apache.camel.impl.DefaultUnitOfWork |
|---|
addSynchronization, beginSubUnitOfWork, containsSynchronization, createChildUnitOfWork, done, endSubUnitOfWork, getId, getOriginalInMessage, getRouteContext, getSubUnitOfWorkCallback, getTracedRouteNodes, handoverSynchronization, isTransacted, isTransactedBy, removeSynchronization, setParentUnitOfWork, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String MDC_BREADCRUMB_ID
public static final String MDC_EXCHANGE_ID
public static final String MDC_MESSAGE_ID
public static final String MDC_CORRELATION_ID
public static final String MDC_ROUTE_ID
public static final String MDC_CAMEL_CONTEXT_ID
public static final String MDC_TRANSACTION_KEY
| Constructor Detail |
|---|
public MDCUnitOfWork(Exchange exchange)
| Method Detail |
|---|
public UnitOfWork newInstance(Exchange exchange)
public void stop()
throws Exception
Service
stop in interface Servicestop in class DefaultUnitOfWorkException - is thrown if stopping failedpublic void pushRouteContext(RouteContext routeContext)
UnitOfWorkRouteContext that this UnitOfWork currently is being routed through.
Notice that an Exchange can be routed through multiple routes and thus the
RouteContext can change over time.
pushRouteContext in interface UnitOfWorkpushRouteContext in class DefaultUnitOfWorkrouteContext - the route contextpublic RouteContext popRouteContext()
UnitOfWorkRouteContext
it should be removed.
popRouteContext in interface UnitOfWorkpopRouteContext in class DefaultUnitOfWorkpublic void beginTransactedBy(Object key)
UnitOfWorkUnitOfWork.endTransactedBy(Object) method using the same key.
beginTransactedBy in interface UnitOfWorkbeginTransactedBy in class DefaultUnitOfWorkkey - the transaction keypublic void endTransactedBy(Object key)
UnitOfWork
endTransactedBy in interface UnitOfWorkendTransactedBy in class DefaultUnitOfWorkkey - the transaction key
public AsyncCallback beforeProcess(Processor processor,
Exchange exchange,
AsyncCallback callback)
UnitOfWorkMDCUnitOfWork leverages this
to ensure MDC is handled correctly during routing exchanges using the
asynchronous routing engine.
beforeProcess in interface UnitOfWorkbeforeProcess in class DefaultUnitOfWorkprocessor - the processor to be executedexchange - the current exchangecallback - the callback
public void afterProcess(Processor processor,
Exchange exchange,
AsyncCallback callback,
boolean doneSync)
UnitOfWork
afterProcess in interface UnitOfWorkafterProcess in class DefaultUnitOfWorkprocessor - the processor executedexchange - the current exchangecallback - the callback useddoneSync - whether the process was done synchronously or asynchronouslypublic void clear()
MDCUnitOfWork
public String toString()
toString in class DefaultUnitOfWork
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||