|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Service
stop
in class DefaultUnitOfWork
Exception
- is thrown if stopping failedpublic void pushRouteContext(RouteContext routeContext)
UnitOfWork
RouteContext
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 UnitOfWork
pushRouteContext
in class DefaultUnitOfWork
routeContext
- the route contextpublic RouteContext popRouteContext()
UnitOfWork
RouteContext
it should be removed.
popRouteContext
in interface UnitOfWork
popRouteContext
in class DefaultUnitOfWork
public void beginTransactedBy(Object key)
UnitOfWork
UnitOfWork.endTransactedBy(Object)
method using the same key.
beginTransactedBy
in interface UnitOfWork
beginTransactedBy
in class DefaultUnitOfWork
key
- the transaction keypublic void endTransactedBy(Object key)
UnitOfWork
endTransactedBy
in interface UnitOfWork
endTransactedBy
in class DefaultUnitOfWork
key
- the transaction keypublic AsyncCallback beforeProcess(Processor processor, Exchange exchange, AsyncCallback callback)
UnitOfWork
MDCUnitOfWork
leverages this
to ensure MDC is handled correctly during routing exchanges using the
asynchronous routing engine.
beforeProcess
in interface UnitOfWork
beforeProcess
in class DefaultUnitOfWork
processor
- 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 UnitOfWork
afterProcess
in class DefaultUnitOfWork
processor
- 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 |