*/
URL[] urls = ((URLClassLoader)loader).getURLs();
if(urls.length==0)
throw new RuntimeException("Unknown Export Codebase");
ClassBundle exportBundle;
String exportCodebase = urls[0].toExternalForm();
if(!exportCodebase.startsWith("artifact:")) {
if(exportCodebase.contains(".jar")) {
int index = exportCodebase.lastIndexOf('/');
if(index != -1)
exportCodebase = exportCodebase.substring(0, index+1);
} else {
throw new RuntimeException("Cannot determine export codebase from "+exportCodebase);
}
exportBundle = new ClassBundle("");
exportBundle.setCodebase(exportCodebase);
for (URL url : urls) {
String jar = url.getFile();
int index = jar.lastIndexOf('/');
if (index != -1)
jar = jar.substring(1);
exportBundle.addJAR(jar);
}
} else {
exportBundle = new ClassBundle("");
exportBundle.setArtifact(exportCodebase);
}
/* Default system threshold is the number of available processors.
* Since the system threshold is the summation of all depletion oriented
* resources, total utilization is =