if (params.getProtocol().equals("jmx") || params.getProtocol().equals("jmxs")) {
return newRemoteDeploymentManager(username, password, params);
} else if(params.getProtocol().equals("inVM")) {
return new LocalDeploymentManager(KernelRegistry.getKernel(params.getHost()));
} else {
throw new DeploymentManagerCreationException("Invalid URI: " + uri);
}
} catch (RuntimeException e) {
// some DeploymentManagerFactories suppress unchecked exceptions - log and rethrow
log.error(e.getMessage(), e);
throw e;
} catch (Error e) {
// some DeploymentManagerFactories suppress unchecked exceptions - log and rethrow
log.error(e.getMessage(), e);
throw e;
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new DeploymentManagerCreationException(e.getMessage());
}
}