|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.commandhandling.distributed.jgroups.JGroupsConnectorFactoryBean
public class JGroupsConnectorFactoryBean
Spring Factory bean that creates a JGroupsConnector and starts it when the application context is started. This bean must be defined as a top-level bean.
Constructor Summary | |
---|---|
JGroupsConnectorFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
Object |
getObject()
|
Class<?> |
getObjectType()
|
int |
getPhase()
|
boolean |
isAutoStartup()
|
boolean |
isRunning()
|
boolean |
isSingleton()
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setBeanName(String name)
|
void |
setChannelName(String channelName)
Optionally sets the logical channel name of the channel. |
void |
setClusterName(String clusterName)
Sets the name of the cluster to subscribe to. |
void |
setConfiguration(String configuration)
Sets the JGroups configuration file to load. |
void |
setHashChangeListener(HashChangeListener hashChangeListener)
Register a HashChangeListener with the JGroupsConnector . |
void |
setInterceptors(List<CommandHandlerInterceptor> interceptors)
Sets the interceptor to use in the default local segment (a SimpleCommandBus). |
void |
setJoinTimeout(long joinTimeout)
Sets the number of milliseconds to wait for this member to join the group. |
void |
setLoadFactor(int loadFactor)
Sets the load factor for this instance of the Distributed Command Bus. |
void |
setLocalSegment(CommandBus localSegment)
Sets the CommandBus instance on which local commands must be dispatched. |
void |
setPhase(int phase)
Sets the phase in which this bean must be started. |
void |
setSerializer(Serializer serializer)
Sets the serializer used to serialize events before they are dispatched to the destination. |
void |
start()
|
void |
stop()
|
void |
stop(Runnable callback)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JGroupsConnectorFactoryBean()
Method Detail |
---|
public Object getObject() throws Exception
getObject
in interface org.springframework.beans.factory.FactoryBean
Exception
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void setSerializer(Serializer serializer)
serializer
- the serializer to serialize commands withpublic void setConfiguration(String configuration)
configuration
- the JGroups configuration filepublic void setClusterName(String clusterName)
clusterName
- The name of the cluster to connect topublic void setChannelName(String channelName)
channelName
- The logical name to give to the channelpublic void setJoinTimeout(long joinTimeout)
start()
method to wait until the member joined the cluster.
Defaults to -1, which causes the start()
to wait indefinitely, until the member has joined the cluster.
joinTimeout
- The number of milliseconds to wait for the member to join the clusterpublic void setLocalSegment(CommandBus localSegment)
localSegment
- the CommandBus instance to dispatch local messages onpublic void setInterceptors(List<CommandHandlerInterceptor> interceptors)
setLocalSegment(org.axonframework.commandhandling.CommandBus)
), this configuration is ignored.
interceptors
- the list of interceptors (in order) for the local segmentpublic void setLoadFactor(int loadFactor)
loadFactor
- The load factor for this instancepublic void setHashChangeListener(HashChangeListener hashChangeListener)
HashChangeListener
with the JGroupsConnector
. The listener
will be notified when the consistent hash changes due to members joining or leaving the
JGroup.
hashChangeListener
- public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public void setPhase(int phase)
Integer.MAX_VALUE
, which ensures the
Connector is started when other beans have been initialized.
phase
- the phase in which the JGroups connector must be started.SmartLifecycle
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |