Class ClusterController

java.lang.Object
org.apache.activemq.artemis.core.server.cluster.ClusterController
All Implemented Interfaces:
ActiveMQComponent

public class ClusterController extends Object implements ActiveMQComponent
Used for creating and managing cluster control connections for each cluster connection and the replication connection
  • Constructor Details

  • Method Details

    • getDefaultLocator

      public ServerLocator getDefaultLocator()
      For tests only
    • start

      public void start() throws Exception
      Specified by:
      start in interface ActiveMQComponent
      Throws:
      Exception
    • addClusterTopologyListener

      public void addClusterTopologyListener(ClusterTopologyListener clusterTopologyListener)
      It adds clusterTopologyListener to defaultLocator.
    • removeClusterTopologyListener

      public void removeClusterTopologyListener(ClusterTopologyListener clusterTopologyListener)
      It remove clusterTopologyListener from defaultLocator.
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface ActiveMQComponent
      Throws:
      Exception
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface ActiveMQComponent
    • getQuorumManager

      public QuorumManager getQuorumManager()
    • setDefaultClusterConnectionName

      public void setDefaultClusterConnectionName(SimpleString defaultClusterConnection)
    • addClusterConnection

      public void addClusterConnection(SimpleString name, DiscoveryGroupConfiguration dg, ClusterConnectionConfiguration config, TransportConfiguration connector)
      add a locator for a cluster connection.
      Parameters:
      name - the cluster connection name
      dg - the discovery group to use
      config - the cluster connection config
      connector - 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 name
      tcConfigs - the transport configurations to use
    • addClusterTopologyListenerForReplication

      public void addClusterTopologyListenerForReplication(ClusterTopologyListener listener)
    • removeClusterTopologyListenerForReplication

      public void removeClusterTopologyListenerForReplication(ClusterTopologyListener listener)
    • addIncomingInterceptorForReplication

      public void addIncomingInterceptorForReplication(Interceptor interceptor)
    • removeIncomingInterceptorForReplication

      public void removeIncomingInterceptorForReplication(Interceptor interceptor)
    • connectToNode

      public ClusterControl connectToNode(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
    • 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

      public ClusterControl connectToNodeInCluster(ClientSessionFactoryInternal sf)
      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

      public void awaitConnectionToReplicationCluster() throws InterruptedException
      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 handler
      acceptorUsed - the acceptor used for connection
      remotingConnection - the connection itself
    • getDefaultClusterSize

      public int getDefaultClusterSize()
    • getDefaultClusterTopology

      public Topology getDefaultClusterTopology()
    • getNodeID

      public SimpleString getNodeID()
    • getIdentity

      public String getIdentity()
    • setReplicatedClusterName

      public void setReplicatedClusterName(String replicatedClusterName)
    • getLocators

      public Map<SimpleString,ServerLocatorInternal> getLocators()
    • getReplicationLocator

      public ServerLocator getReplicationLocator()
    • getServerLocator

      public ServerLocator getServerLocator(SimpleString name)