return null;
}
private HostConfiguration getHostConfig() {
File configFile;
HostConfiguration hostConfig;
try {
String config = readAttribute(getEnvironmentAddress(), getMode().getHostConfigAttributeName());
configFile = new File(config);
} catch (Exception e) {
// This probably means the server is not running and/or authentication is not set up. Fallback to the
// host config file set in the plugin config during discovery.
// TODO (ips, 05/05/12): This is not ideal, because the user could have restarted the server with a
// different config file, since the time it was imported into inventory. The better
// thing to do here is to find the current server process and parse its command line
// to find the current config file name.
configFile = serverPluginConfig.getHostConfigFile();
if (configFile == null) {
throw new RuntimeException("Failed to determine config file path.", e);
}
}
try {
hostConfig = new HostConfiguration(configFile);
} catch (Exception e) {
throw new RuntimeException("Failed to parse configuration file [" + configFile + "].", e);
}
return hostConfig;
}