public interface Configuration
Note that certain components in the Configuration may need to be started. Therefore, before using any of the
components provided by this configuration, ensure that start()
has been invoked.
Modifier and Type | Method and Description |
---|---|
default CommandBus |
commandBus()
Returns the Command Bus defined in this Configuration.
|
default CommandGateway |
commandGateway()
Returns the Command Gateway defined in this Configuration.
|
List<CorrelationDataProvider> |
correlationDataProviders()
Returns the Correlation Data Providers defined in this Configuration.
|
default EventBus |
eventBus()
Retrieves the Event Bus defined in this Configuration.
|
Serializer |
eventSerializer()
Returns the
Serializer defined in this Configuration which is used for serializing events and their
metadata. |
default EventStore |
eventStore()
Returns the Event Store in this Configuration, if it is defined.
|
default <T> T |
getComponent(Class<T> componentType)
Returns the Component declared under the given
componentType , typically the interface the component
implements. |
<T> T |
getComponent(Class<T> componentType,
Supplier<T> defaultImpl)
Returns the Component declared under the given
componentType , typically the interface the component
implements, reverting to the given defaultImpl if no such component is defined. |
List<ModuleConfiguration> |
getModules()
Returns all modules that have been registered with this Configuration.
|
<M extends Message<?>> |
messageMonitor(Class<?> componentType,
String componentName)
Returns the message monitor configured for a component of given
componentType and componentName . |
void |
onShutdown(Runnable shutdownHandler)
Registers a handler to be executed when the Configuration is shut down.
|
void |
onStart(Runnable startHandler)
Registers a handler to be executed when this Configuration is started.
|
default ParameterResolverFactory |
parameterResolverFactory()
Returns the Parameter Resolver Factory defined in this Configuration
|
default QueryBus |
queryBus() |
default QueryGateway |
queryGateway()
Returns the Query Gateway defined in this Configuration.
|
<T> Repository<T> |
repository(Class<T> aggregateType)
Returns the Repository configured for the given
aggregateType . |
default ResourceInjector |
resourceInjector()
Returns the ResourceInjector used to provide resources to Saga instances.
|
default Serializer |
serializer()
Returns the serializer defined in this Configuration
|
void |
shutdown()
Shuts down the components defined in this Configuration
|
void |
start()
Starts this configuration.
|
EventUpcasterChain |
upcasterChain()
Returns the EventUpcasterChain with all registered upcasters.
|
default EventBus eventBus()
default EventStore eventStore()
AxonConfigurationException
.default CommandBus commandBus()
start()
) before sending Commands over the Command Bus.default QueryBus queryBus()
default ResourceInjector resourceInjector()
default CommandGateway commandGateway()
start()
) before sending Commands using this Command Gateway.default QueryGateway queryGateway()
start()
) before sending Queries using this Query Gateway.<T> Repository<T> repository(Class<T> aggregateType)
aggregateType
.T
- The aggregate typeaggregateType
- The aggregate type to find the repository fordefault <T> T getComponent(Class<T> componentType)
componentType
, typically the interface the component
implements.T
- The type of componentcomponentType
- The type of componentnull
if no such component exists<T> T getComponent(Class<T> componentType, Supplier<T> defaultImpl)
componentType
, typically the interface the component
implements, reverting to the given defaultImpl
if no such component is defined.
When no component was previously registered, the default is then configured as the component for the given type.
T
- The type of componentcomponentType
- The type of componentdefaultImpl
- The supplier of the default to return if no component was registereddefaultImpl
supplier,
if no component was registered<M extends Message<?>> MessageMonitor<? super M> messageMonitor(Class<?> componentType, String componentName)
componentType
and componentName
.M
- The type of message the monitor can deal withcomponentType
- The type of component to return the monitor forcomponentName
- The name of the componentdefault Serializer serializer()
Serializer eventSerializer()
Serializer
defined in this Configuration which is used for serializing events and their
metadata.void start()
void shutdown()
List<CorrelationDataProvider> correlationDataProviders()
default ParameterResolverFactory parameterResolverFactory()
List<ModuleConfiguration> getModules()
void onStart(Runnable startHandler)
The behavior for handlers that are registered when the Configuration is already started is undefined.
startHandler
- The handler to execute when the configuration is startedstart()
,
onShutdown(Runnable)
void onShutdown(Runnable shutdownHandler)
The behavior for handlers that are registered when the Configuration is already shut down is undefined.
shutdownHandler
- The handler to execute when the Configuration is shut downshutdown()
,
onStart(Runnable)
EventUpcasterChain upcasterChain()
Copyright © 2010–2017. All rights reserved.