T - The type of aggregate generated by this aggregate factorypublic class SpringPrototypeAggregateFactory<T> extends Object implements org.axonframework.eventsourcing.AggregateFactory<T>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware
| Constructor and Description |
|---|
SpringPrototypeAggregateFactory(String prototypeBeanName)
Initializes the factory to create beans instances for the bean with given
prototypeBeanName. |
SpringPrototypeAggregateFactory(String prototypeBeanName,
Map<Class<? extends T>,String> subtypes)
Initializes the factory to create beans instances for the bean with given
prototypeBeanName and its
subtypes. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
T |
createAggregateRoot(String aggregateIdentifier,
org.axonframework.eventhandling.DomainEventMessage<?> firstEvent) |
Class<T> |
getAggregateType() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanName(String beanName) |
static <T> SpringPrototypeAggregateFactory<T> |
withSubtypeSupport(String prototypeBeanName,
Map<Class<? extends T>,String> subtypes)
Initializes the factory to create bean instances for the bean with given
prototypeBeanName and its
subtypes. |
public SpringPrototypeAggregateFactory(String prototypeBeanName)
prototypeBeanName.
Note that the bean should have the prototype scope.
prototypeBeanName - the name of the prototype bean this repository serves.public SpringPrototypeAggregateFactory(String prototypeBeanName, Map<Class<? extends T>,String> subtypes)
prototypeBeanName and its
subtypes.
Note that the bean should have the prototype scope.
prototypeBeanName - the name of the prototype bean this repository serves.subtypes - the map of subtype of this aggregate to its spring prototype namepublic static <T> SpringPrototypeAggregateFactory<T> withSubtypeSupport(String prototypeBeanName, Map<Class<? extends T>,String> subtypes)
prototypeBeanName and its
subtypes.
Note that the bean should have the prototype scope.
This static factory method is provided as an alternative to avoid warnings and errors on ambiguous constructor resolution when using Spring AOT.
prototypeBeanName - The name of the prototype bean this repository serves.subtypes - The map of subtype of this aggregate to its spring prototype name.public T createAggregateRoot(String aggregateIdentifier, org.axonframework.eventhandling.DomainEventMessage<?> firstEvent)
createAggregateRoot in interface org.axonframework.eventsourcing.AggregateFactory<T>public Class<T> getAggregateType()
getAggregateType in interface org.axonframework.eventsourcing.AggregateFactory<T>public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void setBeanName(@Nonnull String beanName)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanCopyright © 2010–2023. All rights reserved.