public class CommandHandlerInvoker extends Object implements com.lmax.disruptor.EventHandler<CommandHandlingEntry>, com.lmax.disruptor.LifecycleAware
Constructor and Description |
---|
CommandHandlerInvoker(Cache cache,
int segmentId)
Create an aggregate invoker instance for the given
segment and cache . |
Modifier and Type | Method and Description |
---|---|
<T> Repository<T> |
createRepository(EventStore eventStore,
AggregateFactory<T> aggregateFactory,
SnapshotTriggerDefinition snapshotTriggerDefinition,
ParameterResolverFactory parameterResolverFactory)
Create a repository instance for an aggregate created by the given
aggregateFactory . |
<T> Repository<T> |
createRepository(EventStore eventStore,
RepositoryProvider repositoryProvider,
AggregateFactory<T> aggregateFactory,
SnapshotTriggerDefinition snapshotTriggerDefinition,
ParameterResolverFactory parameterResolverFactory,
HandlerDefinition handlerDefinition)
Create a repository instance for an aggregate created by the given
aggregateFactory . |
static <T> org.axonframework.disruptor.commandhandling.CommandHandlerInvoker.DisruptorRepository<T> |
getRepository(Class<?> type)
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(Cache cache, int segmentId)
segment
and cache
.cache
- The cache temporarily storing aggregate instancessegmentId
- The id of the segment this invoker should handlepublic static <T> org.axonframework.disruptor.commandhandling.CommandHandlerInvoker.DisruptorRepository<T> getRepository(Class<?> type)
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 aggregatetype
- The type of aggregatepublic void onEvent(CommandHandlingEntry entry, long sequence, boolean endOfBatch)
onEvent
in interface com.lmax.disruptor.EventHandler<CommandHandlingEntry>
public <T> Repository<T> createRepository(EventStore eventStore, AggregateFactory<T> aggregateFactory, SnapshotTriggerDefinition snapshotTriggerDefinition, ParameterResolverFactory parameterResolverFactory)
aggregateFactory
. The returning
repository must be safe to use by this invoker instance.T
- The type of aggregate created by the factoryeventStore
- The events store to load and publish eventsaggregateFactory
- The factory creating aggregate instancessnapshotTriggerDefinition
- The trigger definition for snapshotsparameterResolverFactory
- The factory used to resolve parameters on command handler methodspublic <T> Repository<T> createRepository(EventStore eventStore, RepositoryProvider repositoryProvider, AggregateFactory<T> aggregateFactory, SnapshotTriggerDefinition snapshotTriggerDefinition, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition)
aggregateFactory
. The returning
repository must be safe to use by this invoker instance.T
- The type of aggregate created by the factoryeventStore
- The events store to load and publish eventsrepositoryProvider
- Provides repositories for specified aggregate typesaggregateFactory
- The factory creating aggregate instancessnapshotTriggerDefinition
- The trigger definition for snapshotsparameterResolverFactory
- The factory used to resolve parameters on command handler methodshandlerDefinition
- The handler definition used to create concrete handlerspublic void onStart()
onStart
in interface com.lmax.disruptor.LifecycleAware
public void onShutdown()
onShutdown
in interface com.lmax.disruptor.LifecycleAware
Copyright © 2010–2018. All rights reserved.