|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.saga.repository.AbstractSagaRepository
org.axonframework.saga.repository.jpa.JpaSagaRepository
public class JpaSagaRepository
JPA implementation of the Saga Repository. It uses an EntityManager to persist the actual saga in a backing
store.
EntityManager.flush() is invoked to
ensure the store contains the last modifications. To override this behavior, see
| Constructor Summary | |
|---|---|
JpaSagaRepository()
Initializes a Saga Repository with a JavaSagaSerializer. |
|
| Method Summary | ||
|---|---|---|
void |
initialize()
Initializes the repository by loading all AssociationValues in memory. |
|
protected
|
loadSaga(Class<T> type,
String sagaId)
Loads a known Saga instance by its unique identifier. |
|
protected void |
removeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
Removes the association value that has been associated with Saga, identified with the given sagaIdentifier. |
|
void |
setEntityManager(javax.persistence.EntityManager entityManager)
Sets the EntityManager that takes care of the actual storage of the Saga entries. |
|
void |
setResourceInjector(ResourceInjector resourceInjector)
Sets the ResourceInjector to use to inject Saga instances with any (temporary) resources they might need. |
|
void |
setSerializer(SagaSerializer serializer)
Sets the SagaSerializer instance to serialize Sagas with. |
|
void |
setUseExplicitFlush(boolean useExplicitFlush)
Sets whether or not to do an explicit EntityManager.flush() after each data modifying
operation on the backing storage. |
|
protected void |
storeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
Store the given associationValue, which has been associated with given sagaIdentifier. |
|
protected void |
storeSaga(Saga saga)
Stores a newly created Saga instance. |
|
protected void |
updateSaga(Saga saga)
Update a stored Saga, by replacing it with the given saga instance. |
|
| Methods inherited from class org.axonframework.saga.repository.AbstractSagaRepository |
|---|
add, commit, find, getAssociationValueMap, getSagaCache, load, purgeCache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JpaSagaRepository()
JavaSagaSerializer.
| Method Detail |
|---|
protected void removeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
AbstractSagaRepositorysagaIdentifier.
removeAssociationValue in class AbstractSagaRepositoryassociationValue - The value to remove as association value for the given sagasagaIdentifier - The identifier of the Saga to remove the association from
protected void storeAssociationValue(AssociationValue associationValue,
String sagaIdentifier)
AbstractSagaRepositoryassociationValue, which has been associated with given sagaIdentifier.
storeAssociationValue in class AbstractSagaRepositoryassociationValue - The association value to storesagaIdentifier - The saga related to the association value
protected <T extends Saga> T loadSaga(Class<T> type,
String sagaId)
AbstractSagaRepository
loadSaga in class AbstractSagaRepositoryT - The expected type of Sagatype - The expected type of SagasagaId - The unique identifier of the Saga to load
protected void updateSaga(Saga saga)
AbstractSagaRepositorysaga instance.
updateSaga in class AbstractSagaRepositorysaga - The saga that has been modified and needs to be updated in the storageprotected void storeSaga(Saga saga)
AbstractSagaRepository
storeSaga in class AbstractSagaRepositorysaga - The newly created Saga instance to store.@PostConstruct public void initialize()
AssociationValues.
public void setResourceInjector(ResourceInjector resourceInjector)
resourceInjector - The resource injectorpublic void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager - the EntityManager that takes care of the actual storage of the Saga entriespublic void setSerializer(SagaSerializer serializer)
serializer - the SagaSerializer instance to serialize Sagas withpublic void setUseExplicitFlush(boolean useExplicitFlush)
EntityManager.flush() after each data modifying
operation on the backing storage. Default to true
useExplicitFlush - true to force flush, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||