[weld-commits] Weld SVN: r4007 - in core/trunk: impl/src/main/java/org/jboss/weld/introspector and 7 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Oct 13 11:44:15 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-10-13 11:44:15 -0400 (Tue, 13 Oct 2009)
New Revision: 4007

Added:
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Producers.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/NonContextual.java
Removed:
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AbstractProducer.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Any.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/BeanDisambiguator.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/DriversSeatProducer.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Plain.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Spare.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/SpareTireProducer.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotated.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedCallable.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedConstructor.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedField.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMember.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMethod.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedParameter.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedType.java
   core/trunk/inject-tck-runner/src/test/resources/META-INF/
Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
   core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
   core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
   core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
   core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
   core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java
   core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
   core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
   core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java
   core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java
   core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AtInjectTCK.java
   core/trunk/jboss-as/build.xml
Log:
support @BeanTypes, convert AtInject TCK to use it

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -24,6 +24,7 @@
 import javax.decorator.Decorates;
 import javax.enterprise.context.Dependent;
 import javax.enterprise.inject.Alternative;
+import javax.enterprise.inject.BeanTypes;
 import javax.enterprise.inject.Specializes;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.stereotype.Stereotype;
@@ -45,6 +46,7 @@
 import org.jboss.weld.metadata.cache.MergedStereotypes;
 import org.jboss.weld.metadata.cache.MetaAnnotationStore;
 import org.jboss.weld.util.Reflections;
