public static enum UnitOfWork.Phase extends Enum<UnitOfWork.Phase>
Enum Constant and Description |
---|
AFTER_COMMIT
Indicates that the Unit of Work is after a successful commit.
|
CLEANUP
Indicates that the Unit of Work is after a successful commit or after a rollback.
|
CLOSED
Indicates that the Unit of Work is at the end of its life cycle.
|
COMMIT
Indicates that the Unit of Work has been committed and is passed the
PREPARE_COMMIT phase. |
NOT_STARTED
Indicates that the unit of work has been created but has not been registered with the
CurrentUnitOfWork yet. |
PREPARE_COMMIT
Indicates that the Unit of Work is preparing its commit.
|
ROLLBACK
Indicates that the Unit of Work is being rolled back.
|
STARTED
Indicates that the Unit of Work has been registered with the
CurrentUnitOfWork but has not been
committed, because its Message has not been processed yet. |
Modifier and Type | Method and Description |
---|---|
boolean |
isAfter(UnitOfWork.Phase phase)
Check if this Phase comes after given other
phase . |
boolean |
isBefore(UnitOfWork.Phase phase)
Check if this Phase comes before given other
phase . |
boolean |
isReverseCallbackOrder()
Check whether registered handlers for this phase should be invoked in the order of registration (first
registered handler is invoked first) or in the reverse order of registration (last registered handler is
invoked first).
|
boolean |
isStarted()
Check if a Unit of Work in this phase has been started, i.e.
|
static UnitOfWork.Phase |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UnitOfWork.Phase[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final UnitOfWork.Phase NOT_STARTED
CurrentUnitOfWork
yet.public static final UnitOfWork.Phase STARTED
CurrentUnitOfWork
but has not been
committed, because its Message has not been processed yet.public static final UnitOfWork.Phase PREPARE_COMMIT
UnitOfWork.commit()
has been invoked
on the Unit of Work, indicating that the Message UnitOfWork.getMessage()
of the Unit of Work has been
processed.
All handlers registered to be notified before commit UnitOfWork.onPrepareCommit(java.util.function.Consumer<org.axonframework.messaging.unitofwork.UnitOfWork<T>>)
will be invoked. If no
exception is raised by any of the handlers the Unit of Work will go into the COMMIT
phase, otherwise
it will be rolled back.public static final UnitOfWork.Phase COMMIT
PREPARE_COMMIT
phase.public static final UnitOfWork.Phase ROLLBACK
message
or while the Unit of Work was being committed.public static final UnitOfWork.Phase AFTER_COMMIT
public static final UnitOfWork.Phase CLEANUP
public static final UnitOfWork.Phase CLOSED
public static UnitOfWork.Phase[] values()
for (UnitOfWork.Phase c : UnitOfWork.Phase.values()) System.out.println(c);
public static UnitOfWork.Phase valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isStarted()
CurrentUnitOfWork
.true
if the Unit of Work is started when in this phase, false
otherwisepublic boolean isReverseCallbackOrder()
true
if the order of invoking handlers in this phase should be in the reverse order of
registration, false
otherwise.public boolean isBefore(UnitOfWork.Phase phase)
phase
.phase
- The other Phasetrue
if this comes before the given phase
, false
otherwise.public boolean isAfter(UnitOfWork.Phase phase)
phase
.phase
- The other Phasetrue
if this comes after the given phase
, false
otherwise.Copyright © 2010–2018. All rights reserved.