Methods Summary |
---|
public void | addStaticMember(org.apache.catalina.tribes.Member member)
synchronized (members) {
if (!members.contains(member)) members.add(member);
}
|
public org.apache.catalina.tribes.Member | getLocalMember(boolean incAlive)Return the member that represents this node.
if (this.localMember != null ) return localMember;
else return super.getLocalMember(incAlive);
|
public org.apache.catalina.tribes.Member | getMember(org.apache.catalina.tribes.Member mbr)
if ( members.contains(mbr) ) return (Member)members.get(members.indexOf(mbr));
else return super.getMember(mbr);
|
public org.apache.catalina.tribes.Member[] | getMembers()Get all current cluster members
if ( members.size() == 0 ) return super.getMembers();
else {
synchronized (members) {
Member[] others = super.getMembers();
Member[] result = new Member[members.size() + others.length];
for (int i = 0; i < others.length; i++) result[i] = others[i];
for (int i = 0; i < members.size(); i++) result[i + others.length] = (Member) members.get(i);
AbsoluteOrder.absoluteOrder(result);
return result;
}//sync
}//end if
|
public boolean | hasMembers()has members
return super.hasMembers() || (members.size()>0);
|
public void | removeStaticMember(org.apache.catalina.tribes.Member member)
synchronized (members) {
if (members.contains(member)) members.remove(member);
}
|
public void | setLocalMember(org.apache.catalina.tribes.Member member)
this.localMember = member;
|
public void | start(int svc)Send notifications upwards
if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ);
if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ);
final Member[] mbrs = (Member[])members.toArray(new Member[members.size()]);
final ChannelInterceptorBase base = this;
Thread t = new Thread() {
public void run() {
for (int i=0; i<mbrs.length; i++ ) {
base.memberAdded(mbrs[i]);
}
}
};
t.start();
super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
|