PmEventEndpoint

public class PmEventEndpoint<I, P extends ProcessManager<I, ? extends Object, ? extends Object>> extends PmEndpoint<I, P, M> implements EventEndpoint<I>

Dispatches event to reacting process managers.

Parameters

<I>

the type of process manager IDs

<P>

the type of process managers

Constructors

Link copied to clipboard
protected void PmEventEndpoint(ProcessManagerRepository<I, P, ? extends Object> repository, EventEnvelope event)

Functions

Link copied to clipboard
protected void afterDispatched(I entityId)
The callback invoked after the message is dispatched to an entity with the given ID.
Link copied to clipboard
protected DispatchOutcome invokeDispatcher(P processManager)
Invokes entity-specific method for dispatching the message.
Link copied to clipboard
protected void onEmptyResult(P pm)
Does nothing since a state of a process manager should not be necessarily updated upon reacting on an event.

Inherited functions

Link copied to clipboard
public final DispatchOutcome dispatchTo(I targetId)
Dispatches the message to the target with the passed ID.
Link copied to clipboard
protected final M envelope()
Obtains the envelope of the message processed by this endpoint.
Link copied to clipboard
protected abstract boolean isModified(E entity)
protected boolean isModified(P processManager)
Verifies whether the entity was modified during the message dispatching.
Link copied to clipboard
public void onDuplicate(I target, EventEnvelope envelope)
public abstract void onDuplicate(I target, M envelope)
The callback invoked if the handled signal is a duplicate.
Link copied to clipboard
protected abstract void onModified(E entity)
protected void onModified(P processManager)
Callback to perform operations if the entity was modified during message dispatching.
Link copied to clipboard
protected abstract DispatchOutcome performDispatch(I targetId)
protected final DispatchOutcome performDispatch(I id)
Performs actual dispatching of the signal to the respective target by the passed ID.
Link copied to clipboard
public abstract Repository<I, ? extends Object> repository()
Obtains the repository which manages the target entities.
public Repository<I, E> repository()
public ProcessManagerRepository<I, P, ? extends Object> repository()
Obtains the parent repository of this endpoint.
Link copied to clipboard
protected DispatchOutcome runTransactionFor(P processManager)
Link copied to clipboard
protected final void store(E entity)
Stores the entity if it was modified during message dispatching.