configID = new URI(properties.getProperty("configID"));
} catch (URISyntaxException e1) {
throw new DeploymentException("Invalid configuration URI", e1);
}
DeploymentContext context = null;
context = new DeploymentContext(outfile, configID, ConfigurationModuleType.SERVICE, parentID, null, null, kernel);
// Copy over all files.
for (Enumeration e = module.entries(); e.hasMoreElements();) {
ZipEntry entry = (ZipEntry) e.nextElement();
context.addFile(URI.create(entry.getName()), module, entry);
}
// Create the JBI deployment managed object
try {
Properties props = new Properties();
props.put("jbiType", "Deployment");
props.put("name", configID.toString());
ObjectName name = ObjectName.getInstance(context.getDomain(), props);
GBeanData gbeanData = new GBeanData(name, ServiceMixDeployment.GBEAN_INFO);
context.addGBean(gbeanData);
} catch (MalformedObjectNameException e) {
throw new DeploymentException("Invalid gbean name: " + e, e);
}
if (deploymentDependencies != null) {
String[] strings = deploymentDependencies.split("\\,");
for (int i = 0; i < strings.length; i++) {
strings[i] = strings[i].trim();
if (strings[i].length() > 0) {
try {
context.addDependency(new URI(strings[i]));
} catch (URISyntaxException e) {
throw new DeploymentException("Invalid dependency URI: " + strings[i], e);
}
}
}
}
context.close();
ConfigurationData configurationData = context.getConfigurationData();
try {
configurationData.addClassPathLocation(new URI("."));
} catch (URISyntaxException e) {
throw new DeploymentException("Could not set classpath: " + e, e);
}