* @param servletConfig Information about the environment
* @throws ContainerConfigurationException If we can't use a bean
*/
public static void resolveListenerImplementations(DefaultContainer container, ServletConfig servletConfig) throws ContainerConfigurationException
{
ScriptSessionManager manager = container.getBean(ScriptSessionManager.class);
String implNames = container.getParameter(LocalUtil.originalDwrClassName(ScriptSessionListener.class.getName()));
if (implNames == null)
{
Loggers.STARTUP.debug("- No implementations of " + ScriptSessionListener.class.getSimpleName() + " to register");
return;
}
Loggers.STARTUP.debug("- Creating list of " + ScriptSessionListener.class.getSimpleName() + " from " + implNames);
implNames = implNames.replace(',', ' ');
for (String implName : implNames.split(" "))
{
if (implName.equals(""))
{
continue;
}
try
{
Class<?> impl = LocalUtil.classForName(implName);
if (!ScriptSessionListener.class.isAssignableFrom(impl))
{
Loggers.STARTUP.error(" - Can't cast: " + impl.getName() + " to " + ScriptSessionListener.class.getName());
}
else
{
@SuppressWarnings("unchecked")
Class<? extends ScriptSessionListener> i = (Class<? extends ScriptSessionListener>) impl;
ScriptSessionListener instance = i.newInstance();
manager.addScriptSessionListener(instance);
}
}
catch (Exception ex)
{
Loggers.STARTUP.error(" - Can't use : " + implName + " to implement " + ScriptSessionListener.class.getName() + ". Reason: " + ex);