|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.DefaultUnitOfWork
public class DefaultUnitOfWork
The default implementation of UnitOfWork
| Constructor Summary | |
|---|---|
DefaultUnitOfWork(Exchange exchange)
|
|
| Method Summary | |
|---|---|
void |
addSynchronization(Synchronization synchronization)
Adds a synchronization hook |
void |
addTraced(RouteNode entry)
Adds the entry that was intercepted |
void |
done(Exchange exchange)
Invoked when this unit of work has been completed, whether it has failed or completed |
int |
getAndIncrement(ProcessorDefinition node)
A private counter that increments, is used to as book keeping how far this exchange have been intercepted by the general intercept(). |
String |
getId()
Returns the unique ID of this unit of work, lazily creating one if it does not yet have one |
RouteNode |
getLastNode()
Gets the last node, is null if no last exists. |
List<RouteNode> |
getNodes()
Gets the current list of nodes, representing the route path the current Exchange has currently taken. |
Message |
getOriginalInMessage()
Gets the original IN Message this Unit of Work was started with. |
RouteNode |
getSecondLastNode()
Gets the 2nd last node, is null if no last exists. |
void |
handoverSynchronization(Exchange target)
Handover all the registered synchronizations to the target Exchange. |
void |
removeSynchronization(Synchronization synchronization)
Removes a synchronization hook |
void |
start()
Starts the service |
void |
stop()
Stops the service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultUnitOfWork(Exchange exchange)
| Method Detail |
|---|
public void start()
throws Exception
Service
start in interface ServiceException
public void stop()
throws Exception
Service
stop in interface ServiceExceptionpublic void addSynchronization(Synchronization synchronization)
UnitOfWork
addSynchronization in interface UnitOfWorksynchronization - the hookpublic void removeSynchronization(Synchronization synchronization)
UnitOfWork
removeSynchronization in interface UnitOfWorksynchronization - the hookpublic void handoverSynchronization(Exchange target)
UnitOfWorkExchange.
This is used when a route turns into asynchronous and the Exchange that
is continued and routed in the async thread should do the on completion callbacks instead of the
original synchronous thread.
handoverSynchronization in interface UnitOfWorktarget - the target exchangepublic void done(Exchange exchange)
UnitOfWork
done in interface UnitOfWorkexchange - the current exchangepublic String getId()
UnitOfWork
getId in interface UnitOfWorkpublic void addTraced(RouteNode entry)
TraceableUnitOfWork
addTraced in interface TraceableUnitOfWorkentry - the entrypublic RouteNode getLastNode()
TraceableUnitOfWork
getLastNode in interface TraceableUnitOfWorkpublic RouteNode getSecondLastNode()
TraceableUnitOfWork
getSecondLastNode in interface TraceableUnitOfWorkpublic List<RouteNode> getNodes()
TraceableUnitOfWorkExchange has currently taken.
getNodes in interface TraceableUnitOfWorkpublic Message getOriginalInMessage()
UnitOfWorkMessage this Unit of Work was started with.
getOriginalInMessage in interface UnitOfWorkMessagepublic int getAndIncrement(ProcessorDefinition node)
TraceableUnitOfWork
getAndIncrement in interface TraceableUnitOfWorknode - the intercept node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||