Class 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
    • Method Detail

      • getDefaultLocator

        public ServerLocator getDefaultLocator()
        For tests only
      • addClusterTopologyListener

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

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

        public void setDefaultClusterConnectionName​(SimpleString defaultClusterConnection)
      • addClusterTopologyListenerForReplication

        public void addClusterTopologyListenerForReplication​(ClusterTopologyListener listener)
        add a cluster listener
        Parameters:
        listener -
      • removeClusterTopologyListenerForReplication

        public void removeClusterTopologyListenerForReplication​(ClusterTopologyListener listener)
        add a cluster listener
        Parameters:
        listener -
      • addIncomingInterceptorForReplication

        public void addIncomingInterceptorForReplication​(Interceptor interceptor)
        add an interceptor
        Parameters:
        interceptor -
      • removeIncomingInterceptorForReplication

        public void removeIncomingInterceptorForReplication​(Interceptor interceptor)
        remove an interceptor
        Parameters:
        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
      • 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
        activation -
      • getDefaultClusterSize

        public int getDefaultClusterSize()
      • getDefaultClusterTopology

        public Topology getDefaultClusterTopology()
      • getIdentity

        public String getIdentity()
      • setReplicatedClusterName

        public void setReplicatedClusterName​(String replicatedClusterName)
      • getReplicationLocator

        public ServerLocator getReplicationLocator()