-
- All Implemented Interfaces:
-
org.enodeframework.domain.MemoryCache
public final class DefaultMemoryCache implements MemoryCache
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultMemoryCache.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegertimeoutSecondsprivate IntegerscanExpiredAggregateIntervalMilliseconds
-
Constructor Summary
Constructors Constructor Description DefaultMemoryCache(AggregateStorage aggregateStorage, ScheduleService scheduleService, TypeNameProvider typeNameProvider)
-
Method Summary
Modifier and Type Method Description final IntegergetTimeoutSeconds()final UnitsetTimeoutSeconds(Integer timeoutSeconds)final IntegergetScanExpiredAggregateIntervalMilliseconds()final UnitsetScanExpiredAggregateIntervalMilliseconds(Integer scanExpiredAggregateIntervalMilliseconds)<T extends AggregateRoot> CompletableFuture<T>getAsync(Object aggregateRootId, Class<T> aggregateRootType)Get a strong type aggregate from memory cache. CompletableFuture<AggregateRoot>getAsync(Object aggregateRootId)Get an aggregate from memory cache. <T extends AggregateRoot> UnitacceptAggregateRootChanges(T aggregateRoot)Accept the given aggregate root's changes. <T extends AggregateRoot> UnitrefreshAggregate(T aggregateRoot)Refresh the given aggregate. CompletableFuture<AggregateRoot>refreshAggregateFromEventStoreAsync(String aggregateRootTypeName, String aggregateRootId)Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root. <T extends AggregateRoot> CompletableFuture<T>refreshAggregateFromEventStoreAsync(Class<T> aggregateRootType, String aggregateRootId)Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root. Unitstart()Start background tasks. Unitstop()Stop background tasks. -
-
Constructor Detail
-
DefaultMemoryCache
DefaultMemoryCache(AggregateStorage aggregateStorage, ScheduleService scheduleService, TypeNameProvider typeNameProvider)
-
-
Method Detail
-
getTimeoutSeconds
final Integer getTimeoutSeconds()
-
setTimeoutSeconds
final Unit setTimeoutSeconds(Integer timeoutSeconds)
-
getScanExpiredAggregateIntervalMilliseconds
final Integer getScanExpiredAggregateIntervalMilliseconds()
-
setScanExpiredAggregateIntervalMilliseconds
final Unit setScanExpiredAggregateIntervalMilliseconds(Integer scanExpiredAggregateIntervalMilliseconds)
-
getAsync
<T extends AggregateRoot> CompletableFuture<T> getAsync(Object aggregateRootId, Class<T> aggregateRootType)
Get a strong type aggregate from memory cache.
-
getAsync
CompletableFuture<AggregateRoot> getAsync(Object aggregateRootId)
Get an aggregate from memory cache.
-
acceptAggregateRootChanges
<T extends AggregateRoot> Unit acceptAggregateRootChanges(T aggregateRoot)
Accept the given aggregate root's changes.
-
refreshAggregate
<T extends AggregateRoot> Unit refreshAggregate(T aggregateRoot)
Refresh the given aggregate.
-
refreshAggregateFromEventStoreAsync
CompletableFuture<AggregateRoot> refreshAggregateFromEventStoreAsync(String aggregateRootTypeName, String aggregateRootId)
Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
-
refreshAggregateFromEventStoreAsync
<T extends AggregateRoot> CompletableFuture<T> refreshAggregateFromEventStoreAsync(Class<T> aggregateRootType, String aggregateRootId)
Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
-
-
-
-