org.axonframework.saga
Interface Saga

All Known Implementing Classes:
AbstractAnnotatedSaga, ToDoSaga

public interface Saga

Interface describing an implementation of a Saga. Sagas are instances that handle events and may possibly produce new commands or have other side effects. Typically, Sagas are used to manage long running business transactions.

Multiple instances of a single type of Saga may exist. In that case, each Saga will be managing a different transaction. Sagas need to be associated with concepts in order to receive specific events. These associations are managed through AssociationValues. For example, to associate a saga with an Order with ID 1234, this saga needs an association value with key "orderId" and value "1234".

Since:
0.7
Author:
Allard Buijze

Method Summary
 AssociationValues getAssociationValues()
          Returns a view on the Association Values for this saga instance.
 String getSagaIdentifier()
          Returns the unique identifier of this saga.
 void handle(EventMessage event)
          Handle the given event.
 boolean isActive()
          Indicates whether or not this saga is active.
 

Method Detail

getSagaIdentifier

String getSagaIdentifier()
Returns the unique identifier of this saga.

Returns:
the unique identifier of this saga

getAssociationValues

AssociationValues getAssociationValues()
Returns a view on the Association Values for this saga instance. The returned instance is mutable.

Returns:
a view on the Association Values for this saga instance

handle

void handle(EventMessage event)
Handle the given event. The actual result of processing depends on the implementation of the saga.

Implementations are highly discouraged from throwing exceptions.

Parameters:
event - the event to handle

isActive

boolean isActive()
Indicates whether or not this saga is active. A Saga is active when its life cycle has not been ended.

Returns:
true if this saga is active, false otherwise.


Copyright © 2010-2016. All Rights Reserved.