[webbeans-commits] Webbeans SVN: r2933 - in ri/trunk: porting-package/src/main/java/org/jboss/webbeans/tck and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Jun 30 02:02:45 EDT 2009


Author: nickarls
Date: 2009-06-30 02:02:44 -0400 (Tue, 30 Jun 2009)
New Revision: 2933

Removed:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java
Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
   ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
Log:
Remove obsolete DependentStorageRequest
Remove removal method from BeanStore and dependencies to that
Change tests to use creation contexts
Fix some broken tests

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -19,7 +19,6 @@
 import java.lang.annotation.Annotation;
 
 import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
 
 /**
  * Common Context operation
@@ -94,7 +93,5 @@
    {
       return active.get();
    }
-   
-   public abstract <T> void destroyAndRemove(Contextual<T> contextual, T instance);
 
 }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -120,18 +120,6 @@
    {
       return get(contextual, null);
    }
-
-   /**
-    * Destroys and removes bean
-    * 
-    * @param <T> The type of the bean
-    * @param contextual The contextual type to destroy
-    */
-   public <T> void destroyAndRemove(Contextual<T> contextual, T instance)
-   {
-      destroy(contextual);
-      getBeanStore().remove(contextual);
-   }
    
    private <T> void destroy(Contextual<T> contextual)
    {

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.context;
-
-/**
- * A dependent instance store and storage key combination for selecting the correct receiving 
- * store and holding key for dependent instances in the dependent context
- *  
- * @author Nicklas Karlsson
- */
-public class DependentStorageRequest
-{
-   // The dependent instances store to target
-   private final DependentInstancesStore dependentInstancesStore;
-   // The key in the store
-   private final Object key;
-
-   /**
-    * Create a new DependentStoreKey
-    * 
-    * @param dependentInstancesStore The dependent instances store
-    * @param key The storage key
-    */
-   protected DependentStorageRequest(DependentInstancesStore dependentInstancesStore, Object key)
-   {
-      this.dependentInstancesStore = dependentInstancesStore;
-      this.key = key;
-   }
-
-   /**
-    * Static factory method
-    * 
-    * @param scopeType The scope type of the dependent instances store
-    * @param key The storage key
-    * @return A new DependentStoreKey
-    */
-   public static DependentStorageRequest of(DependentInstancesStore dependentInstancesStore, Object key)
-   {
-      return new DependentStorageRequest(dependentInstancesStore, key);
-   }
-
-   /**
-    * Gets the store
-    * 
-    * @return The store
-    */
-   public DependentInstancesStore getDependentInstancesStore()
-   {
-      return dependentInstancesStore;
-   }
-
-   /**
-    * Gets the key
-    * 
-    * @return The key
-    */
-   public Object getKey()
-   {
-      return key;
-   }
-
-   @Override
-   public boolean equals(Object other)
-   {
-      if (other instanceof DependentStorageRequest)
-      {
-         DependentStorageRequest that = (DependentStorageRequest) other;
-         if (this.getDependentInstancesStore().equals(that.getDependentInstancesStore()) && this.getKey().equals(that.getKey()))
-         {
-            return true;
-         }
-         else
-         {
-            return false;
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-}

Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -1,11 +1,9 @@
 package org.jboss.webbeans.tck;
 
-import javax.enterprise.context.spi.Context;
 import javax.enterprise.inject.spi.Bean;
 
 import org.jboss.jsr299.tck.spi.Beans;
 import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.context.AbstractContext;
 import org.jboss.webbeans.ejb.spi.EjbDescriptor;
 import org.jboss.webbeans.ejb.spi.EjbServices;
 import org.jboss.webbeans.util.Proxies;
@@ -86,19 +84,4 @@
       return (T) CurrentManager.rootManager().getCurrent().getReference(bean, Object.class, CurrentManager.rootManager().getCurrent().createCreationalContext(bean));
    }
 
-   public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance)
-   {
-      Context context = CurrentManager.rootManager().getCurrent().getContext(bean.getScopeType());
-      if (context instanceof AbstractContext)
-      {
-         ((AbstractContext) context).destroyAndRemove(bean, instance);
-      }
-      else
-      {
-         throw new IllegalStateException("Don't know how to destroy a bean from " + context);
-      }
-   }
-
-
-
 }

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -38,14 +38,6 @@
    public abstract <T> BeanInstance<T> get(Contextual<? extends T> bean);
 
    /**
-    * Removes an instance of a bean from the storage
-    * 
-    * @param bean The bean whose instance to remove
-    * @return The removed instance. Null if not found in storage.
-    */
-   public abstract <T extends Object> T remove(Contextual<? extends T> bean);
-
-   /**
     * Clears the storage of any bean instances
     */
    public abstract void clear();

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -34,21 +34,6 @@
    }
 
    /**
-    * Removed a instance from the store
-    * 
-    * @param bean the bean to remove
-    * @return The instance removed
-    *
-    * @see org.jboss.webbeans.context.api.BeanStore#remove(BaseBean)
-    */
-   public <T extends Object> T remove(Contextual<? extends T> bean)
-   {
-      @SuppressWarnings("unchecked")
-      T instance = (T) delegate().remove(bean);
-      return instance;
-   }
-
-   /**
     * Clears the store
     * 
     * @see org.jboss.webbeans.context.api.BeanStore#clear()

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java	2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java	2009-06-30 06:02:44 UTC (rev 2933)
@@ -29,11 +29,6 @@
    {
       delegate().put(beanInstance);
    }
-   
-   public <T> T remove(Contextual<? extends T> bean)
-   {
-      return delegate().remove(bean);
-   }
 
    @Override
    public String toString()




More information about the weld-commits mailing list