} catch (IOException e) {
System.err.println("Startup jar does not contain a manifest: " + url);
System.exit(1);
throw new AssertionError();
}
Attributes mainAttributes = manifest.getMainAttributes();
// get the main gbean class
String mainGBeanString = mainAttributes.getValue(MAIN_GBEAN);
ObjectName mainGBean = null;
if(mainGBeanString != null) {
try {
mainGBean = new ObjectName(mainGBeanString);
} catch (MalformedObjectNameException e) {
System.err.println("Invalid Main-GBean name: " + mainGBeanString);
System.exit(1);
throw new AssertionError();
}
}
// get the main method
String mainMethod = mainAttributes.getValue(MAIN_METHOD);
// get the list of extra configurations to load
List configurations = new ArrayList();
String configurationsString = mainAttributes.getValue(CONFIGURATIONS);
if (configurationsString != null) {
for (StringTokenizer tokenizer = new StringTokenizer(configurationsString, " "); tokenizer.hasMoreTokens();) {
String configuration = tokenizer.nextToken();
try {
configurations.add(new URI(configuration));
} catch (URISyntaxException e) {
System.err.println("Invalid URI in Manifest Configurations entry: " + configuration);
System.exit(1);
throw new AssertionError();
}
}
}
// get the list of endorsed directories
List endorsedDirs = new ArrayList();
String endorsedDirsString = mainAttributes.getValue(ENDORSED_DIRS);
if (endorsedDirsString != null) {
for (StringTokenizer tokenizer = new StringTokenizer(endorsedDirsString, " "); tokenizer.hasMoreTokens();) {
String directory = tokenizer.nextToken();
endorsedDirs.add(directory);
}
}
// get the list of extension directories
List extensionDirs = new ArrayList();
String extensionDirsString = mainAttributes.getValue(EXTENSION_DIRS);
if (extensionDirsString != null) {
for (StringTokenizer tokenizer = new StringTokenizer(extensionDirsString, " "); tokenizer.hasMoreTokens();) {
String directory = tokenizer.nextToken();
extensionDirs.add(directory);
}