|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UnitOfWork
An object representing the unit of work processing an Exchange
which allows the use of Synchronization hooks. This object might map one-to-one with
a transaction in JPA or Spring; or might not.
| Method Summary | |
|---|---|
void |
addSynchronization(Synchronization synchronization)
Adds a synchronization hook |
void |
beginTransactedBy(Object transactionDefinition)
Mark this UnitOfWork as being transacted by the given transaction definition. |
void |
done(Exchange exchange)
Invoked when this unit of work has been completed, whether it has failed or completed |
void |
endTransactedBy(Object transactionDefinition)
Mark this UnitOfWork as not transacted anymore by the given transaction definition. |
String |
getId()
Returns the unique ID of this unit of work, lazily creating one if it does not yet have one |
Message |
getOriginalInMessage()
Gets the original IN Message this Unit of Work was started with. |
RouteContext |
getRouteContext()
Gets the RouteContext that this UnitOfWork currently is being routed through. |
TracedRouteNodes |
getTracedRouteNodes()
Gets tracing information |
void |
handoverSynchronization(Exchange target)
Handover all the registered synchronizations to the target Exchange. |
boolean |
isTransactedBy(Object transactionDefinition)
Are we already transacted by the given transaction definition The definition will most likely be a Spring TransactionTemplate when using Spring Transaction |
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 |
removeSynchronization(Synchronization synchronization)
Removes a synchronization hook |
| Method Detail |
|---|
void addSynchronization(Synchronization synchronization)
synchronization - the hookvoid removeSynchronization(Synchronization synchronization)
synchronization - the hookvoid handoverSynchronization(Exchange target)
Exchange.
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.
target - the target exchangevoid done(Exchange exchange)
exchange - the current exchangeString getId()
Message getOriginalInMessage()
Message this Unit of Work was started with.
MessageTracedRouteNodes getTracedRouteNodes()
boolean isTransactedBy(Object transactionDefinition)
transactionDefinition - the transaction definition
void beginTransactedBy(Object transactionDefinition)
endTransactedBy(Object) method.
transactionDefinition - the transaction definitionvoid endTransactedBy(Object transactionDefinition)
transactionDefinition - the transaction definitionRouteContext getRouteContext()
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(RouteContext),
popRouteContext()void pushRouteContext(RouteContext routeContext)
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.
routeContext - the route contextRouteContext popRouteContext()
RouteContext
it should be removed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||