|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.saga.repository.inmemory.InMemorySagaRepository
public class InMemorySagaRepository
SagaRepository implementation that stores all Saga instances in memory.
Constructor Summary | |
---|---|
InMemorySagaRepository()
|
Method Summary | |
---|---|
void |
add(Saga saga)
Registers a newly created Saga with the Repository. |
void |
commit(Saga saga)
Commits the changes made to the Saga instance. |
Set<String> |
find(Class<? extends Saga> type,
AssociationValue associationValue)
Find saga instances of the given type that have been associated with the given
associationValue . |
Saga |
load(String sagaIdentifier)
Loads a known Saga instance by its unique identifier. |
int |
size()
Returns the number of Sagas currently contained in this repository. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InMemorySagaRepository()
Method Detail |
---|
public Set<String> find(Class<? extends Saga> type, AssociationValue associationValue)
SagaRepository
type
that have been associated with the given
associationValue
.
Returned Sagas must be committed
after processing.
find
in interface SagaRepository
type
- The type of Saga to returnassociationValue
- The value that the returned Sagas must be associated with
null
.public Saga load(String sagaIdentifier)
SagaRepository
committed
after processing.
Due to the concurrent nature of Sagas, it is not unlikely for a Saga to have ceased to exist after it has been
found based on associations. Therefore, a repository should return null
in case a Saga doesn't
exists, as opposed to throwing an exception.
load
in interface SagaRepository
sagaIdentifier
- The unique identifier of the Saga to load
null
if no such saga existspublic void commit(Saga saga)
SagaRepository
Saga.isActive()
returns
false
), the repository should delete the saga from underlying storage and remove all stored association
values associated with that Saga.
Implementations *may* (temporarily) return a cached version of the Saga, which is marked inactive.
commit
in interface SagaRepository
saga
- The Saga instance to commitpublic void add(Saga saga)
SagaRepository
Saga.isActive()
returns
false
), it is not stored.
add
in interface SagaRepository
saga
- The Saga instances to add.public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |