Class MembershipManager


  • public class MembershipManager
    extends Object
    Responsible for managing the membership. Handles membership changes.
    • Constructor Detail

      • MembershipManager

        public MembershipManager()
    • Method Detail

      • setRpcMembershipChannel

        public void setRpcMembershipChannel​(org.apache.catalina.tribes.group.RpcChannel rpcMembershipChannel)
      • getRpcMembershipChannel

        public org.apache.catalina.tribes.group.RpcChannel getRpcMembershipChannel()
      • setupStaticMembershipManagement

        public void setupStaticMembershipManagement​(org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor staticMembershipInterceptor)
      • setGroupManagementAgent

        public void setGroupManagementAgent​(GroupManagementAgent groupManagementAgent)
      • setDomain

        public void setDomain​(byte[] domain)
      • getDomain

        public byte[] getDomain()
      • getLocalMember

        public org.apache.catalina.tribes.Member getLocalMember()
      • setLocalMember

        public void setLocalMember​(org.apache.catalina.tribes.Member localMember)
      • addWellKnownMember

        public void addWellKnownMember​(org.apache.catalina.tribes.Member wkaMember)
      • removeWellKnownMember

        public void removeWellKnownMember​(org.apache.catalina.tribes.Member wkaMember)
      • memberAdded

        public boolean memberAdded​(org.apache.catalina.tribes.Member member)
        A new member is added
        Parameters:
        member - The new member that joined the cluster
        Returns:
        true If the member was added to the members array; false, otherwise.
      • sendMemberList

        public void sendMemberList​(org.apache.catalina.tribes.Member member)
        Send the list of members to the member
        Parameters:
        member - The member to whom the member list has to be sent
      • sendMemberJoinedToAll

        public void sendMemberJoinedToAll​(org.apache.catalina.tribes.Member member)
        Inform all members that a particular member just joined
        Parameters:
        member - The member who just joined
      • memberDisappeared

        public void memberDisappeared​(org.apache.catalina.tribes.Member member)
        A member disappeared
        Parameters:
        member - The member that left the cluster
      • getMembers

        public org.apache.catalina.tribes.Member[] getMembers()
        Get the list of current members
        Returns:
        list of current members
      • getLongestLivingMember

        public org.apache.catalina.tribes.Member getLongestLivingMember()
        Get the member that has been alive for the longest time
        Returns:
        The member that has been alive for the longest time
      • getRandomMember

        public org.apache.catalina.tribes.Member getRandomMember()
        Get a random member from the list of current members
        Returns:
        A random member from the list of current members
      • hasMembers

        public boolean hasMembers()
        Check whether there are any members
        Returns:
        true if there are other members, false otherwise
      • getMember

        public org.apache.catalina.tribes.Member getMember​(org.apache.catalina.tribes.Member member)
        Get a member
        Parameters:
        member - The member to be found
        Returns:
        The member, if it is found