public static class EmbeddedEventStore.Builder extends AbstractEventStore.Builder
EmbeddedEventStore.
The following configurable fields have defaults:
MessageMonitor is defaulted to a NoOpMessageMonitor.cachedEvents is defaulted to 10000.fetchDelay is defaulted to 1000.cleanupDelay is defaulted to 10000.TimeUnit is defaulted to TimeUnit.MILLISECONDS.ThreadFactory is defaulted to AxonThreadFactory with ThreadGroup EmbeddedEventStore.THREAD_GROUP.EventStorageEngine is a hard requirement and as such should be provided.storageEngine| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
EmbeddedEventStore |
build()
Initializes a
EmbeddedEventStore as specified through this Builder. |
EmbeddedEventStore.Builder |
cachedEvents(int cachedEvents)
Sets the maximum number of events in the cache that is shared between the streams of tracking event
processors.
|
EmbeddedEventStore.Builder |
cleanupDelay(long cleanupDelay)
Sets the delay between two clean ups of lagging event processors.
|
EmbeddedEventStore.Builder |
fetchDelay(long fetchDelay)
Sets the time to wait before fetching new events from the backing storage engine while tracking after a
previous stream was fetched and read.
|
EmbeddedEventStore.Builder |
messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor)
Sets the
MessageMonitor to monitor ingested EventMessages. |
EmbeddedEventStore.Builder |
storageEngine(EventStorageEngine storageEngine)
Sets the
EventStorageEngine used to store and load events. |
EmbeddedEventStore.Builder |
threadFactory(ThreadFactory threadFactory)
Sets the
ThreadFactory used to create threads for consuming, producing and cleaning up. |
EmbeddedEventStore.Builder |
timeUnit(TimeUnit timeUnit)
|
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public EmbeddedEventStore.Builder storageEngine(EventStorageEngine storageEngine)
AbstractEventStore.BuilderEventStorageEngine used to store and load events.storageEngine in class AbstractEventStore.BuilderstorageEngine - the EventStorageEngine used to store and load eventspublic EmbeddedEventStore.Builder messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor)
AbstractEventBus.BuildermessageMonitor in class AbstractEventStore.BuildermessageMonitor - a MessageMonitor to monitor ingested EventMessagespublic EmbeddedEventStore.Builder cachedEvents(int cachedEvents)
10000.cachedEvents - an int specifying the maximum number of events in the cache that is shared
between the streams of tracking event processorspublic EmbeddedEventStore.Builder fetchDelay(long fetchDelay)
Defaults to 1000. Together with the timeUnit, this will define the exact fetch delay.
fetchDelay - a long specifying the time to wait before fetching new events from the backing
storage engine while tracking after a previous stream was fetched and readpublic EmbeddedEventStore.Builder cleanupDelay(long cleanupDelay)
Defaults to 1000. Together with the timeUnit, this will define the exact clean up
delay.
cleanupDelay - a long specifying the delay between two clean ups of lagging event processorspublic EmbeddedEventStore.Builder timeUnit(TimeUnit timeUnit)
timeUnit - the TimeUnit for the fetchDelay and cleanupDelaypublic EmbeddedEventStore.Builder threadFactory(ThreadFactory threadFactory)
ThreadFactory used to create threads for consuming, producing and cleaning up. Defaults to
a AxonThreadFactory with ThreadGroup EmbeddedEventStore.THREAD_GROUP.threadFactory - a ThreadFactory used to create threads for consuming, producing and cleaning uppublic EmbeddedEventStore build()
EmbeddedEventStore as specified through this Builder.EmbeddedEventStore as specified through this Builderprotected void validate()
throws AxonConfigurationException
validate in class AbstractEventStore.BuilderAxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2018. All rights reserved.