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


Java AbsoluteOrder.absoluteOrder方法代码示例

本文整理汇总了Java中org.apache.catalina.tribes.group.AbsoluteOrder.absoluteOrder方法的典型用法代码示例。如果您正苦于以下问题:Java AbsoluteOrder.absoluteOrder方法的具体用法?Java AbsoluteOrder.absoluteOrder怎么用?Java AbsoluteOrder.absoluteOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.tribes.group.AbsoluteOrder的用法示例。


在下文中一共展示了AbsoluteOrder.absoluteOrder方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMembers

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
/**
 * Get all current cluster members
 * 
 * @return all members or empty array
 */
@Override
public Member[] getMembers() {
	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] = members.get(i);
			AbsoluteOrder.absoluteOrder(result);
			return result;
		} // sync
	} // end if
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:StaticMembershipInterceptor.java

示例2: hasHigherPriority

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
protected boolean hasHigherPriority(Member[] complete, Member[] local) {
    if ( local == null || local.length == 0 ) return false;
    if ( complete == null || complete.length == 0 ) return true;
    AbsoluteOrder.absoluteOrder(complete);
    AbsoluteOrder.absoluteOrder(local);
    return (AbsoluteOrder.comp.compare(complete[0],local[0]) > 0);
    
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:9,代码来源:NonBlockingCoordinator.java

示例3: getMembers

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
/**
 * Get all current cluster members
 * @return all members or empty array
 */
@Override
public Member[] getMembers() {
    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] = members.get(i);
            AbsoluteOrder.absoluteOrder(result);
            return result;
        }//sync
    }//end if
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:StaticMembershipInterceptor.java

示例4: merge

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
public static Member[] merge(Member[] m1, Member[] m2) {
    AbsoluteOrder.absoluteOrder(m1);
    AbsoluteOrder.absoluteOrder(m2);
    ArrayList<Member> list =
        new ArrayList<Member>(java.util.Arrays.asList(m1));
    for (int i=0; i<m2.length; i++) if ( !list.contains(m2[i]) ) list.add(m2[i]);
    Member[] result = new Member[list.size()];
    list.toArray(result);
    AbsoluteOrder.absoluteOrder(result);
    return result;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:Arrays.java

示例5: hasHigherPriority

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
protected boolean hasHigherPriority(Member[] complete, Member[] local) {
	if (local == null || local.length == 0)
		return false;
	if (complete == null || complete.length == 0)
		return true;
	AbsoluteOrder.absoluteOrder(complete);
	AbsoluteOrder.absoluteOrder(local);
	return (AbsoluteOrder.comp.compare(complete[0], local[0]) > 0);

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

示例6: merge

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
public static Member[] merge(Member[] m1, Member[] m2) {
	AbsoluteOrder.absoluteOrder(m1);
	AbsoluteOrder.absoluteOrder(m2);
	ArrayList<Member> list = new ArrayList<Member>(java.util.Arrays.asList(m1));
	for (int i = 0; i < m2.length; i++)
		if (!list.contains(m2[i]))
			list.add(m2[i]);
	Member[] result = new Member[list.size()];
	list.toArray(result);
	AbsoluteOrder.absoluteOrder(result);
	return result;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:Arrays.java

示例7: sameMembers

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
public static boolean sameMembers(Member[] m1, Member[] m2) {
    AbsoluteOrder.absoluteOrder(m1);
    AbsoluteOrder.absoluteOrder(m2);
    return equals(m1,m2);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:6,代码来源:Arrays.java

示例8: sameMembers

import org.apache.catalina.tribes.group.AbsoluteOrder; //导入方法依赖的package包/类
public static boolean sameMembers(Member[] m1, Member[] m2) {
	AbsoluteOrder.absoluteOrder(m1);
	AbsoluteOrder.absoluteOrder(m2);
	return equals(m1, m2);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:6,代码来源:Arrays.java


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