}
ModelTools.releaseModelRequest(model);
for (Configuration config : sortedConfigs)
{
StartupHandler startup = null;
String id = config.getAttribute("id");
if (config.getAttribute("class", null) != null)
{
String className = config.getAttribute("class", null);
startup = (StartupHandler) Class.forName(className).newInstance();
}
else if (config.getAttribute("bean", null) != null)
{
String beanName = config.getAttribute("bean", null);
startup = (StartupHandler) KeelContainer.defaultContainer().getSpringBean(beanName);
}
if (startup instanceof AbstractStartupHandler)
{
if (((AbstractStartupHandler) startup).getLogger() == null)
{
((AbstractStartupHandler) startup).setLogger(log);
}
if (((AbstractStartupHandler) startup).getConfiguration() == null)
{
((AbstractStartupHandler) startup).setConfiguration(config);
}
}
try
{
log.info("Starting component " + id);
startup.startup();
}
catch (StartupException x)
{
log.error("Startup exception in handler '" + id + "': " + x);
}