Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@402 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Dec 4, 2008
1 parent b2658ff commit 56183b0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
Expand Up @@ -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;
Expand Down
Expand Up @@ -305,6 +305,7 @@ protected AbstractBean<? extends T, Class<T>> getSpecializedType()
Class<?> superclass = getAnnotatedItem().getType().getSuperclass();
if (superclass != null)
{
// TODO look up this bean and do this via init
return new EnterpriseBean(superclass, getManager());
}
else
Expand Down
Expand Up @@ -328,6 +328,7 @@ protected AbstractBean<? extends T, Class<T>> getSpecializedType()
Class<?> superclass = getAnnotatedItem().getType().getSuperclass();
if (superclass != null)
{
// TODO look up this bean and do this via init
return new SimpleBean(superclass, getManager());
}
else
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -56,11 +56,11 @@ public class Bootstrap
/**
* Constructor
*
* Starts up with a fresh manager
* Starts up with the singleton Manager
*/
public Bootstrap()
{
this(new ManagerImpl());
this(ManagerImpl.instance());
}

/**
Expand Down
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -94,7 +93,7 @@ public static void endSession(HttpSession session) {
* @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));
}
Expand Down Expand Up @@ -122,7 +121,6 @@ public static ServletContext getServletContext()
*
* @return The discoverer
*/
// TODO move some of this bootstrap for reuse outside Servlet
private static WebBeanDiscovery getWebBeanDiscovery()
{
WebBeanDiscovery webBeanDiscovery = null;
Expand Down

0 comments on commit 56183b0

Please sign in to comment.