Class MembershipManager
- java.lang.Object
-
- org.apache.axis2.clustering.tribes.MembershipManager
-
public class MembershipManager extends Object
Responsible for managing the membership. Handles membership changes.
-
-
Constructor Summary
Constructors Constructor Description MembershipManager()
MembershipManager(ConfigurationContext configContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWellKnownMember(org.apache.catalina.tribes.Member wkaMember)
byte[]
getDomain()
org.apache.catalina.tribes.Member
getLocalMember()
org.apache.catalina.tribes.Member
getLongestLivingMember()
Get the member that has been alive for the longest timeorg.apache.catalina.tribes.Member
getMember(org.apache.catalina.tribes.Member member)
Get a memberorg.apache.catalina.tribes.Member[]
getMembers()
Get the list of current membersorg.apache.catalina.tribes.Member
getRandomMember()
Get a random member from the list of current membersorg.apache.catalina.tribes.group.RpcChannel
getRpcMembershipChannel()
boolean
hasMembers()
Check whether there are any membersboolean
memberAdded(org.apache.catalina.tribes.Member member)
A new member is addedvoid
memberDisappeared(org.apache.catalina.tribes.Member member)
A member disappearedvoid
removeWellKnownMember(org.apache.catalina.tribes.Member wkaMember)
void
sendMemberJoinedToAll(org.apache.catalina.tribes.Member member)
Inform all members that a particular member just joinedvoid
sendMemberList(org.apache.catalina.tribes.Member member)
Send the list of members to themember
void
setDomain(byte[] domain)
void
setGroupManagementAgent(GroupManagementAgent groupManagementAgent)
void
setLocalMember(org.apache.catalina.tribes.Member localMember)
void
setRpcMembershipChannel(org.apache.catalina.tribes.group.RpcChannel rpcMembershipChannel)
void
setupStaticMembershipManagement(org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor staticMembershipInterceptor)
-
-
-
Constructor Detail
-
MembershipManager
public MembershipManager(ConfigurationContext configContext)
-
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 themember
- 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
-
-