Author: chris.laprun(a)jboss.com
Date: 2009-07-24 13:51:51 -0400 (Fri, 24 Jul 2009)
New Revision: 13601
Modified:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java
Log:
- DefaultServletContainerFactory is used as a singleton but yet allows direct
instantiation. In particular, injecting it as an
MBean causes 2 instances to be created. The injected instance not being the
"singleton" one, this would cause dependent
MBeans to not be able to detect portlet deployments because registerContext would refer
to the "singleton" instance, not
the injected version. Hence, WebAppEvent listeners would be registered with the wrong
instance. We need to fix this design
issue better than making the current solution.
Modified:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java 2009-07-24
17:46:15 UTC (rev 13600)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java 2009-07-24
17:51:51 UTC (rev 13601)
@@ -42,7 +42,7 @@
}
/** . */
- private final DefaultServletContainer container = new DefaultServletContainer();
+ private static final DefaultServletContainer container = new
DefaultServletContainer();
/**
* Returns the singleton instance.
@@ -63,6 +63,6 @@
*/
public static void registerContext(ServletContainerContext context) throws
IllegalArgumentException
{
- instance.container.register(context);
+ container.register(context);
}
}
Show replies by date