private void removeEntry(String aggregateIdentifier) { for (DisruptorRepository repository : repositories.values()) { repository.removeFromCache(aggregateIdentifier); } cache.remove(aggregateIdentifier); }
@Override public void deleteSaga(Class<? extends T> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues) { sagaCache.remove(sagaIdentifier); associationValues.forEach(av -> removeAssociationValueFromCache(sagaType, sagaIdentifier, av)); delegate.deleteSaga(sagaType, sagaIdentifier, associationValues); }
@Override protected void validateOnLoad(Aggregate<T> aggregate, Long expectedVersion) { CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); super.validateOnLoad(aggregate, expectedVersion); }
@Override protected EventSourcedAggregate<T> doCreateNewForLock(Callable<T> factoryMethod) throws Exception { EventSourcedAggregate<T> aggregate = super.doCreateNewForLock(factoryMethod); CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); cache.put(aggregate.identifierAsString(), new AggregateCacheEntry<>(aggregate)); return aggregate; }
private void removeEntry(String aggregateIdentifier) { for (DisruptorRepository repository : repositories.values()) { repository.removeFromCache(aggregateIdentifier); } cache.remove(aggregateIdentifier); }
private void removeEntry(String aggregateIdentifier) { for (DisruptorRepository repository : repositories.values()) { repository.removeFromCache(aggregateIdentifier); } cache.remove(aggregateIdentifier); }
@Override public void deleteSaga(Class<? extends T> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues) { sagaCache.remove(sagaIdentifier); associationValues.forEach(av -> removeAssociationValueFromCache(sagaType, sagaIdentifier, av)); delegate.deleteSaga(sagaType, sagaIdentifier, associationValues); }
@Override public void deleteSaga(Class<? extends T> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues) { sagaCache.remove(sagaIdentifier); associationValues.forEach(av -> removeAssociationValueFromCache(sagaType, sagaIdentifier, av)); delegate.deleteSaga(sagaType, sagaIdentifier, associationValues); }
@Override protected void validateOnLoad(Aggregate<T> aggregate, Long expectedVersion) { CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); super.validateOnLoad(aggregate, expectedVersion); }
@Override protected void validateOnLoad(Aggregate<T> aggregate, Long expectedVersion) { CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); super.validateOnLoad(aggregate, expectedVersion); }
@Override protected EventSourcedAggregate<T> doCreateNewForLock(Callable<T> factoryMethod) throws Exception { EventSourcedAggregate<T> aggregate = super.doCreateNewForLock(factoryMethod); CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); cache.put(aggregate.identifierAsString(), new AggregateCacheEntry<>(aggregate)); return aggregate; }
@Override protected EventSourcedAggregate<T> doCreateNewForLock(Callable<T> factoryMethod) throws Exception { EventSourcedAggregate<T> aggregate = super.doCreateNewForLock(factoryMethod); CurrentUnitOfWork.get().onRollback(u -> cache.remove(aggregate.identifierAsString())); cache.put(aggregate.identifierAsString(), new AggregateCacheEntry<>(aggregate)); return aggregate; }