//should be internal exception, lixl
// throw SoftwareManagerCollectorException.CLASS_NOT_DEFINED(appManagerAdd.getType());
}
logger.info("Factory class name is " + factoryClassName);
SoftwareManagerFactory softwareManagerFactory = null;
try {
Class<? extends SoftwareManagerFactory> clazz = ReflectionUtils.getClass(factoryClassName, SoftwareManagerFactory.class);
logger.info("Factory class loaded.");
softwareManagerFactory = ReflectionUtils.newInstance(clazz);
} catch (Exception e) {
String errMsg = String.format(Messages.getString("SW_MGR_COLLECTOR.CANNT_INSTANTIATE_APP_MGR_FACTORY"), factoryClassName);
logger.error(errMsg, e);
throw new SWMgrCollectorInternalException(e, errMsg);
// throw SoftwareManagerCollectorException.CAN_NOT_INSTANTIATE(e, factoryClassName);
}
logger.info("Start to invoke application manager factory to create application manager.");
SoftwareManager softwareManager = null;
try {
softwareManager =
softwareManagerFactory.getSoftwareManager(appManagerAdd.getUrl(), appManagerAdd
.getUsername(), appManagerAdd.getPassword().toCharArray(),
getPrivateKey());
} catch (Exception ex) {
//TODO the handling is not clear: was it a connection failure (external), or some instantiating error (internal). lixl
logger.error("Create application manager failed: " + ex.getMessage(), ex);