|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.saga.repository.AbstractSagaRepository
public abstract class AbstractSagaRepository
Abstract implementation for saga repositories. This (partial) implementation will take care of the uniqueness of saga instances in the JVM. That means it will prevent multiple instances of the same conceptual Saga (i.e. with same identifier) to exist within the JVM.
| Constructor Summary | |
|---|---|
AbstractSagaRepository()
|
|
| 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. |
|
|
find(Class<T> type,
Set<AssociationValue> associationValues)
Find saga instances of the given type that have been associated with the given
associationValue. |
|
protected AssociationValueMap |
getAssociationValueMap()
Returns the AssociationValueMap containing the mappings of AssociationValue to Saga. |
|
protected SagaCache |
getSagaCache()
Returns the SagaCache used to prevent multiple instances of the same conceptual Saga (i.e. with same identifier) from being active in the JVM. |
|
|
load(Class<T> type,
String sagaIdentifier)
Loads a known Saga instance by its unique identifier. |
|
protected abstract
|
loadSaga(Class<T> type,
String sagaIdentifier)
Loads a known Saga instance by its unique identifier. |
|
void |
purgeCache()
Remove all elements from the cache pointing to Saga instances that have been garbage collected. |
|
protected abstract void |
removeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
Removes the association value that has been associated with Saga, identified with the given sagaIdentifier. |
|
protected abstract void |
storeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
Store the given associationValue, which has been associated with given sagaIdentifier. |
|
protected abstract void |
storeSaga(Saga saga)
Stores a newly created Saga instance. |
|
protected abstract void |
updateSaga(Saga saga)
Update a stored Saga, by replacing it with the given saga instance. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSagaRepository()
| Method Detail |
|---|
public <T extends Saga> Set<T> find(Class<T> type,
Set<AssociationValue> associationValues)
SagaRepositorytype that have been associated with the given
associationValue.
Returned Sagas must be committed after processing.
find in interface SagaRepositoryT - The type of Saga to returntype - The type of Saga to returnassociationValues - The value that the returned Sagas must be associated with
null.
public <T extends Saga> T load(Class<T> type,
String sagaIdentifier)
SagaRepositorycommitted
after processing.
load in interface SagaRepositoryT - The expected type of Sagatype - The expected type of SagasagaIdentifier - The unique identifier of the Saga to load
public void add(Saga saga)
SagaRepository
add in interface SagaRepositorysaga - The Saga instances to add.public void commit(Saga saga)
SagaRepository
commit in interface SagaRepositorysaga - The Saga instance to commit
protected abstract <T extends Saga> T loadSaga(Class<T> type,
String sagaIdentifier)
T - The expected type of Sagatype - The expected type of SagasagaIdentifier - The unique identifier of the Saga to load
NoSuchSagaException - if no Saga with given identifier can be foundprotected abstract void updateSaga(Saga saga)
saga instance.
saga - The saga that has been modified and needs to be updated in the storageprotected abstract void storeSaga(Saga saga)
saga - The newly created Saga instance to store.
protected abstract void storeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
associationValue, which has been associated with given sagaIdentifier.
associationValue - The association value to storesagaIdentifier - The saga related to the association value
protected abstract void removeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
sagaIdentifier.
associationValue - The value to remove as association value for the given sagasagaIdentifier - The identifier of the Saga to remove the association fromprotected AssociationValueMap getAssociationValueMap()
protected SagaCache getSagaCache()
public void purgeCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||