openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r927152 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context: AbstractContext.java CustomContextImpl.java CustomPassivatingContextImpl.java WebBeansContext.java creational/WrappedCreationalContext.java
Date Wed, 24 Mar 2010 18:54:10 GMT
Author: struberg
Date: Wed Mar 24 18:54:09 2010
New Revision: 927152

URL: http://svn.apache.org/viewvc?rev=927152&view=rev
Log:
OWB-329 make AbstractContext#getCreationalContext an internal function again

This needs to be done because the information may run out of sync in custom contexts
when they destroy single contextuals.

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/CustomContextImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomPassivatingContextImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/WrappedCreationalContext.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=927152&r1=927151&r2=927152&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 Mar 24 18:54:09 2010
@@ -209,7 +209,7 @@ public abstract class AbstractContext im
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public <T> CreationalContext<T> getCreationalContext(Contextual<T>
contextual)
+    protected <T> CreationalContext<T> getCreationalContext(Contextual<T>
contextual)
     {
         Asserts.assertNotNull(contextual);
         if(this.creationalContextMap.containsKey(contextual))

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomContextImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomContextImpl.java?rev=927152&r1=927151&r2=927152&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomContextImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomContextImpl.java
Wed Mar 24 18:54:09 2010
@@ -22,7 +22,7 @@ import javax.enterprise.context.spi.Cont
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 
-class CustomContextImpl extends AbstractContext implements Context
+class CustomContextImpl implements Context
 {
     private Context context;
     
@@ -38,9 +38,6 @@ class CustomContextImpl extends Abstract
 
     public <T> T get(Contextual<T> component, CreationalContext<T> crreationalContext)
     {
-        //Adding creational context into creational context map
-        this.creationalContextMap.put(component, crreationalContext);
-        
         return this.context.get(component, crreationalContext);
     }
 
@@ -54,10 +51,4 @@ class CustomContextImpl extends Abstract
         return this.context.isActive();
     }
 
-    @Override
-    protected void setComponentInstanceMap()
-    {
-        //No-operation        
-    }
-
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomPassivatingContextImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomPassivatingContextImpl.java?rev=927152&r1=927151&r2=927152&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomPassivatingContextImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/CustomPassivatingContextImpl.java
Wed Mar 24 18:54:09 2010
@@ -33,10 +33,11 @@ public class CustomPassivatingContextImp
         super(context);
     }
 
-    public <T> T get(Contextual<T> contextual, CreationalContext<T> crreationalContext)
+    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
     {
         SerializableBeanVault sbv = SerializableBeanVault.getInstance();
-        return super.get(sbv.getSerializableBean(contextual), crreationalContext);
+        
+        return super.get(sbv.getSerializableBean(contextual), creationalContext);
     }
 
     public <T> T get(Contextual<T> contextual)

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=927152&r1=927151&r2=927152&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 Mar 24 18:54:09 2010
@@ -16,10 +16,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.type.ContextTypes;
 
+
 /**
  * Defines spi for contexts.
  * 
@@ -45,15 +45,4 @@ public interface WebBeansContext extends
      * @return instance map
      */
     public Map<Contextual<?>, Object> getComponentInstanceMap();
-    
-    /**
-     * Gets creational context info for given contextual instance.
-     * @param <T> type info
-     * @param contextual contextual 
-     * @return creational context info for given contextual
-     * 
-     * @deprecated A context must not rely on this information!
-     */
-    public <T> CreationalContext<T> getCreationalContext(Contextual<T>
contextual);
-        
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/WrappedCreationalContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/WrappedCreationalContext.java?rev=927152&r1=927151&r2=927152&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/WrappedCreationalContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/WrappedCreationalContext.java
Wed Mar 24 18:54:09 2010
@@ -37,7 +37,7 @@ class WrappedCreationalContext<T> extend
     public void push(T instance)
     {
         super.push(instance);
-        wrapped.push(instance);        
+        wrapped.push(instance);
     }
 
     @Override



Mime
View raw message