populator = new ConfigurationPopulator(
configModularityUtils.replacePropertiesWithCurrentValue(
configBeanDefaultValue.getXmlConfiguration(), configBeanDefaultValue)
, doc, parent);
} catch (Exception e) {
LocalStringManager localStrings =
new LocalStringManagerImpl(ConfigurationParser.class);
final String msg = localStrings.getLocalString(
"can.not.add.configuration.to.extension.point",
"Cannot add new configuration extension to the extension point.");
LOG.log(Level.SEVERE, msg, e);
}
else {
//Check that parent is not null!
populator = new ConfigurationPopulator(configBeanDefaultValue.getXmlConfiguration(), doc, parent);
}
populator.run(configParser);
try {
Class configBeanClass = configModularityUtils.getClassForFullName(configBeanDefaultValue.getConfigBeanClassName());
final ConfigBeanProxy pr = doc.getRoot().createProxy(configBeanClass);
ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() {
public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure {
boolean writeDefaultElementsToXml = Boolean.parseBoolean(System.getProperty("writeDefaultElementsToXml", "true"));
if (!writeDefaultElementsToXml) {
//Do not write default snippets to domain.xml
doc.getRoot().skipFromXml();
}
configModularityUtils.setConfigBean(pr, configBeanDefaultValue, param);
return param;
}
}, parent);
} catch (TransactionFailure e) {
LocalStringManager localStrings =
new LocalStringManagerImpl(ConfigurationParser.class);
final String msg = localStrings.getLocalString(
"can.not.add.configuration.to.extension.point",
"Cannot add new configuration extension to the extension point.");
LOG.log(Level.SEVERE, msg, e);
}