use of org.jvnet.hk2.config.ConfigPopulatorException in project Payara by payara.
the class DomainXml method run.
@Override
public void run(ConfigParser parser) throws ConfigPopulatorException {
LogRecord lr = new LogRecord(Level.FINE, startupClass + this.getClass().getName());
lr.setLoggerName(getClass().getName());
EarlyLogHandler.earlyMessages.add(lr);
ClassLoader parentClassLoader = (registry == null) ? getClass().getClassLoader() : registry.getParentClassLoader();
if (parentClassLoader == null)
parentClassLoader = getClass().getClassLoader();
ServiceLocatorUtilities.addOneConstant(habitat, parentClassLoader, null, ClassLoader.class);
try {
parseDomainXml(parser, getDomainXml(env), env.getInstanceName());
} catch (IOException e) {
throw new ConfigPopulatorException(localStrings.getLocalString("ConfigParsingFailed", "Failed to parse domain.xml"), e);
}
// run the upgrades...
if ("upgrade".equals(context.getPlatformMainServiceName())) {
upgrade();
}
// run the cleanup.
for (ServiceHandle<?> cc : habitat.getAllServiceHandles(ConfigurationCleanup.class)) {
try {
// run the upgrade
cc.getService();
lr = new LogRecord(Level.FINE, successfulCleanupWith + cc.getClass());
lr.setLoggerName(getClass().getName());
EarlyLogHandler.earlyMessages.add(lr);
} catch (Exception e) {
lr = new LogRecord(Level.FINE, e.toString() + e);
lr.setLoggerName(getClass().getName());
EarlyLogHandler.earlyMessages.add(lr);
lr = new LogRecord(Level.SEVERE, cc.getClass() + cleaningDomainXmlFailed + e);
lr.setLoggerName(getClass().getName());
EarlyLogHandler.earlyMessages.add(lr);
}
}
decorate();
}
Aggregations