openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1363106 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/context/ webbeans-impl/src/main/java/org/apache/webbeans/context/type/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/ webbeans-porting/sr...
Date Wed, 18 Jul 2012 20:51:16 GMT
Author: struberg
Date: Wed Jul 18 20:51:15 2012
New Revision: 1363106

URL: http://svn.apache.org/viewvc?rev=1363106&view=rev
Log:
OWB-684 remove ContextTypes and switch to standard scope annotations

Removed:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/type/ContextTypes.java
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
    openwebbeans/trunk/webbeans-porting/src/main/java/org/apache/webbeans/test/tck/ContextsImpl.java
    openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
Wed Jul 18 20:51:15 2012
@@ -27,20 +27,13 @@ import java.util.Set;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentMap;
 
-import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.context.ConversationScoped;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.context.SessionScoped;
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
-import javax.inject.Singleton;
 
 import org.apache.webbeans.container.SerializableBean;
 import org.apache.webbeans.container.SerializableBeanVault;
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 
 /**
  * Abstract implementation of the {@link WebBeansContext} interfaces.
@@ -57,8 +50,6 @@ public abstract class AbstractContext im
     /**Context status, active or not*/
     protected volatile boolean active;
 
-    /**Context type*/
-    protected ContextTypes type;
 
     /**Context contextual instances*/
     protected Map<Contextual<?>, BeanInstanceBag<?>> componentInstanceMap
