Interface SagaModel<T>
- Type Parameters:
T- The saga type
public interface SagaModel<T>
Interface of a model that describes a Saga of type
T. Use the SagaModel to obtain associations and
event handlers for the Saga.-
Method Summary
Modifier and TypeMethodDescriptionList<MessageHandlingMember<? super T>> findHandlerMethods(EventMessage<?> event) Returns aListofMessageHandlingMemberthat can handle the given event.default booleanhasHandlerMethod(EventMessage<?> eventMessage) Indicates whether the Saga described by this model has a handler for the giveneventMessageReturns the factory that created this model.resolveAssociation(EventMessage<?> eventMessage)
-
Method Details
-
resolveAssociation
Returns theAssociationValueused to find sagas of typeTthat can handle the giveneventMessage. If the saga type does not handle events of this type an empty Optional is returned.- Parameters:
eventMessage- The event to find the association value for- Returns:
- Optional of the AssociationValue for the event, or an empty Optional if the saga doesn't handle the event
-
findHandlerMethods
Returns aListofMessageHandlingMemberthat can handle the given event.- Parameters:
event- TheEventMessageto be handled- Returns:
- event message handlers for the given
event
-
hasHandlerMethod
Indicates whether the Saga described by this model has a handler for the giveneventMessage- Parameters:
eventMessage- The message to check the availability of a handler for- Returns:
trueif there the Saga has a handler for this message, otherwisefalse
-
modelFactory
SagaMetaModelFactory modelFactory()Returns the factory that created this model.- Returns:
- The factory that made this model
-