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

All Implemented Interfaces:
    Member, Externalizable

Direct Known Subclasses:
    StaticMember

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
public static final  boolean DO_DNS_LOOKUPS    Should a call to getName or getHostName try to do a DNS lookup? default is false 
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  byte[] TRIBES_MBR_BEGIN     
public static final transient  byte[] TRIBES_MBR_END     
protected  byte[] host    The listen host for this member 
protected transient  String hostname     
protected  int port    The tcp listen port for this member 
protected  int securePort    The tcp/SSL listen port for this member 
protected  int msgCount    Counter for how many broadcast 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 
protected transient  long serviceStartTime    For the local member only 
protected transient  byte[] dataPkg    To avoid serialization over and over again, once the local dataPkg has been set, we use that to transmit data 
protected  byte[] uniqueId    Unique session Id for this member 
protected  byte[] payload    Custom payload that an app framework can broadcast Also used to transport stop command. 
protected  byte[] command    Command, so that the custom payload doesn't have to be used This is for internal tribes use, such as SHUTDOWN_COMMAND 
protected  byte[] domain    Domain if we want to filter based on domain. 
Constructor:
 public MemberImpl() 
 public MemberImpl(String host,
    int port,
    long aliveTime) throws IOException 
    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
 public MemberImpl(String host,
    int port,
    long aliveTime,
    byte[] payload) throws IOException 
Method from org.apache.catalina.tribes.membership.MemberImpl Summary:
bToS,   bToS,   equals,   getCommand,   getData,   getData,   getData,   getDataLength,   getDomain,   getHost,   getHostname,   getMember,   getMember,   getMember,   getMember,   getMemberAliveTime,   getName,   getPayload,   getPort,   getSecurePort,   getServiceStartTime,   getUniqueId,   hashCode,   inc,   isFailing,   isReady,   isSuspect,   readExternal,   setCommand,   setDomain,   setHost,   setHostname,   setMemberAliveTime,   setMsgCount,   setPayload,   setPort,   setSecurePort,   setServiceStartTime,   setUniqueId,   toString,   writeExternal
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.tribes.membership.MemberImpl Detail:
 public static String bToS(byte[] data) 
 public static String bToS(byte[] data,
    int max) 
 public boolean equals(Object o) 
    Returns true if the param o is a McastMember with the same name
 public byte[] getCommand() 
 public byte[] getData() 
    Create a data package to send over the wire representing this member. This is faster than serialization.
 public byte[] getData(boolean getalive) 
    Highly optimized version of serializing a member into a byte array Returns a cached byte[] reference, do not modify this data
 public byte[] getData(boolean getalive,
    boolean reset) 
 public int getDataLength() 
 public byte[] getDomain() 
 public byte[] getHost() 
    Return the TCP listen host for this member
 public String getHostname() 
 public static MemberImpl getMember(byte[] data) 
 public static MemberImpl getMember(byte[] data,
    MemberImpl member) 
    Deserializes a member from data sent over the wire
 public static MemberImpl getMember(byte[] data,
    int offset,
    int length) 
 public static MemberImpl getMember(byte[] data,
    int offset,
    int length,
    MemberImpl member) 
 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 String getName() 
    Return the name of this object
 public byte[] getPayload() 
 public int getPort() 
    Return the listen port of this member
 public int getSecurePort() 
 public long getServiceStartTime() 
 public byte[] getUniqueId() 
 public int hashCode() 
 protected  void inc() 
    Increment the message count.
 public boolean isFailing() 
 public boolean isReady() 
 public boolean isSuspect() 
 public  void readExternal(ObjectInput in) throws ClassNotFoundException, IOException 
 public  void setCommand(byte[] command) 
 public  void setDomain(byte[] domain) 
 public  void setHost(byte[] host) 
 public  void setHostname(String host) throws IOException 
 public  void setMemberAliveTime(long time) 
 public  void setMsgCount(int msgCount) 
 public  void setPayload(byte[] payload) 
 public  void setPort(int port) 
 public  void setSecurePort(int securePort) 
 public  void setServiceStartTime(long serviceStartTime) 
 public  void setUniqueId(byte[] uniqueId) 
 public String toString() 
    String representation of this object
 public  void writeExternal(ObjectOutput out) throws IOException