= null;
@@ -113,58 +104,6 @@ public abstract class AbstractContext im
     }
 
     /**
-     * Creates a new context with given context type.
-     * 
-     * @param type context type
-     */
-    protected AbstractContext(ContextTypes type)
-    {
-        this.type = type;
-        configureScopeType(type);
-        setComponentInstanceMap();
-    }
-
-    /**
-     * Configures scope type from context type.
-     * 
-     * @param type context type
-     */
-    private void configureScopeType(ContextTypes type)
-    {
-        if (type.equals(ContextTypes.APPLICATION))
-        {
-            scopeType = ApplicationScoped.class;
-        }
-        else if (type.equals(ContextTypes.SESSION))
-        {
-            scopeType = SessionScoped.class;
-        }
-        else if (type.equals(ContextTypes.REQUEST))
-        {
-            scopeType = RequestScoped.class;
-        }
-        else if (type.equals(ContextTypes.DEPENDENT))
-        {
-            scopeType = Dependent.class;
-        }
-        else if (type.equals(ContextTypes.CONVERSATION))
-        {
-            scopeType = ConversationScoped.class;
-        }
-        else if (type.equals(ContextTypes.SINGLETON))
-        {
-            scopeType = Singleton.class;
-        }
-        else
-        {
-            throw new IllegalArgumentException("Not known scope type : " + type.toString());
-        }
-
-    }
-    
-    
-
-    /**
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
@@ -307,25 +246,6 @@ public abstract class AbstractContext im
     }
 
     /**
-     * Type of the context.
-     * 
-     * @return type of the context
-     * @see ContextTypes
-     */
-    public ContextTypes getType()
-    {
-        return type;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<Contextual<?>, BeanInstanceBag<?>> getComponentInstanceMap()
-    {
-        return componentInstanceMap;
-    }
-
-    /**
      * {@inheritDoc}
      */
     public Class<? extends Annotation> getScope()
@@ -356,7 +276,6 @@ public abstract class AbstractContext im
     private void writeObject(ObjectOutputStream s)
     throws IOException
     {
-        s.writeObject(type);
         s.writeObject(scopeType);
 
         // we need to repack the Contextual<T> from the componentInstanceMap into Serializable
ones
@@ -388,7 +307,6 @@ public abstract class AbstractContext im
     private void readObject(ObjectInputStream s)
     throws IOException, ClassNotFoundException
     {
-        type = (ContextTypes) s.readObject();
         scopeType = (Class<? extends Annotation>) s.readObject();
 
         HashMap<Contextual<?>, BeanInstanceBag<?>> serializableInstanceMap
=

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ApplicationContext.java
Wed Jul 18 20:51:15 2012
@@ -20,10 +20,10 @@ package org.apache.webbeans.context;
 
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.spi.Contextual;
 
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 
 /**
  * Application context implementation.
@@ -33,7 +33,7 @@ public class ApplicationContext extends 
 {
     public ApplicationContext()
     {
-        super(ContextTypes.APPLICATION);
+        super(ApplicationScoped.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
Wed Jul 18 20:51:15 2012
@@ -23,14 +23,11 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.ConversationScoped;
-import javax.enterprise.context.Dependent;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.context.spi.Context;
 import javax.inject.Singleton;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.spi.ContextsService;
 import org.apache.webbeans.config.WebBeansContext;
@@ -176,55 +173,6 @@ public final class ContextFactory
     }
 
     /**
-     * Gets the current context with given type.
-     *
-     * @return the current context
-     * @throws ContextNotActiveException if context is not active
-     * @throws IllegalArgumentException if the type is not a standard context
-     */
-    public Context getStandardContext(ContextTypes type) throws ContextNotActiveException
-    {
-        ContextsService contextService = getContextsService();
-        return getStandardContext(contextService, type);
-    }
-
-    public Context getStandardContext(ContextsService contextService, ContextTypes type)
throws ContextNotActiveException
-    {
-        Context context;
-        switch (type.getCardinal())
-        {
-            case 0:
-                context = contextService.getCurrentContext(RequestScoped.class);
-                break;
-
-            case 1:
-                context = contextService.getCurrentContext(SessionScoped.class);
-                break;
-
-            case 2:
-                context = contextService.getCurrentContext(ApplicationScoped.class);
-                break;
-
-            case 3:
-                context = contextService.getCurrentContext(ConversationScoped.class);
-                break;
-
-            case 4:
-                context = contextService.getCurrentContext(Dependent.class);
-                break;
-
-            case 5:
-                context = contextService.getCurrentContext(Singleton.class);
-                break;
-
-            default:
-                throw new IllegalArgumentException("There is no such a standard context with
context id=" + type.getCardinal());
-        }
-
-        return context;
-    }
-
-    /**
      * Gets the standard context with given scope type.
      *
      * @return the current context, or <code>null</code> if no standard context
exists for the given scopeType

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
Wed Jul 18 20:51:15 2012
@@ -29,10 +29,10 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.enterprise.context.ConversationScoped;
 import javax.enterprise.context.spi.Contextual;
 
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
@@ -45,7 +45,7 @@ public class ConversationContext extends
      */
     public ConversationContext()
     {
-        super(ContextTypes.CONVERSATION);
+        super(ConversationScoped.class);
     }
 
     @Override
@@ -57,7 +57,6 @@ public class ConversationContext extends
     public void readExternal(ObjectInput in) throws IOException,
             ClassNotFoundException 
     {
-        type = (ContextTypes) in.readObject();
         scopeType = (Class<? extends Annotation>) in.readObject();
         Map<String, BeanInstanceBag<?>> map = (Map<String, BeanInstanceBag<?>>)in.readObject();
         setComponentInstanceMap();
@@ -79,7 +78,6 @@ public class ConversationContext extends
 
     public void writeExternal(ObjectOutput out) throws IOException 
     {
-            out.writeObject(type);
             out.writeObject(scopeType);
             Iterator<Contextual<?>> it = componentInstanceMap.keySet().iterator();
             Map<String, BeanInstanceBag<?>> map = new HashMap<String, BeanInstanceBag<?>>();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java
Wed Jul 18 20:51:15 2012
@@ -18,11 +18,10 @@
  */
 package org.apache.webbeans.context;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 
-import org.apache.webbeans.context.type.ContextTypes;
-
 /**
  * Defines the component {@link javax.enterprise.context.Dependent} context.
  * <p>
@@ -45,7 +44,7 @@ public class DependentContext extends Ab
      */
     public DependentContext()
     {
-        super(ContextTypes.DEPENDENT);
+        super(Dependent.class);
         active = true;
     }
     

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
Wed Jul 18 20:51:15 2012
@@ -20,10 +20,10 @@ package org.apache.webbeans.context;
 
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.spi.Contextual;
 
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 
 /**
  * Request context implementation.
@@ -38,7 +38,7 @@ public class RequestContext extends Abst
      */
     public RequestContext()
     {
-        super(ContextTypes.REQUEST);
+        super(RequestScoped.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
Wed Jul 18 20:51:15 2012
@@ -30,11 +30,11 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.enterprise.context.SessionScoped;
 import javax.enterprise.context.spi.Contextual;
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
@@ -46,7 +46,7 @@ public class SessionContext extends Abst
 
     public SessionContext()
     {
-        super(ContextTypes.SESSION);
+        super(SessionScoped.class);
     }
 
     @Override
@@ -60,7 +60,6 @@ public class SessionContext extends Abst
     {
         WebBeansContext webBeansContext = WebBeansContext.currentInstance();
 
-        type = (ContextTypes) in.readObject();
         scopeType = (Class<? extends Annotation>) in.readObject();
         Map<String, BeanInstanceBag<?>> map = (Map<String, BeanInstanceBag<?>>)in.readObject();
         setComponentInstanceMap();
@@ -82,7 +81,6 @@ public class SessionContext extends Abst
 
     public void writeExternal(ObjectOutput out) throws IOException 
     {
-        out.writeObject(type);
         out.writeObject(scopeType);
         Iterator<Contextual<?>> it = componentInstanceMap.keySet().iterator();
         Map<String, BeanInstanceBag<?>> map = new HashMap<String, BeanInstanceBag<?>>();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SingletonContext.java
Wed Jul 18 20:51:15 2012
@@ -21,9 +21,9 @@ package org.apache.webbeans.context;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.enterprise.context.spi.Contextual;
+import javax.inject.Singleton;
 
 import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
 
 /**
  * Application context implementation.
@@ -33,7 +33,7 @@ public class SingletonContext extends Ab
 {
     public SingletonContext()
     {
-        super(ContextTypes.SINGLETON);
+        super(Singleton.class);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
Wed Jul 18 20:51:15 2012
@@ -18,15 +18,10 @@
  */
 package org.apache.webbeans.context;
 
-import java.util.Map;
 
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 
-import org.apache.webbeans.context.creational.BeanInstanceBag;
-import org.apache.webbeans.context.type.ContextTypes;
-
-
 /**
  * Defines spi for contexts.
  *
@@ -51,21 +46,7 @@ public interface WebBeansContext extends
      * Destroys the context.
      */
     public void destroy();
-    
-    /**
-     * Returns context type.
-     * 
-     * @return context type
-     */
-    public ContextTypes getType();
-    
-    /**
-     * Returns instance map.
-     * 
-     * @return instance map
-     */
-    public Map<Contextual<?>, BeanInstanceBag<?>> getComponentInstanceMap();
-    
+
     /**
      * Gets creational context of the given bean.
      * @param <T> type
@@ -73,4 +54,4 @@ public interface WebBeansContext extends
      * @return creational context of the given bean
      */
     public <T> CreationalContext<T> getCreationalContext(Contextual<T>
contextual);
-}
\ No newline at end of file
+}

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
Wed Jul 18 20:51:15 2012
@@ -21,7 +21,6 @@ package org.apache.webbeans.newtests.con
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.SerializableBean;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.contexts.serialize.AppScopedBean;
 import org.apache.webbeans.newtests.contexts.serialize.SessScopedBean;
@@ -47,6 +46,7 @@ import org.junit.Test;
 
 import javassist.util.proxy.ProxyObject;
 
+import javax.enterprise.context.SessionScoped;
 import javax.enterprise.context.spi.Context;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
@@ -140,7 +140,7 @@ public class SerializationTest extends A
         
         // first we need to actually create a few instances
 
-        Context sessionContext = webBeansContext.getContextFactory().getStandardContext(ContextTypes.SESSION);
+        Context sessionContext = webBeansContext.getContextFactory().getStandardContext(SessionScoped.class);
         Assert.assertNotNull(sessionContext);
         byte[] ba = serializeObject(sessionContext);
         Assert.assertNotNull(ba);

Modified: openwebbeans/trunk/webbeans-porting/src/main/java/org/apache/webbeans/test/tck/ContextsImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-porting/src/main/java/org/apache/webbeans/test/tck/ContextsImpl.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-porting/src/main/java/org/apache/webbeans/test/tck/ContextsImpl.java
(original)
+++ openwebbeans/trunk/webbeans-porting/src/main/java/org/apache/webbeans/test/tck/ContextsImpl.java
Wed Jul 18 20:51:15 2012
@@ -18,13 +18,13 @@
  */
 package org.apache.webbeans.test.tck;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.RequestScoped;
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.AbstractContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.RequestContext;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.jboss.jsr299.tck.spi.Contexts;
 
 public class ContextsImpl implements Contexts<AbstractContext>
@@ -42,7 +42,7 @@ public class ContextsImpl implements Con
             contextFactory.initRequestContext(null);
         }
         
-        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.REQUEST);
+        return (AbstractContext) contextFactory.getStandardContext(RequestScoped.class);
     }
 
     public void setActive(AbstractContext context)
@@ -61,7 +61,7 @@ public class ContextsImpl implements Con
         WebBeansContext webBeansContext = WebBeansContext.getInstance();
         ContextFactory contextFactory = webBeansContext.getContextFactory();
 
-        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.DEPENDENT);
+        return (AbstractContext) contextFactory.getStandardContext(Dependent.class);
     }
 
     public void destroyContext(AbstractContext context)

Modified: openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java?rev=1363106&r1=1363105&r2=1363106&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
(original)
+++ openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
Wed Jul 18 20:51:15 2012
@@ -37,7 +37,6 @@ import javax.servlet.ServletContextEvent
 import org.apache.webbeans.cditest.CdiTestContainer;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
-import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.spi.ContainerLifecycle;
 
@@ -127,7 +126,7 @@ public class CdiTestOpenWebBeansContaine
         stopRequestScope();
         stopApplicationScope();
 
-        Context context = contextFactory.getStandardContext(ContextTypes.SINGLETON);
+        Context context = contextFactory.getStandardContext(Singleton.class);
         if(context != null && context.isActive())
         {
             contextFactory.destroySingletonContext(servletContext);
@@ -149,7 +148,7 @@ public class CdiTestOpenWebBeansContaine
         WebBeansContext webBeansContext = WebBeansContext.getInstance();
         ContextFactory contextFactory = webBeansContext.getContextFactory();
 
-        Context context = contextFactory.getStandardContext(ContextTypes.APPLICATION);
+        Context context = contextFactory.getStandardContext(ApplicationScoped.class);
         if(context != null && context.isActive())
         {
             contextFactory.destroyApplicationContext(servletContext);
@@ -168,7 +167,7 @@ public class CdiTestOpenWebBeansContaine
         WebBeansContext webBeansContext = WebBeansContext.getInstance();
         ContextFactory contextFactory = webBeansContext.getContextFactory();
 
-        Context context = contextFactory.getStandardContext(ContextTypes.CONVERSATION);
+        Context context = contextFactory.getStandardContext(ConversationScoped.class);
         if(context != null && context.isActive())
         {
             contextFactory.destroyConversationContext();
@@ -192,7 +191,7 @@ public class CdiTestOpenWebBeansContaine
         WebBeansContext webBeansContext = WebBeansContext.getInstance();
         ContextFactory contextFactory = webBeansContext.getContextFactory();
 
-        Context context = contextFactory.getStandardContext(ContextTypes.REQUEST);
+        Context context = contextFactory.getStandardContext(RequestScoped.class);
         if(context != null && context.isActive())
         {
             contextFactory.destroyRequestContext(null);
@@ -211,7 +210,7 @@ public class CdiTestOpenWebBeansContaine
         WebBeansContext webBeansContext = WebBeansContext.getInstance();
         ContextFactory contextFactory = webBeansContext.getContextFactory();
 
-        Context context = contextFactory.getStandardContext(ContextTypes.SESSION);
+        Context context = contextFactory.getStandardContext(SessionScoped.class);
         if(context != null && context.isActive())
         {
             contextFactory.destroySessionContext(session);



Mime
View raw message