|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.unitofwork.AbstractUnitOfWork
public abstract class AbstractUnitOfWork
Abstract implementation of the UnitOfWork interface. Provides the necessary implementations to support most actions
required by any Unit of Work, such as managing registration with the CurrentUnitOfWork and support for
nesting a Unit of Work.
CurrentUnitOfWork| Constructor Summary | |
|---|---|
AbstractUnitOfWork()
|
|
| Method Summary | |
|---|---|
void |
commit()
Commits the UnitOfWork. |
protected void |
commitInnerUnitOfWork()
Commit all registered inner units of work. |
protected abstract void |
doCommit()
Executes the logic required to commit this unit of work. |
protected abstract void |
doRollback(Throwable cause)
Executes the logic required to commit this unit of work. |
protected void |
doStart()
Performs logic required when starting this UnitOfWork instance. |
boolean |
isStarted()
Indicates whether this UnitOfWork is started. |
protected abstract void |
notifyListenersCleanup()
|
protected abstract void |
notifyListenersPrepareCommit()
Send a UnitOfWorkListener.onPrepareCommit(java.util.Set, java.util.List)
notification to all registered listeners. |
protected abstract void |
notifyListenersRollback(Throwable cause)
|
void |
rollback()
Clear the UnitOfWork of any buffered changes. |
void |
rollback(Throwable cause)
Clear the UnitOfWork of any buffered changes. |
protected abstract void |
saveAggregates()
Saves all registered aggregates by calling their respective callbacks. |
void |
start()
Starts the current unit of work, preparing it for aggregate registration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.axonframework.unitofwork.UnitOfWork |
|---|
publishEvent, registerAggregate, registerListener |
| Constructor Detail |
|---|
public AbstractUnitOfWork()
| Method Detail |
|---|
public void commit()
UnitOfWork
commit in interface UnitOfWorkprotected abstract void notifyListenersCleanup()
protected abstract void notifyListenersRollback(Throwable cause)
public void rollback()
UnitOfWorkUnitOfWorkListeners are notified.
If the rollback is a result of an exception, consider using UnitOfWork.rollback(Throwable) instead.
rollback in interface UnitOfWorkpublic void rollback(Throwable cause)
UnitOfWorkUnitOfWorkListeners are notified.
rollback in interface UnitOfWorkcause - The cause of the rollback. May be null.public void start()
UnitOfWork
start in interface UnitOfWorkpublic boolean isStarted()
UnitOfWorkUnitOfWork.start() method has been called, and
if the UnitOfWork has not been committed or rolled back.
isStarted in interface UnitOfWorktrue if this UnitOfWork is started, false otherwise.protected void doStart()
protected abstract void doCommit()
protected abstract void doRollback(Throwable cause)
cause - the cause of the rollbackprotected void commitInnerUnitOfWork()
protected abstract void saveAggregates()
protected abstract void notifyListenersPrepareCommit()
UnitOfWorkListener.onPrepareCommit(java.util.Set, java.util.List)
notification to all registered listeners.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||