|
||||||||||
| 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 |
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 |
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 - is thrown if starting failed
public void stop()
throws Exception
Service
stop in interface ServiceException - is thrown if stopping failedpublic 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 Message getOriginalInMessage()
UnitOfWorkMessage this Unit of Work was started with.
getOriginalInMessage in interface UnitOfWorkMessagepublic TracedRouteNodes getTracedRouteNodes()
UnitOfWork
getTracedRouteNodes in interface UnitOfWorkpublic boolean isTransactedBy(Object transactionDefinition)
UnitOfWork
isTransactedBy in interface UnitOfWorktransactionDefinition - the transaction definition
public void beginTransactedBy(Object transactionDefinition)
UnitOfWorkUnitOfWork.endTransactedBy(Object) method.
beginTransactedBy in interface UnitOfWorktransactionDefinition - the transaction definitionpublic void endTransactedBy(Object transactionDefinition)
UnitOfWork
endTransactedBy in interface UnitOfWorktransactionDefinition - the transaction definitionpublic RouteContext getRouteContext()
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.
getRouteContext in interface UnitOfWorkUnitOfWork.pushRouteContext(RouteContext),
UnitOfWork.popRouteContext()public 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 UnitOfWorkrouteContext - the route contextpublic RouteContext popRouteContext()
UnitOfWorkRouteContext
it should be removed.
popRouteContext in interface UnitOfWork
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||