| |
|
| java.lang.Object org.apache.catalina.cluster.mcast.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: 1.11 $, $Date: 2004/05/26 16:36:03 $ |
Constructor Summary | |
public | McastService() Create a membership service. |
properties | protected Properties properties(Code) | | The implementation specific properties
|
McastService | public McastService()(Code) | | Create a membership service.
|
addMembershipListener | public void addMembershipListener(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 |
getLocalMember | public Member getLocalMember()(Code) | | Return the local member
|
getMcastSoTimeout | public int getMcastSoTimeout()(Code) | | |
getMcastTTL | public int getMcastTTL()(Code) | | |
getMembers | public Member[] getMembers()(Code) | | Return all the members
|
getProperties | public Properties getProperties()(Code) | | Return the properties, see setProperties
|
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
|
setLocalMemberProperties | public void setLocalMemberProperties(String listenHost, int listenPort)(Code) | | Sets the local member properties for broadcasting
|
setMcastBindAddress | public void setMcastBindAddress(String bindaddr)(Code) | | |
setMcastDropTime | public void setMcastDropTime(long time)(Code) | | |
setMcastFrequency | public void setMcastFrequency(long time)(Code) | | |
setMcastPort | public void setMcastPort(int port)(Code) | | |
setMcastSoTimeout | public void setMcastSoTimeout(int mcastSoTimeout)(Code) | | |
setMcastTTL | public void setMcastTTL(int mcastTTL)(Code) | | |
setProperties | public void setProperties(Properties properties)(Code) | | properties All are required 1. mcastPort - the port to listen to 2. mcastAddress - the mcast group address 3. bindAddress - the bind address if any - only one that can be null 4. memberDropTime - the time a member is gone before it is considered gone. 5. msgFrequency - the frequency of sending messages 6. tcpListenPort - the port this member listens to 7. tcpListenHost - the bind address of this member
exception: java.lang.IllegalArgumentException - if a property is missing. |
stop | public void stop()(Code) | | Stop broadcasting and listening to membership pings
|
|
|
|