public int compare(Object o1, Object o2) {
if(!(o1 instanceof ServiceResource))
throw new ClassCastException();
if(!(o2 instanceof ServiceResource))
throw new ClassCastException();
ResourceCapability rc1 =
((InstantiatorResource)((ServiceResource)o1).
getResource()).getResourceCapability();
ResourceCapability rc2 = ((InstantiatorResource)((ServiceResource)o2).
getResource()).getResourceCapability();
return (rc1.compareTo(rc2));
}