|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.commandhandling.gateway.CommandGatewayFactoryBean<T>
T
- The type of gateway to be created by this factory bean. Note that the correct interface must also be set
using setGatewayInterface(Class)
. Failure to do so may result in class cast exceptions.public class CommandGatewayFactoryBean<T>
FactoryBean that creates a gateway instance for any given (compatible) interface. If no explicit interface is
provided, the CommandGateway
interface is assumed.
GatewayProxyFactory
.
GatewayProxyFactory
Constructor Summary | |
---|---|
CommandGatewayFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
T |
getObject()
|
Class<?> |
getObjectType()
|
boolean |
isSingleton()
|
void |
setCommandBus(CommandBus commandBus)
Sets the command bus on which the Gateway must dispatch commands. |
void |
setCommandCallbacks(List<CommandCallback<?>> commandCallbacks)
Registers the commandCallbacks , which are invoked for each sent command, unless Axon is able to detect
that the result of the command does not match the type accepted by that callback. |
void |
setCommandDispatchInterceptors(CommandDispatchInterceptor... commandDispatchInterceptors)
Sets the interceptors that should be invoked before a command is dispatched the the Command Bus. |
void |
setCommandDispatchInterceptors(List<CommandDispatchInterceptor> commandDispatchInterceptors)
Sets the interceptors that should be invoked before a command is dispatched the the Command Bus. |
void |
setGatewayInterface(Class<T> gatewayInterface)
Sets the interface that describes the gateway instance to describe. |
void |
setRetryScheduler(RetryScheduler retryScheduler)
Sets the RetryScheduler that will be invoked when a command fails execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandGatewayFactoryBean()
Method Detail |
---|
public T getObject() throws Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<T>
Exception
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<T>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<T>
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void setCommandBus(CommandBus commandBus)
commandBus
- the command bus on which the Gateway must dispatch commandspublic void setRetryScheduler(RetryScheduler retryScheduler)
retryScheduler
- the RetryScheduler that will be invoked when a command fails executionpublic void setGatewayInterface(Class<T> gatewayInterface)
CommandGateway
.
gatewayInterface
- The interface describing the gateway
IllegalArgumentException
- if the given gatewayInterface
is null
or not an
interface.public void setCommandDispatchInterceptors(CommandDispatchInterceptor... commandDispatchInterceptors)
commandDispatchInterceptors
- the interceptors that should be invoked before a command is dispatched the
the
Command Buspublic void setCommandDispatchInterceptors(List<CommandDispatchInterceptor> commandDispatchInterceptors)
commandDispatchInterceptors
- the interceptors that should be invoked before a command is dispatched the
the
Command Buspublic void setCommandCallbacks(List<CommandCallback<?>> commandCallbacks)
commandCallbacks
, which are invoked for each sent command, unless Axon is able to detect
that the result of the command does not match the type accepted by that callback.
Axon will check the signature of the onSuccess() method and only invoke the callback if the actual result of the
command is an instance of that type. If Axon is unable to detect the type, the callback is always invoked,
potentially causing ClassCastException
.
commandCallbacks
- The callbacks to register
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |