public void create(DeploymentInfo di) throws DeploymentException {
try {
String urlStr = di.url.getFile();
if (jbiContainerMBean == null) {
throw new DeploymentException(
"The ServiceMix JBI container is not defined in Deployer");
}
log
.info("ServiceMix deployer passing deployment to JBI container ["
+ di.url.toExternalForm() + "]");
if (urlStr.endsWith(".jar") || urlStr.endsWith(".zip")) {
getServer().invoke(jbiContainerMBean, "installArchive",
new Object[] { di.url.toExternalForm() },
new String[] { "java.lang.String" });
} else {
getServer().invoke(jbiContainerMBean, "installServiceMixXml",
new Object[] { di.url.toExternalForm() },
new String[] { "java.lang.String" });
}
} catch (Exception e) {
throw new DeploymentException(
"ServiceMix deployer unable to deploy: " + di, e);
}
}