ProjectionTransaction

public class ProjectionTransaction<I, S extends EntityState, B extends ValidatingBuilder<S>> extends EventPlayingTransaction<I, E, S, B>

A transaction, within which projection instances are modified.

Parameters

<I>

the type of projection IDs

<S>

the type of projection state

<B>

the type of a ValidatingBuilder for the projection state

Constructors

Link copied to clipboard
protected void ProjectionTransaction(Projection<I, S, B> projection, 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 DispatchOutcome dispatch(Projection<I, S, B> projection, EventEnvelope event)
Dispatches the event message and its context to the given entity.
Link copied to clipboard
protected static ProjectionTransaction<I, S, B> start<I, S extends EntityState, B extends ValidatingBuilder<S>>(Projection<I, S, B> projection)
Creates a new transaction for a given projection.

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
public DispatchOutcome play(EventEnvelope event)
Applies the given event to the entity in transaction.
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.