+import org.jboss.weld.util.collections.Arrays2;
 
 /**
  * An abstract bean representation common for all beans
@@ -172,7 +174,14 @@
     */
    protected void initTypes()
    {
-      types = getAnnotatedItem().getTypeClosure();
+      if (getAnnotatedItem().isAnnotationPresent(BeanTypes.class))
+      {
+         types = Arrays2.<Type>asSet(getAnnotatedItem().getAnnotation(BeanTypes.class).value());
+      }
+      else
+      {
+         types = getAnnotatedItem().getTypeClosure();
+      }
    }
 
    /**
@@ -419,18 +428,6 @@
    }
 
    /**
-    * Checks if this beans annotated item is assignable from another annotated
-    * item
-    * 
-    * @param annotatedItem The other annotation to check
-    * @return True if assignable, otherwise false
-    */
-   public boolean isAssignableFrom(WeldAnnotated<?, ?> annotatedItem)
-   {
-      return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
-   }
-
-   /**
     * Indicates if bean is nullable
     * 
     * @return True if nullable, false otherwise

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -30,6 +30,7 @@
 import javax.enterprise.context.Dependent;
 import javax.enterprise.context.NormalScope;
 import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.BeanTypes;
 import javax.enterprise.inject.IllegalProductException;
 import javax.enterprise.inject.Produces;
 import javax.enterprise.inject.spi.InjectionPoint;
@@ -47,6 +48,7 @@
 import org.jboss.weld.util.Beans;
 import org.jboss.weld.util.Names;
 import org.jboss.weld.util.Reflections;
+import org.jboss.weld.util.collections.Arrays2;
 
 /**
  * The implicit producer bean
@@ -88,8 +90,12 @@
    @Override
    protected void initTypes()
    {
-      if (getType().isArray() || getType().isPrimitive())
+      if (getAnnotatedItem().isAnnotationPresent(BeanTypes.class))
       {
+         types = Arrays2.<Type>asSet(getAnnotatedItem().getAnnotation(BeanTypes.class).value());
+      }
+      else if (getType().isArray() || getType().isPrimitive())
+      {
          Set<Type> types = new HashSet<Type>();
          types.add(getType());
          types.add(Object.class);

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -41,7 +41,6 @@
 {
    // The underlying field
    private WeldField<T, X> field;
-   private final String id;
    
    /**
     * Creates a producer field
@@ -65,12 +64,11 @@
     */
    protected ProducerField(WeldField<T, X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
    {
-      super(new StringBuilder().append(ProducerField.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(field.getName()).toString(), declaringBean, manager);
+      super(new StringBuilder().append(ProducerField.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(".").append(field.getName()).toString(), declaringBean, manager);
       this.field = field;
       initType();
       initTypes();
       initBindings();
-      this.id = new StringBuilder().append(BEAN_ID_PREFIX).append(getClass().getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(getAnnotatedItem().getName()).toString();
       initStereotypes();
       initPolicy();
    }
@@ -168,12 +166,6 @@
    {
       return false;
    }
-   
-   @Override
-   public String getId()
-   {
-      return id;
-   }
 
    @Override
    public Set<Class<? extends Annotation>> getStereotypes()

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -32,6 +32,7 @@
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.event.Observes;
+import javax.enterprise.inject.BeanTypes;
 import javax.enterprise.inject.CreationException;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.InjectionTarget;
@@ -40,12 +41,12 @@
 import org.jboss.interceptor.model.InterceptionModel;
 import org.jboss.weld.BeanManagerImpl;
 import org.jboss.weld.DefinitionException;
-import org.jboss.weld.context.SerializableContextual;
 import org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter;
 import org.jboss.weld.bean.proxy.EnterpriseBeanInstance;
 import org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler;
 import org.jboss.weld.bean.proxy.Marker;
 import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.context.SerializableContextual;
 import org.jboss.weld.ejb.InternalEjbDescriptor;
 import org.jboss.weld.ejb.api.SessionObjectReference;
 import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
@@ -58,6 +59,7 @@
 import org.jboss.weld.resources.ClassTransformer;
 import org.jboss.weld.util.Beans;
 import org.jboss.weld.util.Proxies;
+import org.jboss.weld.util.collections.Arrays2;
 
 /**
  * An enterprise bean representation
@@ -188,13 +190,20 @@
    @Override
    protected void initTypes()
    {
-      Set<Type> types = new LinkedHashSet<Type>();
-      types.add(Object.class);
-      for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces())
+      if (getAnnotatedItem().isAnnotationPresent(BeanTypes.class))
       {
-         types.add(businessInterfaceDescriptor.getInterface());
+         types = Arrays2.<Type>asSet(getAnnotatedItem().getAnnotation(BeanTypes.class).value());
       }
-      super.types = types;
+      else
+      {
+         Set<Type> types = new LinkedHashSet<Type>();
+         types.add(Object.class);
+         for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces())
+         {
+            types.add(businessInterfaceDescriptor.getInterface());
+         }
+         super.types = types;
+      }
    }
 
    protected void initProxyClass()

Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -73,16 +73,6 @@
       return delegate().getJavaClass();
    }
 
-   public boolean isAssignableFrom(WeldAnnotated<?, ?> that)
-   {
-      return delegate().isAssignableFrom(that);
-   }
-
-   public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
-   {
-      return delegate().isAssignableFrom(type, actualTypeArguments);
-   }
-
    public boolean isFinal()
    {
       return delegate().isFinal();

Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -123,25 +123,6 @@
    public Class<T> getJavaClass();
 
    /**
-    * Extends Java Class assignability such that actual type parameters are also
-    * considered
-    * 
-    * @param that The other item to check assignability against
-    * @return True if assignable, false otherwise.
-    */
-   public boolean isAssignableFrom(WeldAnnotated<?, ?> that);
-
-   /**
-    * Extends Java Class assignability such that actual type parameters are also
-    * considered
-    * 
-    * @param type The type to compare against
-    * @param actualTypeArguments The type arguments
-    * @return True is assignable, false otherwise
-    */
-   public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments);
-
-   /**
     * Gets the actual type arguments for any parameterized types that this
     * AnnotatedItem represents.
     * 

Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -19,7 +19,6 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -28,6 +27,7 @@
 import org.jboss.weld.introspector.WeldAnnotated;
 import org.jboss.weld.util.Proxies;
 import org.jboss.weld.util.Reflections;
+import org.jboss.weld.util.collections.Arrays2;
 
 /**
  * Represents functionality common for all annotated items, mainly different
@@ -169,30 +169,6 @@
    }
 
    /**
-    * Checks if this item is assignable from another annotated item (through
-    * type and actual type arguments)
-    * 
-    * @param that The other annotated item to check against
-    * @return True if assignable, false otherwise
-    * 
-    * @see org.jboss.weld.introspector.WeldAnnotated#isAssignableFrom(WeldAnnotated)
-    */
-   public boolean isAssignableFrom(WeldAnnotated<?, ?> that)
-   {
-      return isAssignableFrom(that.getJavaClass(), that.getActualTypeArguments());
-   }
-
-   public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
-   {
-      return Reflections.isAssignableFrom(getJavaClass(), getActualTypeArguments(), type, actualTypeArguments);
-   }
-
-   public boolean isAssignableFrom(Type type)
-   {
-      return Reflections.isAssignableFrom(getBaseType(), type);
-   }
-
-   /**
     * Gets the hash code of the actual type
     * 
     * @return The hash code
@@ -260,7 +236,7 @@
 
    public Type[] getActualTypeArguments()
    {
-      return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
+      return Arrays2.copyOf(actualTypeArguments, actualTypeArguments.length);
    }
 
    public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()

Modified: core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -61,7 +61,7 @@
    @Override
    protected boolean matches(Resolvable resolvable, T bean)
    {
-      return Reflections.isAssignableFrom(resolvable.getTypeClosure(), bean.getTypes()) && Beans.containsAllBindings(resolvable.getQualifiers(), bean.getQualifiers(), manager);
+      return Reflections.matches(resolvable.getTypeClosure(), bean.getTypes()) && Beans.containsAllBindings(resolvable.getQualifiers(), bean.getQualifiers(), manager);
    }
    
    /**

Modified: core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -41,7 +41,7 @@
    @Override
    protected boolean matches(Resolvable resolvable, DecoratorImpl<?> bean)
    {
-      return Reflections.isAssignableFrom(bean.getDelegateTypes(), resolvable.getTypeClosure()) && Beans.containsAllBindings(bean.getDelegateQualifiers(), resolvable.getQualifiers(), getManager()) && getManager().getEnabledDecoratorClasses().contains(bean.getType());
+      return Reflections.matches(bean.getDelegateTypes(), resolvable.getTypeClosure()) && Beans.containsAllBindings(bean.getDelegateQualifiers(), resolvable.getQualifiers(), getManager()) && getManager().getEnabledDecoratorClasses().contains(bean.getType());
    }
    
    @Override

Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -51,30 +51,30 @@
  */
 public class Reflections
 {
-   
+
    private static final Log log = Logging.getLog(Reflections.class);
-   
+
    public static final Type[] EMPTY_TYPES = {};
-   
+
    public static final Annotation[] EMPTY_ANNOTATIONS = {};
 
    public static class HierarchyDiscovery
    {
-      
+
       private final Type type;
-     
+
       private Set<Type> types;
-      
+
       public HierarchyDiscovery(Type type)
       {
          this.type = type;
       }
-      
+
       protected void add(Type type)
       {
          types.add(type);
       }
-      
+
       public Set<Type> getFlattenedTypes()
       {
          if (types == null)
@@ -84,7 +84,7 @@
          }
          return types;
       }
-      
+
       public Type getResolvedType()
       {
          if (type instanceof Class)
@@ -94,18 +94,18 @@
          }
          return type;
       }
-      
+
       private void discoverTypes(Type type)
       {
          if (type != null)
-         {            
+         {
             if (type instanceof Class)
             {
                Class<?> clazz = (Class<?>) type;
                add(resolveType(clazz));
                discoverFromClass(clazz);
             }
-            else 
+            else
             {
                if (type instanceof ParameterizedType)
                {
@@ -119,7 +119,7 @@
             }
          }
       }
-      
+
       private Type resolveType(Class<?> clazz)
       {
          if (clazz.getTypeParameters().length > 0)
@@ -133,7 +133,7 @@
             return clazz;
          }
       }
-      
+
       @SuppressWarnings("unchecked")
       private void discoverFromClass(Class<?> clazz)
       {
@@ -151,7 +151,7 @@
             log.trace("Security exception scanning " + clazz.getName(), e);
          }
       }
-      
+
       /**
        * Gets the actual types by resolving TypeParameters.
        * 
@@ -186,7 +186,7 @@
          }
          return type;
       }
-      
+
       private Type resolveParameterizedType(ParameterizedType beanType, ParameterizedType parameterizedType)
       {
          Type rawType = parameterizedType.getRawType();
@@ -216,7 +216,7 @@
                return resolveType(type, actualTypes[i]);
             }
          }
-         
+
          // step2. generic super class
          Type genericSuperType = actualType.getGenericSuperclass();
          Type type = resolveType(genericSuperType, typeVariable);
@@ -224,7 +224,7 @@
          {
             return type;
          }
-         
+
          // step3. generic interfaces
          for (Type interfaceType : actualType.getGenericInterfaces())
          {
@@ -234,11 +234,11 @@
                return resolvedType;
             }
          }
-         
+
          // don't resolve type variable
          return typeVariable;
       }
-      
+
    }
 
    /**
@@ -320,7 +320,7 @@
    {
       return type.isPrimitive();
    }
-   
+
    public static boolean isPackagePrivate(int mod)
    {
       return !(Modifier.isPrivate(mod) || Modifier.isProtected(mod) || Modifier.isPublic(mod));
@@ -439,7 +439,7 @@
    {
       return type.getTypeParameters().length > 0;
    }
-   
+
    public static boolean isParamerterizedTypeWithWildcard(Class<?> type)
    {
       if (isParameterizedType(type))
@@ -451,7 +451,7 @@
          return false;
       }
    }
-   
+
    public static boolean containsWildcards(Type[] types)
    {
       for (Type type : types)
@@ -463,7 +463,7 @@
       }
       return false;
    }
-   
+
    public static Set<Type> createTypeClosure(Class<?> rawType, Type[] actualTypeArguments)
    {
       Type type = new ParameterizedTypeImpl(rawType, actualTypeArguments, rawType.getDeclaringClass());
@@ -498,7 +498,7 @@
          throw new RuntimeException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
       }
    }
-   
+
    public static Object invokeAndWrap(String methodName, Object instance, Object... parameters)
    {
       Class<?>[] parameterTypes = new Class<?>[parameters.length];
@@ -542,7 +542,7 @@
          throw new RuntimeException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
       }
    }
-   
+
    public static Object getAndWrap(String fieldName, Object target)
    {
       try
@@ -578,7 +578,7 @@
          throw new IllegalArgumentException(e);
       }
    }
-   
+
    /**
     * Looks up a method in the type hierarchy of an instance
     * 
@@ -591,7 +591,7 @@
    {
       return lookupMethod(methodName, parameterTypes, instance.getClass());
    }
-   
+
    private static Method lookupMethod(String methodName, Class<?>[] parameterTypes, Class<?> c) throws NoSuchMethodException
    {
       for (Class<? extends Object> clazz = c; clazz != null; clazz = clazz.getSuperclass())
@@ -623,11 +623,11 @@
       }
       throw new NoSuchMethodException("Method " + methodName + Arrays.asList(parameterTypes).toString().replace("[", "(").replace("]", ")") + " not implemented by instance " + c.getName());
    }
-   
+
    /**
     * Checks the bindingType to make sure the annotation was declared properly
-    * as a binding type (annotated with @BindingType) and that it has
-    * a runtime retention policy.
+    * as a binding type (annotated with @BindingType) and that it has a runtime
+    * retention policy.
     * 
     * @param binding The binding type to check
     * @return true only if the annotation is really a binding type
@@ -637,23 +637,23 @@
    public static boolean isBindings(Annotation binding)
    {
       boolean isBindingAnnotation = false;
-      if (binding.annotationType().isAnnotationPresent(Qualifier.class) &&
-         binding.annotationType().isAnnotationPresent(Retention.class) &&
-         binding.annotationType().getAnnotation(Retention.class).value().equals(RetentionPolicy.RUNTIME))
+      if (binding.annotationType().isAnnotationPresent(Qualifier.class) && binding.annotationType().isAnnotationPresent(Retention.class) && binding.annotationType().getAnnotation(Retention.class).value().equals(RetentionPolicy.RUNTIME))
       {
          isBindingAnnotation = true;
       }
       return isBindingAnnotation;
    }
-   
+
    /**
     * Check the assignability of one type to another, taking into account the
     * actual type arguements
     * 
     * @param rawType1 the raw type of the class to check
-    * @param actualTypeArguments1 the actual type arguements to check, or an empty array if not a parameterized type
+    * @param actualTypeArguments1 the actual type arguements to check, or an
+    *           empty array if not a parameterized type
     * @param rawType2 the raw type of the class to check
-    * @param actualTypeArguments2 the actual type arguements to check, or an empty array if not a parameterized type
+    * @param actualTypeArguments2 the actual type arguements to check, or an
+    *           empty array if not a parameterized type
     * @return
     */
    public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2)
@@ -661,6 +661,11 @@
       return Types.boxedClass(rawType1).isAssignableFrom(Types.boxedClass(rawType2)) && isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
    }
    
+   public static boolean matches(Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2)
+   {
+      return Types.boxedClass(rawType1).equals(Types.boxedClass(rawType2)) && isAssignableFrom(actualTypeArguments1, actualTypeArguments2);
+   }
+
    public static boolean isAssignableFrom(Type[] actualTypeArguments1, Type[] actualTypeArguments2)
    {
       for (int i = 0; i < actualTypeArguments1.length; i++)
@@ -678,7 +683,7 @@
       }
       return true;
    }
