| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.catalina.tribes.membership.MemberImpl
public class MemberImpl
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 | |
|---|---|
| protected  byte[] | commandCommand, so that the custom payload doesn't have to be used This is for internal tribes use, such as SHUTDOWN_COMMAND | 
| protected  byte[] | dataPkgTo avoid serialization over and over again, once the local dataPkg has been set, we use that to transmit data | 
| static boolean | DO_DNS_LOOKUPSShould a call to getName or getHostName try to do a DNS lookup? | 
| protected  byte[] | domainDomain if we want to filter based on domain. | 
| protected  byte[] | hostThe listen host for this member | 
| protected  java.lang.String | hostname | 
| static java.lang.String | MEMBER_NAME | 
| protected  long | memberAliveTimeThe number of milliseconds since this members was created, is kept track of using the start time | 
| protected  int | msgCountCounter for how many broadcast messages have been sent from this member | 
| protected  byte[] | payloadCustom payload that an app framework can broadcast Also used to transport stop command. | 
| protected  int | portThe tcp listen port for this member | 
| protected  int | securePortThe tcp/SSL listen port for this member | 
| protected  long | serviceStartTimeFor the local member only | 
| static java.lang.String | TCP_LISTEN_HOST | 
| static java.lang.String | TCP_LISTEN_PORTPublic properties specific to this implementation | 
| static byte[] | TRIBES_MBR_BEGIN | 
| static byte[] | TRIBES_MBR_END | 
| protected  byte[] | uniqueIdUnique session Id for this member | 
| Fields inherited from interface org.apache.catalina.tribes.Member | 
|---|
| SHUTDOWN_PAYLOAD | 
| Constructor Summary | |
|---|---|
| MemberImpl()Empty constructor for serialization | |
| MemberImpl(java.lang.String host,
           int port,
           long aliveTime)Construct a new member object | |
| MemberImpl(java.lang.String host,
           int port,
           long aliveTime,
           byte[] payload) | |
| Method Summary | |
|---|---|
| static java.lang.String | bToS(byte[] data) | 
| static java.lang.String | bToS(byte[] data,
     int max) | 
|  boolean | equals(java.lang.Object o)Returns true if the param o is a McastMember with the same name | 
|  byte[] | getCommand()returns the command associated with this member | 
|  byte[] | getData()Create a data package to send over the wire representing this member. | 
|  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 | 
|  byte[] | getData(boolean getalive,
        boolean reset) | 
|  int | getDataLength() | 
|  byte[] | getDomain()Domain for this cluster | 
|  byte[] | getHost()Return the TCP listen host for this member | 
|  java.lang.String | getHostname() | 
| static MemberImpl | getMember(byte[] data) | 
| static MemberImpl | getMember(byte[] data,
          int offset,
          int length) | 
| static MemberImpl | getMember(byte[] data,
          int offset,
          int length,
          MemberImpl member) | 
| static MemberImpl | getMember(byte[] data,
          MemberImpl member)Deserializes a member from data sent over the wire | 
|  long | getMemberAliveTime()Contains information on how long this member has been online. | 
|  java.lang.String | getName()Return the name of this object | 
|  byte[] | getPayload()returns the payload associated with this member | 
|  int | getPort()Return the listen port of this member | 
|  int | getSecurePort()Returns the secure listen port for the ChannelReceiver implementation. | 
|  long | getServiceStartTime() | 
|  byte[] | getUniqueId()returns a UUID unique for this member over all sessions. | 
|  int | hashCode() | 
| protected  void | inc()Increment the message count. | 
|  boolean | isFailing() | 
|  boolean | isReady()The current state of the member | 
|  boolean | isSuspect()The current state of the member | 
|  void | readExternal(java.io.ObjectInput in) | 
|  void | setCommand(byte[] command) | 
|  void | setDomain(byte[] domain) | 
|  void | setHost(byte[] host) | 
|  void | setHostname(java.lang.String host) | 
|  void | setMemberAliveTime(long time) | 
|  void | setMsgCount(int msgCount) | 
|  void | setPayload(byte[] payload) | 
|  void | setPort(int port) | 
|  void | setSecurePort(int securePort) | 
|  void | setServiceStartTime(long serviceStartTime) | 
|  void | setUniqueId(byte[] uniqueId) | 
|  java.lang.String | toString()String representation of this object | 
|  void | writeExternal(java.io.ObjectOutput out) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final boolean DO_DNS_LOOKUPS
public static final transient java.lang.String TCP_LISTEN_PORT
public static final transient java.lang.String TCP_LISTEN_HOST
public static final transient java.lang.String MEMBER_NAME
public static final transient byte[] TRIBES_MBR_BEGIN
public static final transient byte[] TRIBES_MBR_END
protected byte[] host
protected transient java.lang.String hostname
protected int port
protected int securePort
protected int msgCount
protected long memberAliveTime
protected transient long serviceStartTime
protected transient byte[] dataPkg
protected byte[] uniqueId
protected byte[] payload
protected byte[] command
protected byte[] domain
| Constructor Detail | 
|---|
public MemberImpl()
public MemberImpl(java.lang.String host,
                  int port,
                  long aliveTime)
           throws java.io.IOException
host - - the tcp listen hostport - - the tcp listen port
java.io.IOException
public MemberImpl(java.lang.String host,
                  int port,
                  long aliveTime,
                  byte[] payload)
           throws java.io.IOException
java.io.IOException| Method Detail | 
|---|
public boolean isReady()
Member
isReady in interface Memberpublic boolean isSuspect()
Member
isSuspect in interface Memberpublic boolean isFailing()
isFailing in interface Memberprotected void inc()
public byte[] getData()
java.lang.Exceptionpublic byte[] getData(boolean getalive)
getalive - boolean
public int getDataLength()
public byte[] getData(boolean getalive,
                      boolean reset)
getalive - boolean - calculate memberAlive timereset - boolean - reset the cached data package, and create a new one
public static MemberImpl getMember(byte[] data,
                                   MemberImpl member)
data - - the bytes received
public static MemberImpl getMember(byte[] data,
                                   int offset,
                                   int length,
                                   MemberImpl member)
public static MemberImpl getMember(byte[] data)
public static MemberImpl getMember(byte[] data,
                                   int offset,
                                   int length)
public java.lang.String getName()
getName in interface Memberpublic int getPort()
getPort in interface MemberChannelReceiverpublic byte[] getHost()
getHost in interface MemberChannelReceiverpublic java.lang.String getHostname()
public long getMemberAliveTime()
getMemberAliveTime in interface Memberpublic long getServiceStartTime()
public byte[] getUniqueId()
Member
getUniqueId in interface Memberpublic byte[] getPayload()
Member
getPayload in interface Memberpublic byte[] getCommand()
Member
getCommand in interface Memberpublic byte[] getDomain()
Member
getDomain in interface Memberpublic int getSecurePort()
Member
getSecurePort in interface MemberChannelReceiverpublic void setMemberAliveTime(long time)
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String bToS(byte[] data)
public static java.lang.String bToS(byte[] data,
                                    int max)
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - public void setHost(byte[] host)
public void setHostname(java.lang.String host)
                 throws java.io.IOException
java.io.IOExceptionpublic void setMsgCount(int msgCount)
public void setPort(int port)
public void setServiceStartTime(long serviceStartTime)
public void setUniqueId(byte[] uniqueId)
public void setPayload(byte[] payload)
public void setCommand(byte[] command)
public void setDomain(byte[] domain)
public void setSecurePort(int securePort)
public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||