|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.cluster.mcast.McastMember
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 java.lang.String |
host
The listen host for this member |
static java.lang.String |
MEMBER_DOMAIN
|
static java.lang.String |
MEMBER_NAME
|
protected long |
memberAliveTime
The number of milliseconds since this members was created, is kept track of using the start time |
protected int |
msgCount
Counter for how many messages have been sent from this member |
protected int |
port
The tcp listen port for this member |
static java.lang.String |
TCP_LISTEN_HOST
|
static java.lang.String |
TCP_LISTEN_PORT
Public properties specific to this implementation |
Constructor Summary | |
McastMember(java.lang.String name,
java.lang.String domain,
java.lang.String host,
int port,
long aliveTime)
Construct a new member object |
Method Summary | |
boolean |
equals(java.lang.Object o)
Returns true if the param o is a McastMember with the same name |
protected byte[] |
getData(long startTime)
Create a data package to send over the wire representing this member. |
java.lang.String |
getDomain()
Return the domain of this object |
java.lang.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 |
long |
getMemberAliveTime()
Contains information on how long this member has been online. |
java.util.HashMap |
getMemberProperties()
Return implementation specific properties about this cluster node. |
java.lang.String |
getName()
Return the name of this object |
int |
getPort()
Return the listen port of this member |
int |
hashCode()
|
protected void |
inc()
Increment the message count. |
void |
setDomain(java.lang.String domain)
|
void |
setHost(java.lang.String host)
|
void |
setMemberAliveTime(long time)
|
void |
setMsgCount(int msgCount)
|
void |
setName(java.lang.String name)
|
void |
setPort(int port)
|
java.lang.String |
toString()
String representation of this object |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
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 java.lang.String MEMBER_DOMAIN
protected java.lang.String host
protected int port
protected int msgCount
protected long memberAliveTime
Constructor Detail |
public McastMember(java.lang.String name, java.lang.String domain, java.lang.String host, int port, long aliveTime)
name
- - the name of this member, cluster uniquedomain
- - the cluster domain name of this memberhost
- - the tcp listen hostport
- - the tcp listen portMethod Detail |
public java.util.HashMap getMemberProperties()
Member
getMemberProperties
in interface Member
protected void inc()
protected byte[] getData(long startTime) throws java.lang.Exception
java.lang.Exception
protected static McastMember getMember(byte[] data)
data
- - the bytes received
public java.lang.String getName()
getName
in interface Member
public java.lang.String getDomain()
getDomain
in interface Member
public int getPort()
getPort
in interface Member
public java.lang.String getHost()
getHost
in interface Member
public long getMemberAliveTime()
getMemberAliveTime
in interface Member
public void setMemberAliveTime(long time)
public java.lang.String toString()
public int hashCode()
Object.hashCode()
public boolean equals(java.lang.Object o)
o
- public void setHost(java.lang.String host)
public void setMsgCount(int msgCount)
public void setName(java.lang.String name)
public void setDomain(java.lang.String domain)
public void setPort(int port)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |