public class CommandHandlerInvoker extends Object implements com.lmax.disruptor.EventHandler<CommandHandlingEntry>, com.lmax.disruptor.LifecycleAware
Constructor and Description |
---|
CommandHandlerInvoker(EventStore eventStore,
Cache cache,
int segmentId)
Create an aggregate invoker instance that uses the given
eventStore and cache to
retrieve aggregate instances. |
Modifier and Type | Method and Description |
---|---|
<T extends EventSourcedAggregateRoot> |
createRepository(AggregateFactory<T> aggregateFactory,
EventStreamDecorator decorator)
Create a repository instance for an aggregate created by the given
aggregateFactory . |
static <T extends EventSourcedAggregateRoot> |
getRepository(String typeIdentifier)
Returns the Repository instance for Aggregate with given
typeIdentifier used by the
CommandHandlerInvoker that is running on the current thread. |
void |
onEvent(CommandHandlingEntry entry,
long sequence,
boolean endOfBatch) |
void |
onShutdown() |
void |
onStart() |
public CommandHandlerInvoker(EventStore eventStore, Cache cache, int segmentId)
eventStore
and cache
to
retrieve aggregate instances.eventStore
- The event store providing access to events to reconstruct aggregatescache
- The cache temporarily storing aggregate instancessegmentId
- The id of the segment this invoker should handlepublic static <T extends EventSourcedAggregateRoot> org.axonframework.commandhandling.disruptor.CommandHandlerInvoker.DisruptorRepository<T> getRepository(String typeIdentifier)
typeIdentifier
used by the
CommandHandlerInvoker that is running on the current thread.
Calling this method from any other thread will return null
.T
- The type of aggregatetypeIdentifier
- The type identifier of the aggregatepublic void onEvent(CommandHandlingEntry entry, long sequence, boolean endOfBatch) throws Exception
onEvent
in interface com.lmax.disruptor.EventHandler<CommandHandlingEntry>
Exception
public <T extends EventSourcedAggregateRoot> Repository<T> createRepository(AggregateFactory<T> aggregateFactory, EventStreamDecorator decorator)
aggregateFactory
. The returning
repository must be sage to use by this invoker instance.T
- The type of aggregate created by the factoryaggregateFactory
- The factory creating aggregate instancesdecorator
- The decorator to decorate event streams withpublic void onStart()
onStart
in interface com.lmax.disruptor.LifecycleAware
public void onShutdown()
onShutdown
in interface com.lmax.disruptor.LifecycleAware
Copyright © 2010-2014. All Rights Reserved.