FileDocCategorySizeDatePackage
AbsoluteOrder.javaAPI DocApache Tomcat 6.0.144033Fri Jul 20 04:20:34 BST 2007org.apache.catalina.tribes.group

AbsoluteOrder

public class AbsoluteOrder extends Object

Title: Membership - Absolute Order

Description: A simple, yet agreeable and efficient way of ordering members

Ordering members can serve as a basis for electing a leader or coordinating efforts.
This is stinky simple, it works on the basis of the Member interface and orders members in the following format:

  1. IP comparison - byte by byte, lower byte higher rank
  2. IPv4 addresses rank higher than IPv6, ie the lesser number of bytes, the higher rank
  3. Port comparison - lower port, higher rank
  4. UniqueId comparison- byte by byte, lower byte higher rank

author
Filip Hanik
version
1.0
see
org.apache.catalina.tribes.Member

Fields Summary
public static final AbsoluteComparator
comp
Constructors Summary
protected AbsoluteOrder()

    
      
        super();
    
Methods Summary
public static voidabsoluteOrder(org.apache.catalina.tribes.Member[] members)

        if ( members == null || members.length == 0 ) return;
        Arrays.sort(members,comp);