tunnels.clear();
files.clear();
if (element.getName().equalsIgnoreCase("launcher")) {
throw new JDOMException("Launcher element must be <launcher>");
}
typeName = element.getAttribute("type").getValue();
if (typeName == null) {
throw new JDOMException("<launcher> element requires attribute 'type'");
}
//
try {
String clazz = "com.adito.applications.types." + (
String.valueOf(typeName.charAt(0)).toUpperCase() + typeName.substring(1) ) + "ApplicationType";
if (log.isDebugEnabled())
log.debug("Loading type class " + clazz);
launcherType = (ExtensionType)Class.forName(clazz).newInstance();
}
catch(Throwable t) {
throw new JDOMException("Failed to load launcher extension for type " + typeName + ".");
}
id = (element.getAttribute("launcher").getValue());
if (id == null) {
throw new JDOMException("<launcher> element requires attribute 'launcher'");
}
name = element.getAttribute("name").getValue();
if (log.isDebugEnabled())
log.debug("Launcher name is " + name);
if (name == null) {
throw new JDOMException("<launcher> element requires the attribute 'name'");
}
for (Iterator it = element.getChildren().iterator();
it.hasNext(); ) {
Element e = (Element) it.next();
if (e.getName().equalsIgnoreCase("description")) {
description = e.getText();
}
else if (e.getName().equalsIgnoreCase("parameter")) {
addParameter(e);
}
else if (e.getName().equalsIgnoreCase("messages")) {
ExtensionDescriptorMessageResourcesFactory factory = new ExtensionDescriptorMessageResourcesFactory(e);
messageResources = factory.createResources("dummy");
if(messageResources == null) {
throw new JDOMException("Failed to create message resources.");
}
}
else if (e.getName().equalsIgnoreCase("tunnel")) {
verifyTunnel(e);
}
else if (e.getName().equalsIgnoreCase("files")) {
verifyFiles(e);
}
else {
// launcherType.load(this, e);
}
}
if(messageResources == null) {
throw new JDOMException("No <messages> element supplied.");
}
}