EventPlayingTransaction

public abstract class EventPlayingTransaction<I, E extends TransactionalEntity<I, S, B>, S extends EntityState, B extends ValidatingBuilder<S>> extends Transaction<I, E, S, B>

A transaction that supports event playing.

Parameters

<I>

the type of entity IDs

<E>

the type of entity

<S>

the type of entity state

<B>

the type of a ValidatingBuilder for the entity state

Inheritors

Constructors

Link copied to clipboard
protected void EventPlayingTransaction(E entity)
protected void EventPlayingTransaction(E entity, S state, Version version)

Functions

Link copied to clipboard
Creates a version increment for the entity based on the currently processed event.
Link copied to clipboard
protected abstract DispatchOutcome dispatch(E entity, EventEnvelope event)
Dispatches the event message and its context to the given entity.
Link copied to clipboard
public DispatchOutcome play(EventEnvelope event)
Applies the given event to the entity in transaction.

Inherited functions

Link copied to clipboard
public final void commit()
Applies all the outstanding modifications to the enclosed entity.
Link copied to clipboard
protected final void commitAttributeChanges()
Applies lifecycle flag modifications to the entity under transaction.
Link copied to clipboard
public final void commitIfActive()
Commits this transaction if it is still active.
Link copied to clipboard
protected final E entity()
Link copied to clipboard
protected final DispatchOutcome propagate(Phase<I> phase)
Propagates a phase and performs a rollback in case of an error.
Link copied to clipboard
protected final void setArchived(boolean archived)
Set archived lifecycle flag to the passed value.
Link copied to clipboard
protected final void setDeleted(boolean deleted)
Set deleted lifecycle flag to the passed value.
Link copied to clipboard
public final void setListener(TransactionListener<I> listener)
Injects a listener into this transaction.