-   
+
    public static boolean isAssignableFrom(Type type1, Set<? extends Type> types2)
    {
       for (Type type2 : types2)
@@ -691,6 +696,18 @@
       return false;
    }
    
+   public static boolean matches(Type type1, Set<? extends Type> types2)
+   {
+      for (Type type2 : types2)
+      {
+         if (matches(type1, type2))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+
    public static boolean isAssignableFrom(Type type1, Type[] types2)
    {
       for (Type type2 : types2)
@@ -702,7 +719,7 @@
       }
       return false;
    }
-   
+
    public static boolean isAssignableFrom(Type type1, Type type2)
    {
       if (type1 instanceof Class)
@@ -759,6 +776,62 @@
       return false;
    }
    
+   public static boolean matches(Type type1, Type type2)
+   {
+      if (type1 instanceof Class<?>)
+      {
+         Class<?> clazz = (Class<?>) type1;
+         if (matches(clazz, EMPTY_TYPES, type2))
+         {
+            return true;
+         }
+      }
+      if (type1 instanceof ParameterizedType)
+      {
+         ParameterizedType parameterizedType1 = (ParameterizedType) type1;
+         if (parameterizedType1.getRawType() instanceof Class)
+         {
+            if (matches((Class<?>) parameterizedType1.getRawType(), parameterizedType1.getActualTypeArguments(), type2))
+            {
+               return true;
+            }
+         }
+      }
+      if (type1 instanceof WildcardType)
+      {
+         WildcardType wildcardType = (WildcardType) type1;
+         if (isTypeBounded(type2, wildcardType.getLowerBounds(), wildcardType.getUpperBounds()))
+         {
+            return true;
+         }
+      }
+      if (type2 instanceof WildcardType)
+      {
+         WildcardType wildcardType = (WildcardType) type2;
+         if (isTypeBounded(type1, wildcardType.getUpperBounds(), wildcardType.getLowerBounds()))
+         {
+            return true;
+         }
+      }
+      if (type1 instanceof TypeVariable<?>)
+      {
+         TypeVariable<?> typeVariable = (TypeVariable<?>) type1;
+         if (isTypeBounded(type2, EMPTY_TYPES, typeVariable.getBounds()))
+         {
+            return true;
+         }
+      }
+      if (type2 instanceof TypeVariable<?>)
+      {
+         TypeVariable<?> typeVariable = (TypeVariable<?>) type2;
+         if (isTypeBounded(type1, typeVariable.getBounds(), EMPTY_TYPES))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+
    public static boolean isTypeBounded(Type type, Type[] lowerBounds, Type[] upperBounds)
    {
       if (lowerBounds.length > 0)
@@ -777,7 +850,7 @@
       }
       return true;
    }
-   
+
    public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1, Type type2)
    {
       if (type2 instanceof ParameterizedType)
@@ -802,9 +875,33 @@
       return false;
    }
    
+   public static boolean matches(Class<?> rawType1, Type[] actualTypeArguments1, Type type2)
+   {
+      if (type2 instanceof ParameterizedType)
+      {
+         ParameterizedType parameterizedType = (ParameterizedType) type2;
+         if (parameterizedType.getRawType() instanceof Class<?>)
+         {
+            if (matches(rawType1, actualTypeArguments1, (Class<?>) parameterizedType.getRawType(), parameterizedType.getActualTypeArguments()))
+            {
+               return true;
+            }
+         }
+      }
+      else if (type2 instanceof Class<?>)
+      {
+         Class<?> clazz = (Class<?>) type2;
+         if (matches(rawType1, actualTypeArguments1, clazz, EMPTY_TYPES))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+
    /**
-    * Check the assiginability of a set of <b>flattened</b> types. This algorithm
-    * will check whether any of the types1 matches a type in types2
+    * Check the assiginability of a set of <b>flattened</b> types. This
+    * algorithm will check whether any of the types1 matches a type in types2
     * 
     * @param types1
     * @param types2
@@ -823,13 +920,32 @@
    }
    
    /**
-    * Check the assiginability of a set of <b>flattened</b> types. This algorithm
-    * will check whether any of the types1 matches a type in types2
+    * Check whether whether any of the types1 matches a type in types2
     * 
     * @param types1
     * @param types2
     * @return
     */
+   public static boolean matches(Set<Type> types1, Set<Type> types2)
+   {
+      for (Type type : types1)
+      {
+         if (matches(type, types2))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+
+   /**
+    * Check the assiginability of a set of <b>flattened</b> types. This
+    * algorithm will check whether any of the types1 matches a type in types2
+    * 
+    * @param types1
+    * @param types2
+    * @return
+    */
    public static boolean isAssignableFrom(Set<Type> types1, Type type2)
    {
       for (Type type : types1)
@@ -841,7 +957,7 @@
       }
       return false;
    }
-   
+
    public static boolean isAssignableFrom(Type[] types1, Type type2)
    {
       for (Type type : types1)
@@ -858,7 +974,7 @@
    {
       return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
    }
-   
+
    public static Field ensureAccessible(Field field)
    {
       if (!field.isAccessible() && !isIgnorePackage(field.getDeclaringClass().getPackage()))
@@ -867,7 +983,7 @@
       }
       return field;
    }
-   
+
    public static Method ensureAccessible(Method method)
    {
       if (!method.isAccessible() && !isIgnorePackage(method.getDeclaringClass().getPackage()))
@@ -876,7 +992,7 @@
       }
       return method;
    }
-   
+
    public static <T> Constructor<T> ensureAccessible(Constructor<T> constructor)
    {
       Class<?> c = constructor.getDeclaringClass();
@@ -887,7 +1003,7 @@
       }
       return constructor;
    }
-   
+
    private static boolean isIgnorePackage(Package pkg)
    {
       if (pkg != null)
@@ -913,5 +1029,4 @@
       }
    }
 
-
 }

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AbstractProducer.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AbstractProducer.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AbstractProducer.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,27 +0,0 @@
-package org.jboss.weld.atinject.tck;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.InjectionTarget;
-
-public class AbstractProducer<T>
-{
-
-   protected final InjectionTarget<T> injectionTarget;
-   protected final BeanManager beanManager;
-
-   public AbstractProducer(BeanManager beanManager, Class<T> type)
-   {
-      this.injectionTarget = beanManager.createInjectionTarget(beanManager.createAnnotatedType(type));
-      this.beanManager = beanManager;
-   }
-
-   public T produce()
-   {
-      CreationalContext<T> ctx = beanManager.createCreationalContext(null);
-      T instance = injectionTarget.produce(ctx);
-      injectionTarget.inject(instance, ctx);
-      return instance;
-   }
-
-}
\ No newline at end of file

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Any.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Any.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Any.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,47 +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.weld.atinject.tck;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- * A built-in binding type that is implicitly applied to all beans which do not
- * have the {@link New} built-in binding type.
- * 
- * @author Gavin King
- * @author David Allen
- */
-
- at Qualifier
- at Retention(RUNTIME)
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
-public @interface Any
-{
-
-}

