Skip to content

Commit

Permalink
Remove obsolete DependentStorageRequest
Browse files Browse the repository at this point in the history
Remove removal method from BeanStore and dependencies to that
Change tests to use creation contexts
Fix some broken tests

git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2933 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
nickarls committed Jun 30, 2009
1 parent 3c454c1 commit 0eb0871
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 157 deletions.
Expand Up @@ -19,7 +19,6 @@
import java.lang.annotation.Annotation;

import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;

/**
* Common Context operation
Expand Down Expand Up @@ -94,7 +93,5 @@ protected Boolean getActive()
{
return active.get();
}

public abstract <T> void destroyAndRemove(Contextual<T> contextual, T instance);

}
Expand Up @@ -120,18 +120,6 @@ public <T> T get(Contextual<T> contextual)
{
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)
{
Expand Down

This file was deleted.

@@ -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;
Expand Down Expand Up @@ -86,19 +84,4 @@ public <T> T createBeanInstance(Bean<T> bean)
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);
}
}



}
Expand Up @@ -37,14 +37,6 @@ public interface BeanStore
*/
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
*/
Expand Down
Expand Up @@ -33,21 +33,6 @@ public <T extends Object> BeanInstance<T> get(Contextual<? extends T> bean)
return instance;
}

/**
* 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
*
Expand Down
Expand Up @@ -29,11 +29,6 @@ public <T> void put(BeanInstance<T> beanInstance)
{
delegate().put(beanInstance);
}

public <T> T remove(Contextual<? extends T> bean)
{
return delegate().remove(bean);
}

@Override
public String toString()
Expand Down

0 comments on commit 0eb0871

Please sign in to comment.