Class ClusterController
java.lang.Object
org.apache.activemq.artemis.core.server.cluster.ClusterController
- All Implemented Interfaces:
ActiveMQComponent
Used for creating and managing cluster control connections for each cluster connection and the replication connection
-
Constructor Summary
ConstructorsConstructorDescriptionClusterController(ActiveMQServer server, ScheduledExecutorService scheduledExecutor) ClusterController(ActiveMQServer server, ScheduledExecutorService scheduledExecutor, boolean useQuorumManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClusterChannelHandler(Channel channel, Acceptor acceptorUsed, CoreRemotingConnection remotingConnection, Activation activation) used to set a channel handler on the connection that can be used by the cluster controlvoidaddClusterConnection(SimpleString name, DiscoveryGroupConfiguration dg, ClusterConnectionConfiguration config, TransportConfiguration connector) add a locator for a cluster connection.voidaddClusterConnection(SimpleString name, TransportConfiguration[] tcConfigs, ClusterConnectionConfiguration config, TransportConfiguration connector) add a locator for a cluster connection.voidaddClusterTopologyListener(ClusterTopologyListener clusterTopologyListener) It addsclusterTopologyListenertodefaultLocator.voidvoidaddIncomingInterceptorForReplication(Interceptor interceptor) voidwait until we have connected to the cluster.connectToNode(TransportConfiguration transportConfiguration) connect to a specific node in the cluster used for replicationconnect to an already defined node in the clusterconnectToNodeInReplicatedCluster(TransportConfiguration transportConfiguration) connect to a specific node in the cluster used for replicationintFor tests onlylongretry interval for connecting to the clustergetServerLocator(SimpleString name) booleanvoidremoveClusterTopologyListener(ClusterTopologyListener clusterTopologyListener) It removeclusterTopologyListenerfromdefaultLocator.voidvoidremoveIncomingInterceptorForReplication(Interceptor interceptor) voidsetDefaultClusterConnectionName(SimpleString defaultClusterConnection) voidsetReplicatedClusterName(String replicatedClusterName) voidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Constructor Details
-
ClusterController
public ClusterController(ActiveMQServer server, ScheduledExecutorService scheduledExecutor, boolean useQuorumManager) -
ClusterController
-
-
Method Details
-
getDefaultLocator
For tests only -
start
- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
addClusterTopologyListener
It addsclusterTopologyListenertodefaultLocator. -
removeClusterTopologyListener
It removeclusterTopologyListenerfromdefaultLocator. -
stop
- Specified by:
stopin interfaceActiveMQComponent- Throws:
Exception
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceActiveMQComponent
-
getQuorumManager
-
setDefaultClusterConnectionName
-
addClusterConnection
public void addClusterConnection(SimpleString name, DiscoveryGroupConfiguration dg, ClusterConnectionConfiguration config, TransportConfiguration connector) add a locator for a cluster connection.- Parameters:
name- the cluster connection namedg- the discovery group to useconfig- the cluster connection configconnector- the cluster connector configuration
-
addClusterConnection
public void addClusterConnection(SimpleString name, TransportConfiguration[] tcConfigs, ClusterConnectionConfiguration config, TransportConfiguration connector) add a locator for a cluster connection.- Parameters:
name- the cluster connection nametcConfigs- the transport configurations to use
-
addClusterTopologyListenerForReplication
-
removeClusterTopologyListenerForReplication
-
addIncomingInterceptorForReplication
-
removeIncomingInterceptorForReplication
-
connectToNode
connect to a specific node in the cluster used for replication- Parameters:
transportConfiguration- the configuration of the node to connect to.- Returns:
- the Cluster Control
- Throws:
Exception
-
connectToNodeInReplicatedCluster
public ClusterControl connectToNodeInReplicatedCluster(TransportConfiguration transportConfiguration) throws Exception connect to a specific node in the cluster used for replication- Parameters:
transportConfiguration- the configuration of the node to connect to.- Returns:
- the Cluster Control
- Throws:
Exception
-
connectToNodeInCluster
connect to an already defined node in the cluster- Parameters:
sf- the session factory- Returns:
- the Cluster Control
-
getRetryIntervalForReplicatedCluster
public long getRetryIntervalForReplicatedCluster()retry interval for connecting to the cluster- Returns:
- the retry interval
-
awaitConnectionToReplicationCluster
wait until we have connected to the cluster.- Throws:
InterruptedException
-
addClusterChannelHandler
public void addClusterChannelHandler(Channel channel, Acceptor acceptorUsed, CoreRemotingConnection remotingConnection, Activation activation) used to set a channel handler on the connection that can be used by the cluster control- Parameters:
channel- the channel to set the handleracceptorUsed- the acceptor used for connectionremotingConnection- the connection itself
-
getDefaultClusterSize
public int getDefaultClusterSize() -
getDefaultClusterTopology
-
getNodeID
-
getIdentity
-
setReplicatedClusterName
-
getLocators
-
getReplicationLocator
-
getServerLocator
-