Modified: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AtInjectTCK.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AtInjectTCK.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/AtInjectTCK.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -15,7 +15,6 @@
 import org.atinject.tck.auto.Tire;
 import org.atinject.tck.auto.V8Engine;
 import org.atinject.tck.auto.accessories.Cupholder;
-import org.atinject.tck.auto.accessories.SpareTire;
 import org.jboss.weld.mock.MockEELifecycle;
 import org.jboss.weld.mock.TestContainer;
 
@@ -37,10 +36,8 @@
          Cupholder.class,
          FuelTank.class,
          Tire.class,
-         SpareTire.class,
-         // Two producer method which allow us to expose SpareTire and Drivers seat with qualifiers
-         DriversSeatProducer.class,
-         SpareTireProducer.class
+         // Producer Methods allowing to expose DriversSeat, SpareTire, @Named("spare") SpareTire, @Drivers Seat
+         Producers.class
       );
    
    /**

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/BeanDisambiguator.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/BeanDisambiguator.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/BeanDisambiguator.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,413 +0,0 @@
-package org.jboss.weld.atinject.tck;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
-import javax.inject.Inject;
-
-import org.atinject.tck.auto.Convertible;
-import org.atinject.tck.auto.Tire;
-import org.jboss.weld.atinject.tck.util.ForwardingAnnotatedConstructor;
-import org.jboss.weld.atinject.tck.util.ForwardingAnnotatedField;
-import org.jboss.weld.atinject.tck.util.ForwardingAnnotatedMethod;
-import org.jboss.weld.atinject.tck.util.ForwardingAnnotatedParameter;
-import org.jboss.weld.atinject.tck.util.ForwardingAnnotatedType;
-
-public class BeanDisambiguator implements Extension
-{
-
-   private static final Annotation PLAIN_LITERAL = new AnnotationLiteral<Plain>()
-   {
-   };
-
-   /**
-    * Modufy the class metadata that 299 will use when building beans
-    */
-   public void observe(@Observes ProcessAnnotatedType<?> pat)
-   {
-      addPlainQualifierToTireBean(pat);
-      addPlainQualifierToConvertibleConstructor(pat);
-      addPlainQualifierToConvertiblePlainTireField(pat);
-      addPlainQualifierToConvertibleInjectInstanceMethodWithManyArgs(pat);
-   }
-   
-   /**
-    * Adjust the injectInstanceMethodWithManyArgs injectable method on {@link Convertible} so that parameters 
-    * 2 and 6 ({@code plainTire} and {@code plainTireProvider}) additionally have the @Plain annotation 
-    */
-   private <X> void addPlainQualifierToConvertibleInjectInstanceMethodWithManyArgs(ProcessAnnotatedType<X> pat)
-   {
-      if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
-      {
-         final AnnotatedType<X> original = pat.getAnnotatedType();
-
-         final Set<AnnotatedMethod<? super X>> methods = new HashSet<AnnotatedMethod<? super X>>();
-         for (final AnnotatedMethod<? super X> method : original.getMethods())
-         {
-            if (method.getJavaMember().getName().equals("injectInstanceMethodWithManyArgs"))
-            {
-               methods.add(qualifyParameterWithPlain(method, 2, 6));
-            }
-            else
-            {
-               methods.add(method);
-            }
-         }
-
-         pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
-         {
-
-            @Override
-            protected AnnotatedType<X> delegate()
-            {
-               return original;
-            }
-
-            @Override
-            public Set<AnnotatedMethod<? super X>> getMethods()
-            {
-               return methods;
-            }
-
-         });
-      }
-   }
-   
-   
-   /**
-    * Add the @Plain qualifier to the field {@code fieldPlainTire} and @{code fieldPlainTireProvider} of {@link Convertible}
-    * 
-    */
-   private <X> void addPlainQualifierToConvertiblePlainTireField(ProcessAnnotatedType<X> pat)
-   {
-      if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
-      {
-         final AnnotatedType<X> original = pat.getAnnotatedType();
-         
-         final Set<AnnotatedField<? super X>> fields = new HashSet<AnnotatedField<? super X>>();
-         
-         for (final AnnotatedField<? super X> field : original.getFields())
-         {
-            if (field.getJavaMember().getName().equals("fieldPlainTire") || field.getJavaMember().getName().equals("fieldPlainTireProvider"))
-            {
-               fields.add(addPlainQualifierToField(field));
-            }
-            else
-            {
-               fields.add(field);
-            }
-         }
-         
-         pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
-         {
-            
-            @Override
-            public Set<AnnotatedField<? super X>> getFields()
-            {
-               return fields;
-            }
-            
-            @Override
-            protected AnnotatedType<X> delegate()
-            {
-               return original;
-            }
-            
-         });
-      }
-   }
-
-   /**
-    * Add the @Plain qualifier to the parameters 2 and 6 ({@code plainTire} and {@code plainTireProvider}) of the constructor of {@link Convertible}
-    * 
-    */
-   private <X> void addPlainQualifierToConvertibleConstructor(ProcessAnnotatedType<X> pat)
-   {
-      if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
-      {
-         final AnnotatedType<X> original = pat.getAnnotatedType();
-
-         final Set<AnnotatedConstructor<X>> constructors = new HashSet<AnnotatedConstructor<X>>();
-         for (final AnnotatedConstructor<X> constructor : original.getConstructors())
-         {
-            if (constructor.isAnnotationPresent(Inject.class))
-            {
-               constructors.add(qualifyParameterWithPlain(constructor, 2, 6));
-            }
-            else
-            {
-               constructors.add(constructor);
-            }
-         }
-
-         pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
-         {
-
-            @Override
-            protected AnnotatedType<X> delegate()
-            {
-               return original;
-            }
-
-            @Override
-            public Set<AnnotatedConstructor<X>> getConstructors()
-            {
-               return constructors;
-            }
-
-         });
-      }
-   }
-
-   /**
-    * Add the @Plain annotation to the {@link Tire} class
-    * 
-    */
-   private <X> void addPlainQualifierToTireBean(ProcessAnnotatedType<X> pat)
-   {
-      if (pat.getAnnotatedType().getJavaClass().equals(Tire.class))
-      {
-         final Set<Annotation> annotations = new HashSet<Annotation>();
-         annotations.addAll(pat.getAnnotatedType().getAnnotations());
-         annotations.add(PLAIN_LITERAL);
-         final AnnotatedType<X> original = pat.getAnnotatedType();
-         pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
-         {
-
-            @Override
-            protected AnnotatedType<X> delegate()
-            {
-               return original;
-            }
-
-            @SuppressWarnings("unchecked")
-            @Override
-            public <A extends Annotation> A getAnnotation(Class<A> annotationType)
-            {
-               if (annotationType.equals(Plain.class))
-               {
-                  return (A) PLAIN_LITERAL;
-               }
-               else
-               {
-                  return delegate().getAnnotation(annotationType);
-               }
-            }
-
-            @Override
-            public Set<Annotation> getAnnotations()
-            {
-               return annotations;
-            }
-
-            @Override
-            public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
-            {
-               if (annotationType.equals(Plain.class))
-               {
-                  return true;
-               }
-               else
-               {
-                  return delegate().isAnnotationPresent(annotationType);
-               }
-            }
-
-         });
-      }
-   }
-   
-   /**
-    * Utility method to add the @Plain qualifier to a list of parameters
-    */
-   private <X> List<AnnotatedParameter<X>> qualifyParameterWithPlain(final List<AnnotatedParameter<X>> parameters, Integer... position)
-   {
-      Collection<Integer> positions = Arrays.asList(position);
-      final List<AnnotatedParameter<X>> newParameters = new ArrayList<AnnotatedParameter<X>>();
-
-      for (final AnnotatedParameter<X> parameter : parameters)
-      {
-         if (positions.contains(parameter.getPosition()))
-         {
-            newParameters.add(addPlainQualifierToParameter(parameter));
-         }
-         else
-         {
-            newParameters.add(parameter);
-         }
-      }
-      
-      return newParameters;
-      
-   }
-   
-   /**
-    * Utility method to add the @Plain qualifier to a method
-    */
-   private <X> AnnotatedMethod<X> qualifyParameterWithPlain(final AnnotatedMethod<X> method, Integer... position)
-   {
-      final List<AnnotatedParameter<X>> parameters = qualifyParameterWithPlain(method.getParameters(), position);
-      return new ForwardingAnnotatedMethod<X>()
-      {
-
-         @Override
-         public List<AnnotatedParameter<X>> getParameters()
-         {
-            return parameters;
-         }
-
-         @Override
-         protected AnnotatedMethod<X> delegate()
-         {
-            return method;
-         }
-
-      };
-   }
-   
-   /**
-    * Utility method to add the @Plain qualifier to a constructor
-    */
-   private <X> AnnotatedConstructor<X> qualifyParameterWithPlain(final AnnotatedConstructor<X> constructor, Integer... position)
-   {
-      final List<AnnotatedParameter<X>> parameters = qualifyParameterWithPlain(constructor.getParameters(), position);
-      return new ForwardingAnnotatedConstructor<X>()
-      {
-
-         @Override
-         public List<AnnotatedParameter<X>> getParameters()
-         {
-            return parameters;
-         }
-
-         @Override
-         protected AnnotatedConstructor<X> delegate()
-         {
-            return constructor;
-         }
-
-      };
-   }
-   
-   /**
-    * Utility method to add the @Plain qualifier to a parameter
-    */
-   private <X> AnnotatedParameter<X> addPlainQualifierToParameter(final AnnotatedParameter<X> parameter)
-   {
-      final Set<Annotation> annotations = new HashSet<Annotation>();
-      annotations.addAll(parameter.getAnnotations());
-      annotations.add(PLAIN_LITERAL);
-      return new ForwardingAnnotatedParameter<X>()
-      {
-         
-         @Override
-         protected AnnotatedParameter<X> delegate()
-         {
-            return parameter;
-         }
-         
-         @SuppressWarnings("unchecked")
-         @Override
-         public <A extends Annotation> A getAnnotation(Class<A> annotationType)
-         {
-            if (annotationType.equals(Plain.class))
-            {
-               return (A) PLAIN_LITERAL;
-            }
-            else
-            {
-               return delegate().getAnnotation(annotationType);
-            }
-         }
-         
-         @Override
-         public Set<Annotation> getAnnotations()
-         {
-            return annotations;
-         }
-         
-         @Override
-         public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
-         {
-            if (annotationType.equals(Plain.class))
-            {
-               return true;
-            }
-            else
-            {
-               return delegate().isAnnotationPresent(annotationType);
-            }
-         }
-         
-      };
-   }
-   
-   /**
-    * Utility method to add the @Plain qualifier to a field
-    */
-   private <X> AnnotatedField<X> addPlainQualifierToField(final AnnotatedField<X> field)
-   {
-      final Set<Annotation> annotations = new HashSet<Annotation>();
-      annotations.addAll(field.getAnnotations());
-      annotations.add(PLAIN_LITERAL);
-      return new ForwardingAnnotatedField<X>()
-      {
-         
-         @SuppressWarnings("unchecked")
-         @Override
-         public <A extends Annotation> A getAnnotation(Class<A> annotationType)
-         {
-            if (annotationType.equals(Plain.class))
-            {
-               return (A) PLAIN_LITERAL;
-            }
-            else
-            {
-               return delegate().getAnnotation(annotationType);
-            }
-         }
-         
-         @Override
-         public Set<Annotation> getAnnotations()
-         {
-            return annotations;
-         }
-         
-         @Override
-         public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
-         {
-            if (annotationType.equals(Plain.class))
-            {
-               return true;
-            }
-            else
-            {
-               return delegate().isAnnotationPresent(annotationType);
-            }
-         }
-         
-         @Override
-         protected AnnotatedField<X> delegate()
-         {
-            return field;
-         }
-         
-      };
-   }
-
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/DriversSeatProducer.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/DriversSeatProducer.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/DriversSeatProducer.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,26 +0,0 @@
-package org.jboss.weld.atinject.tck;
-
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-
-import org.atinject.tck.auto.Drivers;
-import org.atinject.tck.auto.DriversSeat;
-
-public class DriversSeatProducer extends AbstractProducer<DriversSeat>
-{
-   
-   @Inject
-   public DriversSeatProducer(BeanManager beanManager)
-   {
-      super(beanManager, DriversSeat.class);
-   }
-
-   @Override
-   @Produces @Drivers
-   public DriversSeat produce()
-   {
-      return super.produce();
-   }
-   
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Plain.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Plain.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Plain.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,39 +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.weld.atinject.tck;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
- at Qualifier
- at Retention(RUNTIME)
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
-public @interface Plain
-{
-
-}

Copied: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Producers.java (from rev 4003, core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/DriversSeatProducer.java)
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Producers.java	                        (rev 0)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Producers.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -0,0 +1,98 @@
+package org.jboss.weld.atinject.tck;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BeanTypes;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Qualifier;
+
+import org.atinject.tck.auto.Drivers;
+import org.atinject.tck.auto.DriversSeat;
+import org.atinject.tck.auto.Seat;
+import org.atinject.tck.auto.Tire;
+import org.atinject.tck.auto.accessories.SpareTire;
+import org.jboss.weld.atinject.tck.util.NonContextual;
+
+/**
+ * Producer methods for the @Inject TCK beans we need greater control over
+ * 
+ * @author pmuir
+ *
+ */
+public class Producers
+{
+   
+   private final NonContextual<SpareTire> spareTire;
+   private final NonContextual<DriversSeat> driversSeat;
+   
+   @Inject
+   public Producers(BeanManager beanManager)
+   {
+      this.spareTire = new NonContextual<SpareTire>(beanManager, SpareTire.class);
+      this.driversSeat = new NonContextual<DriversSeat>(beanManager, DriversSeat.class);
+   }
+
+   /**
+    * Producer method for a bean with qualifier @Drivers and types Seat, Object
+    * 
+    * @return
+    */
+   @Produces @Drivers
+   public Seat produceAtDriversSeat()
+   {
+      return driversSeat.newInstance().produce().inject().get();
+   }
+   
+   /**
+    * Producer method for a bean with default qualifiers and type DriversSeat only
+    * 
+    * @return
+    */
+   @Produces @BeanTypes(DriversSeat.class)
+   public DriversSeat produceDriversSeat()
+   {
+      return driversSeat.newInstance().produce().inject().get();
+   }
+   
+   @Qualifier
+   @Retention(RUNTIME)
+   @Target( { TYPE, METHOD, FIELD, PARAMETER })
+   @Documented
+   private @interface Spare
+   {
+
+   }
+   
+   /**
+    * Producer method for a bean with qualifier @Named("spare") and types Tire, Object.
+    * 
+    * Use the @Spare qualifier to stop @Default being applied 
+    * 
+    */
+   @Produces @Named("spare") @Spare
+   public Tire produceAtNamedSpareTire()
+   {
+      return spareTire.newInstance().produce().inject().get();
+   }
+   
+   /**
+    * Producet method for bean with default qualifiers and type SpareTire only
+    */
+   @Produces @BeanTypes(SpareTire.class)
+   public SpareTire produceSpareTire()
+   {
+      return spareTire.newInstance().produce().inject().get();
+   }
+   
+}


Property changes on: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Producers.java
___________________________________________________________________
Name: svn:eol-style
   + native

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Spare.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Spare.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/Spare.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,39 +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.weld.atinject.tck;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
- at Qualifier
- at Retention(RUNTIME)
- at Target( { TYPE, METHOD, FIELD, PARAMETER })
- at Documented
-public @interface Spare
-{
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/SpareTireProducer.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/SpareTireProducer.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/SpareTireProducer.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,26 +0,0 @@
-package org.jboss.weld.atinject.tck;
-
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.atinject.tck.auto.accessories.SpareTire;
-
-public class SpareTireProducer extends AbstractProducer<SpareTire>
-{
-
-   @Inject
-   public SpareTireProducer(BeanManager beanManager)
-   {
-      super(beanManager, SpareTire.class);
-   }
-   
-   @Override
-   @Produces @Named("spare") @Spare
-   public SpareTire produce()
-   {
-      return super.produce();
-   }
-   
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotated.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotated.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotated.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,81 +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.weld.atinject.tck.util;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Annotated;
-
-/**
- * Base class to allow implementation of the decorator pattern
- * 
- * @author Pete Muir
- *
- * @param <T> the base type
- * @param <S> the annotated element type
- */
-public abstract class ForwardingAnnotated implements Annotated
-{
-
-   protected abstract Annotated delegate();
-
-   public <A extends Annotation> A getAnnotation(Class<A> annotationType)
-   {
-      return delegate().getAnnotation(annotationType);
-   }
-
-   public Set<Annotation> getAnnotations()
-   {
-      return delegate().getAnnotations();
-   }
-
-   public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
-   {
-      return delegate().isAnnotationPresent(annotationType);
-   }
-
-   public Type getBaseType()
-   {
-      return delegate().getBaseType();
-   }
-
-   public Set<Type> getTypeClosure()
-   {
-      return delegate().getTypeClosure();
-   }
-
-   @Override
-   public boolean equals(Object obj)
-   {
-      return delegate().equals(obj);
-   }
-
-   @Override
-   public int hashCode()
-   {
-      return delegate().hashCode();
-   }
-
-   @Override
-   public String toString()
-   {
-      return delegate().toString();
-   }
-
-}
\ No newline at end of file

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedCallable.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedCallable.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedCallable.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,19 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.util.List;
-
-import javax.enterprise.inject.spi.AnnotatedCallable;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-public abstract class ForwardingAnnotatedCallable<X> extends ForwardingAnnotatedMember<X> implements AnnotatedCallable<X>
-{
-
-   @Override
-   protected abstract AnnotatedCallable<X> delegate();
-
-   public List<AnnotatedParameter<X>> getParameters()
-   {
-      return delegate().getParameters();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedConstructor.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedConstructor.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedConstructor.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,19 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.lang.reflect.Constructor;
-
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-
-public abstract class ForwardingAnnotatedConstructor<X> extends ForwardingAnnotatedCallable<X> implements AnnotatedConstructor<X>
-{
-
-   @Override
-   protected abstract AnnotatedConstructor<X> delegate();
-   
-   @Override
-   public Constructor<X> getJavaMember()
-   {
-      return delegate().getJavaMember();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedField.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedField.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedField.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,19 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.lang.reflect.Field;
-
-import javax.enterprise.inject.spi.AnnotatedField;
-
-public abstract class ForwardingAnnotatedField<X> extends ForwardingAnnotatedMember<X> implements AnnotatedField<X>
-{
-
-   @Override
-   protected abstract AnnotatedField<X> delegate();
-   
-   @Override
-   public Field getJavaMember()
-   {
-      return delegate().getJavaMember();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMember.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMember.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMember.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,29 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.lang.reflect.Member;
-
-import javax.enterprise.inject.spi.AnnotatedMember;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-public abstract class ForwardingAnnotatedMember<X> extends ForwardingAnnotated implements AnnotatedMember<X>
-{
-
-   @Override
-   protected abstract AnnotatedMember<X> delegate();
-
-   public AnnotatedType<X> getDeclaringType()
-   {
-      return delegate().getDeclaringType();
-   }
-
-   public Member getJavaMember()
-   {
-      return delegate().getJavaMember();
-   }
-
-   public boolean isStatic()
-   {
-      return delegate().isStatic();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMethod.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMethod.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedMethod.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,19 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.lang.reflect.Method;
-
-import javax.enterprise.inject.spi.AnnotatedMethod;
-
-public abstract class ForwardingAnnotatedMethod<X> extends ForwardingAnnotatedCallable<X> implements AnnotatedMethod<X>
-{
-
-   @Override
-   protected abstract AnnotatedMethod<X> delegate();
-   
-   @Override
-   public Method getJavaMember()
-   {
-      return delegate().getJavaMember();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedParameter.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedParameter.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedParameter.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,22 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import javax.enterprise.inject.spi.AnnotatedCallable;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-public abstract class ForwardingAnnotatedParameter<X> extends ForwardingAnnotated implements AnnotatedParameter<X>
-{
-
-   @Override
-   protected abstract AnnotatedParameter<X> delegate();
-
-   public AnnotatedCallable<X> getDeclaringCallable()
-   {
-      return delegate().getDeclaringCallable();
-   }
-
-   public int getPosition()
-   {
-      return delegate().getPosition();
-   }
-
-}

Deleted: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedType.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedType.java	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/ForwardingAnnotatedType.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -1,36 +0,0 @@
-package org.jboss.weld.atinject.tck.util;
-
-import java.util.Set;
-
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-public abstract class ForwardingAnnotatedType<X> extends ForwardingAnnotated implements AnnotatedType<X>
-{
-
-   @Override
-   protected abstract AnnotatedType<X> delegate();
-
-   public Set<AnnotatedConstructor<X>> getConstructors()
-   {
-      return delegate().getConstructors();
-   }
-
-   public Set<AnnotatedField<? super X>> getFields()
-   {
-      return delegate().getFields();
-   }
-
-   public Class<X> getJavaClass()
-   {
-      return delegate().getJavaClass();
-   }
-
-   public Set<AnnotatedMethod<? super X>> getMethods()
-   {
-      return delegate().getMethods();
-   }   
-
-}

Added: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/NonContextual.java
===================================================================
--- core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/NonContextual.java	                        (rev 0)
+++ core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/NonContextual.java	2009-10-13 15:44:15 UTC (rev 4007)
@@ -0,0 +1,172 @@
+package org.jboss.weld.atinject.tck.util;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+/**
+ * Perform production, injection, lifecycle callbacks and cleanup on a non-contextual object
+ * 
+ * @author pmuir
+ *
+ * @param <T>
+ */
+public class NonContextual<T>
+{
+
+   // Store the injection target. The CDI spec doesn't require an implementation
+   // to cache it, so we do
+   private final InjectionTarget<T> injectionTarget;
+
+   // Store a reference to the CDI BeanManager
+   private final BeanManager beanManager;
+
+   /**
+    * Create an injector for the given class
+    */
+   public NonContextual(BeanManager manager, Class<T> clazz)
+   {
+      this.beanManager = manager;
+
+      // Generate an "Annotated Type"
+      AnnotatedType<T> type = manager.createAnnotatedType(clazz);
+
+      // Generate the InjectionTarget
+      this.injectionTarget = manager.createInjectionTarget(type);
+   }
+
+   public Instance<T> newInstance()
+   {
+      return new Instance<T>(beanManager, injectionTarget);
+   }
+
+   /**
+    * Represents a non-contextual instance
+    * 
+    * @author pmuir
+    * 
+    * @param <T>
+    */
+   public static class Instance<T>
+   {
+
+      private final CreationalContext<T> ctx;
+      private final InjectionTarget<T> injectionTarget;
+      private T instance;
+      private boolean disposed = false;
+
+      private Instance(BeanManager beanManager, InjectionTarget<T> injectionTarget)
+      {
+         this.injectionTarget = injectionTarget;
+         this.ctx = beanManager.createCreationalContext(null);
+      }
+
+      /**
+       * Get the instance
+       * 
+       * @return
+       */
+      public T get()
+      {
+         return instance;
+      }
+
+      /**
+       * Create the instance
+       * 
+       * @return
+       */
+      public Instance<T> produce()
+      {
+         if (this.instance != null)
+         {
+            throw new IllegalStateException("Trying to call produce() on already constructed instance");
+         }
+         if (disposed)
+         {
+            throw new IllegalStateException("Trying to call produce() on an already disposed instance");
+         }
+         this.instance = injectionTarget.produce(ctx);
+         return this;
+      }
+
+      /**
+       * Inject the instance
+       * 
+       * @return
+       */
+      public Instance<T> inject()
+      {
+         if (this.instance == null)
+         {
+            throw new IllegalStateException("Trying to call inject() before produce() was called");
+         }
+         if (disposed)
+         {
+            throw new IllegalStateException("Trying to call inject() on already disposed instance");
+         }
+         injectionTarget.inject(instance, ctx);
+         return this;
+      }
+
+      /**
+       * Call the @PostConstruct callback
+       * 
+       * @return
+       */
+      public Instance<T> postConstruct()
+      {
+         if (this.instance == null)
+         {
+            throw new IllegalStateException("Trying to call postConstruct() before produce() was called");
+         }
+         if (disposed)
+         {
+            throw new IllegalStateException("Trying to call preDestroy() on already disposed instance");
+         }
+         injectionTarget.postConstruct(instance);
+         return this;
+      }
+
+      /**
+       * Call the @PreDestroy callback
+       * 
+       * @return
+       */
+      public Instance<T> preDestroy()
+      {
+         if (this.instance == null)
+         {
+            throw new IllegalStateException("Trying to call preDestroy() before produce() was called");
+         }
+         if (disposed)
+         {
+            throw new IllegalStateException("Trying to call preDestroy() on already disposed instance");
+         }
+         injectionTarget.preDestroy(instance);
+         return this;
+      }
+
+      /**
+       * Dispose of the instance, doing any necessary cleanup
+       * 
+       */
+      public Instance<T> dispose()
+      {
+         if (this.instance == null)
+         {
+            throw new IllegalStateException("Trying to call dispose() before produce() was called");
+         }
+         if (disposed)
+         {
+            throw new IllegalStateException("Trying to call dispose() on already disposed instance");
+         }
+         injectionTarget.dispose(instance);
+         ctx.release();
+         return this;
+      }
+
+   }
+
+}
\ No newline at end of file


Property changes on: core/trunk/inject-tck-runner/src/test/java/org/jboss/weld/atinject/tck/util/NonContextual.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: core/trunk/jboss-as/build.xml
===================================================================
--- core/trunk/jboss-as/build.xml	2009-10-13 15:42:46 UTC (rev 4006)
+++ core/trunk/jboss-as/build.xml	2009-10-13 15:44:15 UTC (rev 4007)
@@ -4,6 +4,8 @@
 	<path id="maven-ant-tasks.classpath" path="../lib/maven-ant-tasks.jar" />
 	<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
 
+        <echo message="${java.io.tmpdir}" />
+
 	<property name="maven.dir" location="${basedir}/lib/maven" />
 
 	<property file="local.build.properties" />



More information about the weld-commits mailing list