Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » cluster » mcast » [javadoc | source]
org.apache.catalina.cluster.mcast
public class: McastMember [javadoc | source]
java.lang.Object
   org.apache.catalina.cluster.mcast.McastMember

All Implemented Interfaces:
    Member, Serializable

A membership implementation using simple multicast. This is the representation of a multicast member. Carries the host, and port of the this or other cluster nodes.
Field Summary
static final transient  char[] digits    Digits, used for "superfast" de-serialization of an IP address 
public static final transient  String TCP_LISTEN_PORT    Public properties specific to this implementation 
public static final transient  String TCP_LISTEN_HOST     
public static final transient  String MEMBER_NAME     
public static final transient  String MEMBER_DOMAIN     
protected  String host    The listen host for this member 
protected  int port    The tcp listen port for this member 
protected  int msgCount    Counter for how many messages have been sent from this member 
protected  long memberAliveTime    The number of milliseconds since this members was created, is kept track of using the start time 
Constructor:
 public McastMember(String name,
    String domain,
    String host,
    int port,
    long aliveTime) 
    Construct a new member object
    Parameters:
    name - - the name of this member, cluster unique
    domain - - the cluster domain name of this member
    host - - the tcp listen host
    port - - the tcp listen port
Method from org.apache.catalina.cluster.mcast.McastMember Summary:
equals,   getData,   getDomain,   getHost,   getMember,   getMemberAliveTime,   getMemberProperties,   getName,   getPort,   hashCode,   inc,   setDomain,   setHost,   setMemberAliveTime,   setMsgCount,   setName,   setPort,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.cluster.mcast.McastMember Detail:
 public boolean equals(Object o) 
    Returns true if the param o is a McastMember with the same name
 protected byte[] getData(long startTime) throws Exception 
    Create a data package to send over the wire representing this member. This is faster than serialization.
 public String getDomain() 
    Return the domain of this object
 public String getHost() 
    Return the TCP listen host for this member
 protected static McastMember getMember(byte[] data) 
    Deserializes a member from data sent over the wire
 public long getMemberAliveTime() 
    Contains information on how long this member has been online. The result is the number of milli seconds this member has been broadcasting its membership to the cluster.
 public HashMap getMemberProperties() 
 public String getName() 
    Return the name of this object
 public int getPort() 
    Return the listen port of this member
 public int hashCode() 
 protected  void inc() 
    Increment the message count.
 public  void setDomain(String domain) 
 public  void setHost(String host) 
 public  void setMemberAliveTime(long time) 
 public  void setMsgCount(int msgCount) 
 public  void setName(String name) 
 public  void setPort(int port) 
 public String toString() 
    String representation of this object