1 23 package com.sun.enterprise.management; 24 25 import javax.management.ObjectName ; 26 27 import com.sun.appserv.management.base.AMX; 28 import com.sun.appserv.management.base.Util; 29 30 import com.sun.appserv.management.util.jmx.ObjectNameComparator; 31 32 33 public final class AMXComparator<T extends AMX> implements java.util.Comparator <T> 34 { 35 public AMXComparator() {} 36 37 public int 38 compare( final T lhs, final T rhs ) 39 { 40 final ObjectName lhsName = Util.getObjectName( lhs ); 41 final ObjectName rhsName = Util.getObjectName( rhs ); 42 43 return ObjectNameComparator.INSTANCE.compare( lhsName, rhsName ); 44 } 45 46 public boolean 47 equals( final Object other ) 48 { 49 return( other instanceof AMXComparator ); 50 } 51 } 52 53 54 55 56 57 | Popular Tags |