|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.unitofwork.CurrentUnitOfWork
public abstract class CurrentUnitOfWork
Default entry point to gain access to the current UnitOfWork. Components managing transactional boundaries can register and clear UnitOfWork instances, which components can use.
Method Summary | |
---|---|
static void |
clear(UnitOfWork unitOfWork)
Clears the UnitOfWork currently bound to the current thread, if that UnitOfWork is the given unitOfWork . |
static void |
commit()
Commits the current UnitOfWork. |
static UnitOfWork |
get()
Gets the UnitOfWork bound to the current thread. |
static boolean |
isStarted()
Indicates whether a unit of work has already been started. |
static void |
set(UnitOfWork unitOfWork)
Binds the given unitOfWork to the current thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isStarted()
public static UnitOfWork get()
IllegalStateException
is thrown.
To verify whether a UnitOfWork is already active, use isStarted()
.
IllegalStateException
- if no UnitOfWork is activepublic static void commit()
IllegalStateException
is thrown.
IllegalStateException
- if no UnitOfWork is currently started.UnitOfWork.commit()
public static void set(UnitOfWork unitOfWork)
unitOfWork
to the current thread. If other UnitOfWork instances were bound, they
will be marked as inactive until the given UnitOfWork is cleared.
unitOfWork
- The UnitOfWork to bind to the current thread.public static void clear(UnitOfWork unitOfWork)
unitOfWork
. Otherwise, nothing happens.
unitOfWork
- The UnitOfWork expected to be bound to the current thread.
IllegalStateException
- when the given UnitOfWork was not the current active UnitOfWork. This exception
indicates a potentially wrong nesting of Units Of Work.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |