public final class InMemoryStorageFactory extends java.lang.Object implements StorageFactory
Modifier and Type | Method and Description |
---|---|
void |
close() |
<I> AggregateStorage<I> |
createAggregateStorage(ContextSpec context,
java.lang.Class<? extends Aggregate<I,?,?>> unused)
NOTE: the parameter is unused.
|
CatchUpStorage |
createCatchUpStorage(boolean multitenant)
Creates a new
CatchUpStorage . |
InboxStorage |
createInboxStorage(boolean multitenant)
Creates a new
InboxStorage . |
<I> ProjectionStorage<I> |
createProjectionStorage(ContextSpec context,
java.lang.Class<? extends Projection<I,?,?>> projectionClass)
Creates a new
ProjectionStorage . |
<I> RecordStorage<I> |
createRecordStorage(ContextSpec context,
java.lang.Class<? extends Entity<I,?>> entityClass)
Creates a new
RecordStorage . |
static InMemoryStorageFactory |
newInstance()
Creates new instance of the factory which would serve the specified context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createEventStore
public static InMemoryStorageFactory newInstance()
public <I> AggregateStorage<I> createAggregateStorage(ContextSpec context, java.lang.Class<? extends Aggregate<I,?,?>> unused)
createAggregateStorage
in interface StorageFactory
I
- the type of aggregate IDscontext
- specification of the Bounded Context AggregateRepository
of which
requests the creation of the storageunused
- the class of Aggregate
s to be storedpublic <I> RecordStorage<I> createRecordStorage(ContextSpec context, java.lang.Class<? extends Entity<I,?>> entityClass)
StorageFactory
RecordStorage
.createRecordStorage
in interface StorageFactory
I
- the type of entity IDscontext
- specification of the Bounded Context RecordBasedRepository
of which
requests the creation of the storageentityClass
- the class of entities to be storedpublic <I> ProjectionStorage<I> createProjectionStorage(ContextSpec context, java.lang.Class<? extends Projection<I,?,?>> projectionClass)
StorageFactory
ProjectionStorage
.createProjectionStorage
in interface StorageFactory
I
- the type of stream projection IDscontext
- specification of the Bounded Context ProjectionRepository
of which
requests the creation of the storageprojectionClass
- the class of Projection
s to be storedpublic InboxStorage createInboxStorage(boolean multitenant)
StorageFactory
InboxStorage
.
The instance of InboxStorage
is used in the Delivery
operations. Therefore there is typically just
a single instance of InboxStorage
per ServerEnvironment
instance, unlike other Storage
types which instances are created
per-BoundedContext
.
createInboxStorage
in interface StorageFactory
multitenant
- whether the created storage should be multi-tenantpublic CatchUpStorage createCatchUpStorage(boolean multitenant)
StorageFactory
CatchUpStorage
.
Similar to InboxStorage
, this type of storage is also used in the Delivery
routines. So by default there is a single
instance of CatchUpStorage
per ServerEnvironment
.
createCatchUpStorage
in interface StorageFactory
multitenant
- whether the created storage should be multi-tenantpublic void close()
close
in interface java.lang.AutoCloseable