org.axonframework.commandhandling.annotation
Class AggregateAnnotationCommandHandlerFactoryBean<T extends AggregateRoot<?>>

java.lang.Object
  extended by org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean<T>
Type Parameters:
T - The aggregate type on which command handlers are declared.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<AggregateAnnotationCommandHandler<T>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class AggregateAnnotationCommandHandlerFactoryBean<T extends AggregateRoot<?>>
extends Object
implements org.springframework.beans.factory.FactoryBean<AggregateAnnotationCommandHandler<T>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

Spring FactoryBean that creates an AggregateAnnotationCommandHandler instance.

Since:
2.1
Author:
Allard Buijze

Constructor Summary
AggregateAnnotationCommandHandlerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 AggregateAnnotationCommandHandler<T> getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setAggregateType(Class<T> aggregateType)
          Sets the type of aggregate to inspect for annotations.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setCommandBus(CommandBus commandBus)
          Sets the CommandBus to subscribe the handler to
 void setCommandTargetResolver(CommandTargetResolver commandTargetResolver)
          The resolver providing the identifier (and version) of the aggregate a command targets.
 void setParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
          Sets the ParameterResolverFactory to create parameter resolver instances with.
 void setRepository(Repository<T> repository)
          The repository from which to load aggregate instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateAnnotationCommandHandlerFactoryBean

public AggregateAnnotationCommandHandlerFactoryBean()
Method Detail

getObject

public AggregateAnnotationCommandHandler<T> getObject()
                                                                        throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<AggregateAnnotationCommandHandler<T extends AggregateRoot<?>>>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<AggregateAnnotationCommandHandler<T extends AggregateRoot<?>>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<AggregateAnnotationCommandHandler<T extends AggregateRoot<?>>>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

setCommandBus

public void setCommandBus(CommandBus commandBus)
Sets the CommandBus to subscribe the handler to

Parameters:
commandBus - the CommandBus to subscribe the handler to

setAggregateType

public void setAggregateType(Class<T> aggregateType)
Sets the type of aggregate to inspect for annotations.

Parameters:
aggregateType - the type of aggregate to inspect for annotations

setRepository

public void setRepository(Repository<T> repository)
The repository from which to load aggregate instances. The repository must be compatible with the aggregate type provided.

Parameters:
repository - the Repository from which to load aggregate instances.

setCommandTargetResolver

public void setCommandTargetResolver(CommandTargetResolver commandTargetResolver)
The resolver providing the identifier (and version) of the aggregate a command targets. Defaults to an AnnotationCommandTargetResolver.

Parameters:
commandTargetResolver - The CommandTargetResolver to resolve the target aggregate with

setParameterResolverFactory

public void setParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the ParameterResolverFactory to create parameter resolver instances with. Defaults to a ClasspathParameterResolverFactory that uses the aggregateType's class loader.

Parameters:
parameterResolverFactory - the ParameterResolverFactory to create parameter resolver instances with.

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2010-2016. All Rights Reserved.