}
}
}
public void install(File f) {
JbiContainer container = JbiContainer.Factory.getInstance();
File wrkDir = container.getWorkingDir();
File proDir = Directories.getAutoInstallProcessedDir(wrkDir);
File fp;
try {
IOUtils.createDirs(proDir);
fp = getRenamedFile(f, proDir);
if (!f.renameTo(fp)) {
throw new IOException();
}
} catch (IOException e) {
logger.info("Could not move file " + f + " for auto installation");
return;
}
ObjectName service = null;
ObjectName installer = null;
MBeanServer server = container.getMBeanServer();
try {
service = container.createMBeanName(null, "service", "install");
installer = (ObjectName) server.invoke(service, "loadNewInstaller", new Object[] { fp.toURL().toString() }, new String[] { String.class.getName() });
server.invoke(installer, "install", null, null);
new File(fp.getAbsolutePath() + ".success").createNewFile();
} catch (Throwable t) {
try {