| |
|
| java.lang.Object org.apache.catalina.tribes.membership.McastService
McastService | public class McastService implements MembershipService,MembershipListener(Code) | | A membership implementation using simple multicast.
This is the representation of a multicast membership service.
This class is responsible for maintaining a list of active cluster nodes in the cluster.
If a node fails to send out a heartbeat, the node will be dismissed.
author: Filip Hanik version: $Revision: 522651 $, $Date: 2007-03-27 00:24:32 +0200 (mar., 27 mars 2007) $ |
Constructor Summary | |
public | McastService() Create a membership service. |
EMPTY_MEMBERS | final protected static Member[] EMPTY_MEMBERS(Code) | | Return all the members
|
domain | protected byte[] domain(Code) | | |
payload | protected byte[] payload(Code) | | |
properties | protected Properties properties(Code) | | The implementation specific properties
|
McastService | public McastService()(Code) | | Create a membership service.
|
findMemberByName | public Member findMemberByName(String name)(Code) | | Return the member by name
|
getDomain | public byte[] getDomain()(Code) | | |
getDropTime | public long getDropTime()(Code) | | |
getFrequency | public long getFrequency()(Code) | | |
getInfo | public String getInfo()(Code) | | Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> .
|
getLocalMember | public Member getLocalMember(boolean alive)(Code) | | Return the local member
|
getLocalMemberName | public String getLocalMemberName()(Code) | | Return the local member name
|
getMcastBindAddress | public String getMcastBindAddress()(Code) | | String |
getMcastDropTime | public long getMcastDropTime()(Code) | | long |
getMcastFrequency | public long getMcastFrequency()(Code) | | long |
getMcastPort | public int getMcastPort()(Code) | | int |
getMcastSoTimeout | public int getMcastSoTimeout()(Code) | | int |
getMcastTTL | public int getMcastTTL()(Code) | | int |
getMembersByName | public String[] getMembersByName()(Code) | | Return all the members by name
|
getPayload | public byte[] getPayload()(Code) | | |
getPort | public int getPort()(Code) | | |
getProperties | public Properties getProperties()(Code) | | Return the properties, see setProperties
|
getSoTimeout | public int getSoTimeout()(Code) | | |
getTtl | public int getTtl()(Code) | | |
hasMembers | public boolean hasMembers()(Code) | | has members?
|
hasProperty | protected void hasProperty(Properties properties, String name)(Code) | | Check if a required property is available.
Parameters: properties - The set of properties Parameters: name - The property to check for |
main | public static void main(String args) throws Exception(Code) | | Simple test program
Parameters: args - Command-line arguments throws: Exception - If an error occurs |
memberDisappeared | public void memberDisappeared(Member member)(Code) | | Callback from the impl when a new member has been received
Parameters: member - The member |
removeMembershipListener | public void removeMembershipListener()(Code) | | Remove the membership listener
|
setDomain | public void setDomain(byte[] domain)(Code) | | |
setDropTime | public void setDropTime(long time)(Code) | | |
setFrequency | public void setFrequency(long time)(Code) | | |
setLocalMemberProperties | public void setLocalMemberProperties(String listenHost, int listenPort)(Code) | | Sets the local member properties for broadcasting
|
setMcastAddr | public void setMcastAddr(String addr)(Code) | | Parameters: addr - String |
setMcastBindAddress | public void setMcastBindAddress(String bindaddr)(Code) | | |
setMcastDropTime | public void setMcastDropTime(long time)(Code) | | |
setMcastFrequency | public void setMcastFrequency(long time)(Code) | | Parameters: time - long |
setMcastPort | public void setMcastPort(int port)(Code) | | Parameters: port - int |
setMcastSoTimeout | public void setMcastSoTimeout(int mcastSoTimeout)(Code) | | Parameters: mcastSoTimeout - int |
setMcastTTL | public void setMcastTTL(int mcastTTL)(Code) | | Parameters: mcastTTL - int |
setMembershipListener | public void setMembershipListener(MembershipListener listener)(Code) | | Add a membership listener, this version only supports one listener per service,
so calling this method twice will result in only the second listener being active.
Parameters: listener - The listener |
setPayload | public void setPayload(byte[] payload)(Code) | | |
setPort | public void setPort(int port)(Code) | | |
setProperties | public void setProperties(Properties properties)(Code) | | Parameters: properties - All are required 1. mcastPort - the port to listen to 2. mcastAddress - the mcast group address 4. bindAddress - the bind address if any - only one that can be null 5. memberDropTime - the time a member is gone before it is considered gone. 6. mcastFrequency - the frequency of sending messages 7. tcpListenPort - the port this member listens to 8. tcpListenHost - the bind address of this member
exception: java.lang.IllegalArgumentException - if a property is missing. |
setSoTimeout | public void setSoTimeout(int mcastSoTimeout)(Code) | | |
setTtl | public void setTtl(int mcastTTL)(Code) | | |
stop | public void stop(int svc)(Code) | | Stop broadcasting and listening to membership pings
|
|
|
|