本文整理汇总了Java中org.apache.catalina.tribes.membership.StaticMember类的典型用法代码示例。如果您正苦于以下问题:Java StaticMember类的具体用法?Java StaticMember怎么用?Java StaticMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StaticMember类属于org.apache.catalina.tribes.membership包,在下文中一共展示了StaticMember类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performForcedCheck
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
protected void performForcedCheck() {
//update all alive times
Member[] members = super.getMembers();
for (int i = 0; members != null && i < members.length; i++) {
if (memberAlive(members[i])) {
if (membership.memberAlive((MemberImpl)members[i])) super.memberAdded(members[i]);
addSuspects.remove(members[i]);
} else {
if (membership.getMember(members[i])!=null) {
membership.removeMember((MemberImpl)members[i]);
removeSuspects.remove(members[i]);
if (members[i] instanceof StaticMember) {
addSuspects.put(members[i], Long.valueOf(System.currentTimeMillis()));
}
super.memberDisappeared(members[i]);
}
} //end if
} //for
}
示例2: performForcedCheck
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
protected void performForcedCheck() {
// update all alive times
Member[] members = super.getMembers();
for (int i = 0; members != null && i < members.length; i++) {
if (memberAlive(members[i])) {
if (membership.memberAlive((MemberImpl) members[i]))
super.memberAdded(members[i]);
addSuspects.remove(members[i]);
} else {
if (membership.getMember(members[i]) != null) {
membership.removeMember((MemberImpl) members[i]);
removeSuspects.remove(members[i]);
if (members[i] instanceof StaticMember) {
addSuspects.put(members[i], Long.valueOf(System.currentTimeMillis()));
}
super.memberDisappeared(members[i]);
}
} // end if
} // for
}
示例3: memberDisappeared
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
@Override
public void memberDisappeared(Member member) {
if ( membership == null ) setupMembership();
boolean notify = false;
boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD);
if ( !shutdown )
if(log.isInfoEnabled())
log.info("Received memberDisappeared["+member+"] message. Will verify.");
synchronized (membership) {
if (!membership.contains(member)) {
if(log.isInfoEnabled())
log.info("Verification complete. Member already disappeared["+member+"]");
return;
}
//check to see if the member really is gone
//if the payload is not a shutdown message
if (shutdown || !memberAlive(member)) {
//not correct, we need to maintain the map
membership.removeMember( (MemberImpl) member);
removeSuspects.remove(member);
if (member instanceof StaticMember) {
addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
notify = true;
} else {
//add the member as suspect
removeSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
}
if ( notify ) {
if(log.isInfoEnabled())
log.info("Verification complete. Member disappeared["+member+"]");
super.memberDisappeared(member);
} else {
if(log.isInfoEnabled())
log.info("Verification complete. Member still alive["+member+"]");
}
}
示例4: memberDisappeared
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
@Override
public void memberDisappeared(Member member) {
if ( membership == null ) setupMembership();
boolean notify = false;
boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD);
if (shutdown) {
synchronized (membership) {
if (!membership.contains(member)) return;
membership.removeMember( (MemberImpl) member);
removeSuspects.remove(member);
if (member instanceof StaticMember) {
addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
}
super.memberDisappeared(member);
} else {
if(log.isInfoEnabled())
log.info("Received memberDisappeared["+member+"] message. Will verify.");
synchronized (membership) {
if (!membership.contains(member)) {
if(log.isInfoEnabled())
log.info("Verification complete. Member already disappeared["+member+"]");
return;
}
//check to see if the member really is gone
if (!memberAlive(member)) {
//not correct, we need to maintain the map
membership.removeMember( (MemberImpl) member);
removeSuspects.remove(member);
if (member instanceof StaticMember) {
addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
notify = true;
} else {
//add the member as suspect
removeSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
}
if ( notify ) {
if(log.isInfoEnabled())
log.info("Verification complete. Member disappeared["+member+"]");
super.memberDisappeared(member);
} else {
if(log.isInfoEnabled())
log.info("Verification complete. Member still alive["+member+"]");
}
}
}
示例5: setLocalMember
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setLocalMember(Member member) {
this.localMember = member;
((StaticMember)localMember).setLocal(true);
}
示例6: memberDisappeared
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
@Override
public void memberDisappeared(Member member) {
if (membership == null)
setupMembership();
boolean notify = false;
boolean shutdown = Arrays.equals(member.getCommand(), Member.SHUTDOWN_PAYLOAD);
if (shutdown) {
synchronized (membership) {
if (!membership.contains(member))
return;
membership.removeMember((MemberImpl) member);
removeSuspects.remove(member);
if (member instanceof StaticMember) {
addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
}
super.memberDisappeared(member);
} else {
if (log.isInfoEnabled())
log.info("Received memberDisappeared[" + member + "] message. Will verify.");
synchronized (membership) {
if (!membership.contains(member)) {
if (log.isInfoEnabled())
log.info("Verification complete. Member already disappeared[" + member + "]");
return;
}
// check to see if the member really is gone
if (!memberAlive(member)) {
// not correct, we need to maintain the map
membership.removeMember((MemberImpl) member);
removeSuspects.remove(member);
if (member instanceof StaticMember) {
addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
notify = true;
} else {
// add the member as suspect
removeSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
}
}
if (notify) {
if (log.isInfoEnabled())
log.info("Verification complete. Member disappeared[" + member + "]");
super.memberDisappeared(member);
} else {
if (log.isInfoEnabled())
log.info("Verification complete. Member still alive[" + member + "]");
}
}
}
示例7: setLocalMember
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setLocalMember(Member member) {
this.localMember = member;
((StaticMember) localMember).setLocal(true);
}
示例8: setPayload
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setPayload(byte[] payload) {
this.payload = payload;
((StaticMember) membershipManager.getLocalMember()).setPayload(payload);
}
示例9: setDomain
import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setDomain(byte[] domain) {
this.domain = domain;
((StaticMember) membershipManager.getLocalMember()).setDomain(domain);
}