Author: pete.muir(a)jboss.org
Date: 2008-12-04 09:15:21 -0500 (Thu, 04 Dec 2008)
New Revision: 402
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
Log:
Oops
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-04
13:50:24 UTC (rev 401)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-04
14:15:21 UTC (rev 402)
@@ -72,6 +72,14 @@
*/
public class ManagerImpl implements Manager
{
+
+ private static ManagerImpl instance = new ManagerImpl();
+
+ public static ManagerImpl instance()
+ {
+ return instance;
+ }
+
private List<Class<? extends Annotation>> enabledDeploymentTypes;
private MetaDataCache metaDataCache;
private EventManager eventManager;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04
13:50:24 UTC (rev 401)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04
14:15:21 UTC (rev 402)
@@ -305,6 +305,7 @@
Class<?> superclass = getAnnotatedItem().getType().getSuperclass();
if (superclass != null)
{
+ // TODO look up this bean and do this via init
return new EnterpriseBean(superclass, getManager());
}
else
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-04
13:50:24 UTC (rev 401)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-04
14:15:21 UTC (rev 402)
@@ -328,6 +328,7 @@
Class<?> superclass = getAnnotatedItem().getType().getSuperclass();
if (superclass != null)
{
+ // TODO look up this bean and do this via init
return new SimpleBean(superclass, getManager());
}
else
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-04
13:50:24 UTC (rev 401)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-04
14:15:21 UTC (rev 402)
@@ -18,9 +18,9 @@
package org.jboss.webbeans.bootstrap;
import static org.jboss.webbeans.util.BeanFactory.createEnterpriseBean;
+import static org.jboss.webbeans.util.BeanFactory.createEventBean;
import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
-import static org.jboss.webbeans.util.BeanFactory.createEventBean;
import java.util.Arrays;
import java.util.HashSet;
@@ -56,11 +56,11 @@
/**
* Constructor
*
- * Starts up with a fresh manager
+ * Starts up with the singleton Manager
*/
public Bootstrap()
{
- this(new ManagerImpl());
+ this(ManagerImpl.instance());
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-04
13:50:24 UTC (rev 401)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-04
14:15:21 UTC (rev 402)
@@ -31,7 +31,6 @@
import org.jboss.webbeans.contexts.SessionContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.util.JNDI;
import org.jboss.webbeans.util.Reflections;
/**
@@ -94,7 +93,7 @@
* @param request The request
*/
public static void beginRequest(HttpServletRequest request) {
- ManagerImpl manager = (ManagerImpl) JNDI.lookup(MANAGER_JNDI_KEY);
+ ManagerImpl manager = ManagerImpl.instance();
SessionContext sessionContext = (SessionContext)
manager.getContext(SessionScoped.class);
sessionContext.setSession(request.getSession(true));
}
@@ -122,7 +121,6 @@
*
* @return The discoverer
*/
- // TODO move some of this bootstrap for reuse outside Servlet
private static WebBeanDiscovery getWebBeanDiscovery()
{
WebBeanDiscovery webBeanDiscovery = null;
Show replies by date