private void configureRuntimeConfig()
{
RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(_externalContext);
FacesConfigData dispenser = getDispenser();
for (ManagedBean bean : dispenser.getManagedBeans())
{
if (log.isLoggable(Level.WARNING) && runtimeConfig.getManagedBean(bean.getManagedBeanName()) != null)
{
log.warning("More than one managed bean w/ the name of '" + bean.getManagedBeanName()
+ "' - only keeping the last ");
}
runtimeConfig.addManagedBean(bean.getManagedBeanName(), bean);
}
removePurgedBeansFromSessionAndApplication(runtimeConfig);
for (NavigationRule rule : dispenser.getNavigationRules())
{
runtimeConfig.addNavigationRule(rule);
}
for (String converterClassName : dispenser.getConverterConfigurationByClassName())
{
runtimeConfig.addConverterConfiguration(converterClassName,
_dispenser.getConverterConfiguration(converterClassName));
}
for (ResourceBundle bundle : dispenser.getResourceBundles())
{
runtimeConfig.addResourceBundle(bundle);
}
for (String className : dispenser.getElResolvers())
{
runtimeConfig.addFacesConfigElResolver((ELResolver)ClassUtils.newInstance(className, ELResolver.class));
}
runtimeConfig.setFacesVersion (dispenser.getFacesVersion());
runtimeConfig.setNamedEventManager(new NamedEventManager());
for (NamedEvent event : dispenser.getNamedEvents())
{
try
{
Class<? extends ComponentSystemEvent> clazz = ClassUtils.classForName(event.getEventClass());
runtimeConfig.getNamedEventManager().addNamedEvent(event.getShortName(), clazz);
} catch (ClassNotFoundException e) {
log.log(Level.SEVERE, "Named event could not be initialized, reason:",e);
}
}
for (FaceletsProcessing faceletsProcessing : dispenser.getFaceletsProcessing())
{
runtimeConfig.addFaceletProcessingConfiguration(faceletsProcessing.getFileExtension(), faceletsProcessing);
}
}