Class QuorumManager

    • Method Detail

      • start

        public void start()
                   throws Exception
        we start by simply creating the server locator and connecting in a separate thread
        Specified by:
        start in interface ActiveMQComponent
        Throws:
        Exception
      • registerQuorum

        public void registerQuorum​(Quorum quorum)
        registers a Quorum so that it can be notified of changes in the cluster.
        Parameters:
        quorum -
      • unRegisterQuorum

        public void unRegisterQuorum​(Quorum quorum)
        unregisters a Quorum.
        Parameters:
        quorum -
      • nodeUP

        public void nodeUP​(TopologyMember topologyMember,
                           boolean last)
        called by the ServerLocatorInternal when the topology changes. we update the maxClusterSize if needed and inform the Quorum's.
        Specified by:
        nodeUP in interface ClusterTopologyListener
        Parameters:
        topologyMember - the topolgy changed
        last - if the whole cluster topology is being transmitted (after adding the listener to the cluster connection) this parameter will be true for the last topology
      • nodeDown

        public void nodeDown​(long eventUID,
                             String nodeID)
        notify the Quorum of a topology change.
        Specified by:
        nodeDown in interface ClusterTopologyListener
        Parameters:
        eventUID -
        nodeID - the id of the node leaving the cluster
      • hasLive

        public boolean hasLive​(String nodeID,
                               int quorumSize,
                               int voteTimeout,
                               TimeUnit voteTimeoutUnit)
      • getMaxClusterSize

        public int getMaxClusterSize()
        returns the maximum size this cluster has been.
        Returns:
        max size
      • vote

        public void vote​(QuorumVote quorumVote)
        ask the quorum to vote within a specific quorum.
        Parameters:
        quorumVote - the vote to acquire
      • registerQuorumHandler

        public void registerQuorumHandler​(QuorumVoteHandler quorumVoteHandler)
        called to register vote handlers on the quorum
        Parameters:
        quorumVoteHandler - the vote handler
      • handleQuorumVote

        public void handleQuorumVote​(Channel clusterChannel,
                                     Packet packet)