if ( parent == null ) {
independentClasses.add(name);
} else {
DuccProperties par_cl = clmap.get(parent);
if ( par_cl == null ) {
throw new IllegalConfigurationException("Class " + name + " parent pool " + parent + " cannot be found.");
}
String children = par_cl.getStringProperty("children", null);
if ( children == null ) {
children = name;
} else {
children = children + " " + name;
}
par_cl.put("children", children);
}
}
// now starting at every root, propogate stuff down
for ( String s : independentClasses ) {
propogateDown(s);
}
// must fill in defaults, which we couldn't do until we finished inheritance
for ( DuccProperties p : clmap.values() ) {
String policy = p.getStringProperty("policy", null);
String name = p.getProperty("name");
if ( policy == null ) {
throw new IllegalConfigurationException("Class " + name + " is missing scheduling policy ");
}
if ( policy.equals("FAIR_SHARE") ) {
fairShareExists = true;
handleDefault(p, fairShareDefault, policy);
supplyDefaults(p, defaultFairShareClass);
} else
if ( policy.equals("FIXED_SHARE") ) {
fixedExists = true;
handleDefault(p, fixedDefault, policy);
supplyDefaults(p, defaultFixedShareClass);
} else
if ( policy.equals("RESERVE") ) {
reserveExists = true;
handleDefault(p, reserveDefault, policy);
supplyDefaults(p, defaultReserveClass);
} else {
throw new IllegalConfigurationException("Unknown scheduling policy \"" + policy + "\" in class " + name);
}
}
// remove the abstract classes as they are no longer needed and we don't want to let them leak out
// where somebody might think they're ok to use
Iterator<String> iter = clmap.keySet().iterator();
while ( iter.hasNext() ) {
String k = iter.next();
DuccProperties p = clmap.get(k);
if ( p.containsKey("abstract") ) {
// System.out.println("---------------- Remove " + p.get("name"));
iter.remove();
}
}