当前位置: 首页>>代码示例>>Java>>正文


Java StaticMember类代码示例

本文整理汇总了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

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:TcpFailureDetector.java

示例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

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:TcpFailureDetector.java

示例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+"]");

    }
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:40,代码来源:TcpFailureDetector.java

示例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+"]");
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:49,代码来源:TcpFailureDetector.java

示例5: setLocalMember

import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setLocalMember(Member member) {
    this.localMember = member;
    ((StaticMember)localMember).setLocal(true);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:StaticMembershipInterceptor.java

示例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 + "]");
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:51,代码来源:TcpFailureDetector.java

示例7: setLocalMember

import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setLocalMember(Member member) {
	this.localMember = member;
	((StaticMember) localMember).setLocal(true);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:5,代码来源:StaticMembershipInterceptor.java

示例8: setPayload

import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setPayload(byte[] payload) {
    this.payload = payload;
    ((StaticMember) membershipManager.getLocalMember()).setPayload(payload);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:5,代码来源:WkaMembershipService.java

示例9: setDomain

import org.apache.catalina.tribes.membership.StaticMember; //导入依赖的package包/类
public void setDomain(byte[] domain) {
    this.domain = domain;
    ((StaticMember) membershipManager.getLocalMember()).setDomain(domain);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:5,代码来源:WkaMembershipService.java


注:本文中的org.apache.catalina.tribes.membership.StaticMember类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。