openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r902432 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/event/ main/java/org/apache/webbeans/portable/events/generics/ main/java/org/apache/webbeans/util/ test/java/org/apache/webbeans/newtests/ test/java/org/apach...
Date Sat, 23 Jan 2010 16:11:07 GMT
Author: gerdogdu
Date: Sat Jan 23 16:11:06 2010
New Revision: 902432

URL: http://svn.apache.org/viewvc?rev=902432&view=rev
Log:
[OWB-250] extensions update and more test

Added:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java   (with props)
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessAnnotatedType.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionTarget.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessManagedBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerMethod.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java Sat Jan 23 16:11:06 2010
@@ -22,6 +22,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.Arrays;
@@ -46,6 +47,8 @@
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLogger;
+import org.apache.webbeans.portable.events.generics.GenericBeanEvent;
+import org.apache.webbeans.portable.events.generics.GenericProducerObserverEvent;
 import org.apache.webbeans.spi.ServiceLoader;
 import org.apache.webbeans.spi.TransactionService;
 import org.apache.webbeans.util.AnnotationUtil;
@@ -130,20 +133,18 @@
         Set<Annotation> qualifiers = ArrayUtil.asSet(eventQualifiers);
 
         Class<T> eventType = (Class<T>) event.getClass();
-        // EventUtil.checkEventType(eventType);
-
-        Set<ObserverMethod<? super T>> observers = filterByType(eventType);
+        Set<ObserverMethod<? super T>> observers = filterByType(event,eventType);
 
         observers = filterByQualifiers(observers, qualifiers);
 
         return observers;
     }
 
-    private <T> Set<ObserverMethod<? super T>> filterByType(Class<T> eventType)
+    private <T> Set<ObserverMethod<? super T>> filterByType(T event, Class<T> eventType)
     {
         if(WebBeansUtil.isExtensionEventType(eventType))
         {
-            return filterByExtensionEventType(eventType);
+            return filterByExtensionEventType(event, eventType);
         }
         
         Set<ObserverMethod<? super T>> matching = new HashSet<ObserverMethod<? super T>>();
@@ -188,44 +189,160 @@
         return matching;
     }
     
-    private <T> Set<ObserverMethod<? super T>> filterByExtensionEventType(Class<T> eventType)
+    private <T> Set<ObserverMethod<? super T>> filterByExtensionEventType(T event, Class<T> eventType)
     {
-        Set<ObserverMethod<? super T>> matching = new HashSet<ObserverMethod<? super T>>();
-        
+        Set<ObserverMethod<? super T>> matching = new HashSet<ObserverMethod<? super T>>();        
         Set<Type> keySet = this.observers.keySet();
-
         for (Type type : keySet)
         {
-            Class<?> clazz = null;
+            Class<?> beanClass = null;
+            Class<?> observerClass = ClassUtil.getClazz(type);
             
-            if(ClassUtil.isTypeVariable(type))
+            if(observerClass.isAssignableFrom(eventType))
             {
-                TypeVariable<?> tvBeanTypeArg = (TypeVariable<?>)type;
-                Type tvBound = tvBeanTypeArg.getBounds()[0];
+                //ProcessBean,ProcessAnnotateType, ProcessInjectionTarget
+                if(WebBeansUtil.isExtensionBeanEventType(eventType))
+                {
+                    if(WebBeansUtil.isDefaultExtensionBeanEventType(observerClass))
+                    {                
+                        GenericBeanEvent genericBeanEvent = (GenericBeanEvent)event;
+                        beanClass = genericBeanEvent.getBeanClass();
+                        
+                        if(ClassUtil.isParametrizedType(type))
+                        {
+                            addToMathingWithParametrizedForBeans(type,beanClass,matching);
+                        }
+                        else
+                        {
+                            addToMatching(type, matching);
+                        }
+                    }
+                }
+                //ProcessProducer, ProcessProducerMethod, ProcessProducerField,ProcessObserverMEthod
+                else if(WebBeansUtil.isExtensionProducerOrObserverEventType(eventType))
+                {
+                    if(WebBeansUtil.isDefaultExtensionProducerOrObserverEventType(observerClass))
+                    {
+
+                        GenericProducerObserverEvent genericBeanEvent = (GenericProducerObserverEvent)event;
+                        beanClass = genericBeanEvent.getBeanClass();
+                        Class<?> producerOrObserverReturnClass = genericBeanEvent.getProducerOrObserverType();
+        
+                        if(ClassUtil.isParametrizedType(type))
+                        {
+                            addToMathingWithParametrizedForProducers(type, beanClass, producerOrObserverReturnClass, matching);
+                        }
+                        else
+                        {
+                            addToMatching(type, matching);
+                        }
+                    }
+                }
+                //BeforeBeanDiscovery,AfterBeanDiscovery,AfterDeploymentValidation
+                //BeforeShutDown Events
+                else
+                {
+                    if(observerClass.isAssignableFrom(eventType))
+                    {                
+                        addToMatching(type, matching);
+                    }
+                }                
+            }            
+        }            
+        
+        return matching;        
+    }
+    
+    private boolean checkEventTypeParameterForExtensions(Class<?> beanClass, Type observerTypeActualArg)
+    {
+        if(ClassUtil.isTypeVariable(observerTypeActualArg))
+        {
+            TypeVariable<?> tv = (TypeVariable<?>)observerTypeActualArg;
+            Type tvBound = tv.getBounds()[0];
+            
+            if(tvBound instanceof Class)
+            {
+                Class<?> clazzTvBound = (Class<?>)tvBound;
                 
-                clazz = ClassUtil.getClass(tvBound);
+                if(clazzTvBound.isAssignableFrom(beanClass))
+                {
+                    return true;
+                }                    
+            }            
+
+        }
+        else if(ClassUtil.isWildCardType(observerTypeActualArg))
+        {
+            return ClassUtil.checkRequiredTypeisWildCard(beanClass, observerTypeActualArg);
+        }
+        else if(observerTypeActualArg instanceof Class)
+        {
+            Class<?> observerClass = (Class<?>)observerTypeActualArg;
+            if(observerClass.isAssignableFrom(beanClass))
+            {
+                return true;
             }
-            
-            if(clazz == null)
+        }
+        
+        return false;
+    }
+    
+    private <T> void addToMatching(Type type, Set<ObserverMethod<? super T>> matching)
+    {
+        Set<ObserverMethod<?>> wrappers = this.observers.get(type);
+
+        for (ObserverMethod<?> wrapper : wrappers)
+        {
+            matching.add((ObserverMethod<T>) wrapper);
+        }        
+    }
+    
+    private <T> void addToMathingWithParametrizedForBeans(Type type, Class<?> beanClass, Set<ObserverMethod<? super T>> matching )
+    {
+        ParameterizedType pt = (ParameterizedType)type;
+        Type[] actualArgs = pt.getActualTypeArguments();
+        
+        if(actualArgs.length == 0)
+        {
+            Class<?> rawType = (Class<?>)pt.getRawType();
+            if(rawType.isAssignableFrom(beanClass))
             {
-                clazz = ClassUtil.getClazz(type);    
+                addToMatching(type, matching);
             }
-            
-            if(clazz.isAssignableFrom(eventType))
+        }
+        else
+        {
+            if(checkEventTypeParameterForExtensions(beanClass, actualArgs[0]))
             {
-                Set<ObserverMethod<?>> wrappers = this.observers.get(type);
-
-                for (ObserverMethod<?> wrapper : wrappers)
-                {
-                    matching.add((ObserverMethod<T>) wrapper);
-                }
-                break;                
+                addToMatching(type, matching);   
             }
         }
         
-        return matching;
-        
     }
+    
+    private <T> void addToMathingWithParametrizedForProducers(Type type, Class<?> beanClass, Class<?> producerOrObserverReturnClass, Set<ObserverMethod<? super T>> matching )
+    {
+        ParameterizedType pt = (ParameterizedType)type;
+        Type[] actualArgs = pt.getActualTypeArguments();
+        
+        if(actualArgs.length == 0)
+        {
+            Class<?> rawType = (Class<?>)pt.getRawType();
+            if(rawType.isAssignableFrom(beanClass))
+            {
+                addToMatching(type, matching);
+            }
+        }
+        else
+        {
+            if(checkEventTypeParameterForExtensions(beanClass, actualArgs[0]) && 
+                    checkEventTypeParameterForExtensions(producerOrObserverReturnClass, actualArgs[1]))
+            {
+                addToMatching(type, matching);   
+            }
+        }
+        
+    }    
 
     /**
      * filter out all {@code ObserverMethod}s which do not fit the given

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessAnnotatedType.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessAnnotatedType.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessAnnotatedType.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessAnnotatedType.java Sat Jan 23 16:11:06 2010
@@ -18,10 +18,16 @@
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
 
 @SuppressWarnings("unchecked")
-public class GProcessAnnotatedType extends ProcessAnnotatedTypeImpl
+public class GProcessAnnotatedType extends ProcessAnnotatedTypeImpl implements GenericBeanEvent
 {
     public GProcessAnnotatedType(AnnotatedType annotatedType )
     {
         super(annotatedType);
     }
+
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getAnnotatedType().getJavaClass();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionTarget.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionTarget.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionTarget.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionTarget.java Sat Jan 23 16:11:06 2010
@@ -19,10 +19,16 @@
 import org.apache.webbeans.portable.events.ProcessInjectionTargetImpl;
 
 @SuppressWarnings("unchecked")
-public class GProcessInjectionTarget extends ProcessInjectionTargetImpl
+public class GProcessInjectionTarget extends ProcessInjectionTargetImpl implements GenericBeanEvent
 {
     public GProcessInjectionTarget(InjectionTarget<?> injectionTarget,AnnotatedType<?> annotatedType)
     {
         super(injectionTarget, annotatedType);
     }
+
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getAnnotatedType().getJavaClass();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessManagedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessManagedBean.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessManagedBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessManagedBean.java Sat Jan 23 16:11:06 2010
@@ -19,10 +19,16 @@
 import org.apache.webbeans.portable.events.ProcessManagedBeanImpl;
 
 @SuppressWarnings("unchecked")
-public class GProcessManagedBean extends ProcessManagedBeanImpl
+public class GProcessManagedBean extends ProcessManagedBeanImpl implements GenericBeanEvent
 {
     public GProcessManagedBean(ManagedBean<?> bean,AnnotatedType<?> annotated)
     {
         super(bean,annotated);
     }
+
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getBean().getBeanClass();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java Sat Jan 23 16:11:06 2010
@@ -17,9 +17,10 @@
 import javax.enterprise.inject.spi.ObserverMethod;
 
 import org.apache.webbeans.portable.events.ProcessObserverMethodImpl;
+import org.apache.webbeans.util.ClassUtil;
 
 @SuppressWarnings("unchecked")
-public class GProcessObservableMethod extends ProcessObserverMethodImpl
+public class GProcessObservableMethod extends ProcessObserverMethodImpl implements GenericProducerObserverEvent
 {
 
     public GProcessObservableMethod(AnnotatedMethod<?> annotatedMethod, ObserverMethod<?> observerMethod)
@@ -27,6 +28,18 @@
         super(annotatedMethod, observerMethod);
     }
 
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getObserverMethod().getBeanClass();
+    }
+
+    @Override
+    public Class<?> getProducerOrObserverType()
+    {
+        return ClassUtil.getClazz(getObserverMethod().getObservedType());
+    }
+
     
     
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducer.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducer.java Sat Jan 23 16:11:06 2010
@@ -16,13 +16,27 @@
 import javax.enterprise.inject.spi.AnnotatedMember;
 
 import org.apache.webbeans.portable.events.ProcessProducerImpl;
+import org.apache.webbeans.util.ClassUtil;
 
 @SuppressWarnings("unchecked")
-public class GProcessProducer extends ProcessProducerImpl
+public class GProcessProducer extends ProcessProducerImpl implements GenericProducerObserverEvent
 {
     public GProcessProducer(AnnotatedMember<?> annotateMember)
     {
         super(annotateMember);
     }
 
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getAnnotatedMember().getDeclaringType().getJavaClass();
+    }
+
+    @Override
+    public Class<?> getProducerOrObserverType()
+    {
+        return ClassUtil.getClazz(getAnnotatedMember().getBaseType());
+    }
+
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java Sat Jan 23 16:11:06 2010
@@ -17,13 +17,26 @@
 
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.portable.events.ProcessProducerFieldImpl;
+import org.apache.webbeans.util.ClassUtil;
 
 @SuppressWarnings("unchecked")
-public class GProcessProducerField extends ProcessProducerFieldImpl
+public class GProcessProducerField extends ProcessProducerFieldImpl implements GenericProducerObserverEvent
 {
     public GProcessProducerField(ProducerFieldBean<?> bean,AnnotatedField<?> annotatedField)
     {
         super(bean, annotatedField);
     }
 
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getBean().getBeanClass();
+    }
+
+    @Override
+    public Class<?> getProducerOrObserverType()
+    {
+        return ClassUtil.getClazz(getAnnotatedProducerField().getBaseType());
+    }
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerMethod.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerMethod.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerMethod.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerMethod.java Sat Jan 23 16:11:06 2010
@@ -18,14 +18,27 @@
 
 import org.apache.webbeans.component.ProducerMethodBean;
 import org.apache.webbeans.portable.events.ProcessProducerMethodImpl;
+import org.apache.webbeans.util.ClassUtil;
 
 @SuppressWarnings("unchecked")
-public class GProcessProducerMethod extends ProcessProducerMethodImpl
+public class GProcessProducerMethod extends ProcessProducerMethodImpl implements GenericProducerObserverEvent
 {
     public GProcessProducerMethod(ProducerMethodBean<?> bean,AnnotatedMethod<?> annotatedMethod, AnnotatedParameter dispose)
     {
         super(bean, annotatedMethod,dispose);
     }
+
+    @Override
+    public Class<?> getBeanClass()
+    {
+        return getBean().getBeanClass();
+    }
+
+    @Override
+    public Class<?> getProducerOrObserverType()
+    {
+        return ClassUtil.getClazz(getAnnotatedProducerMethod().getBaseType());
+    }
     
 
 }

Added: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.portable.events.generics;
+
+public interface GenericBeanEvent
+{
+    public Class<?> getBeanClass();    
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericBeanEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.portable.events.generics;
+
+public interface GenericProducerObserverEvent
+{
+    public Class<?> getBeanClass();
+    
+    public Class<?> getProducerOrObserverType();
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GenericProducerObserverEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java Sat Jan 23 16:11:06 2010
@@ -352,13 +352,14 @@
                 if (btype.equals(clazz))
                 {
                     found = true;
-                    continue;
+                    //Adding Break instead of continue
+                    break;
                 }
             }
 
             if (found)
             {
-                result = method.getParameterTypes()[index];
+                result = method.getGenericParameterTypes()[index];
                 break;
             }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java Sat Jan 23 16:11:06 2010
@@ -968,22 +968,22 @@
             //Required type is parametrized
             if(ClassUtil.isParametrizedType(requiredTypeArg) && ClassUtil.isParametrizedType(beanTypeArg))
             {
-                return check1(beanTypeArg, requiredTypeArg);
+                return checkBeanAndRequiredTypeisParametrized(beanTypeArg, requiredTypeArg);
             }
             //Required type is wildcard
             else if(ClassUtil.isWildCardType(requiredTypeArg))
             {
-                return check2(beanTypeArg, requiredTypeArg);
+                return checkRequiredTypeisWildCard(beanTypeArg, requiredTypeArg);
             }
             //Required type is actual type
             else if(requiredTypeArg instanceof Class && ClassUtil.isTypeVariable(beanTypeArg))
             {
-                return check3(beanTypeArg, requiredTypeArg);
+                return checkRequiredTypeIsClassAndBeanTypeIsVariable(beanTypeArg, requiredTypeArg);
             }
             //Required type is Type variable
             else if(ClassUtil.isTypeVariable(requiredTypeArg) && ClassUtil.isTypeVariable(beanTypeArg))
             {
-                return check4(beanTypeArg, requiredTypeArg);
+                return checkBeanTypeAndRequiredIsTypeVariable(beanTypeArg, requiredTypeArg);
             }      
             else if((beanTypeArg instanceof Class) && (requiredTypeArg instanceof Class))
             {
@@ -997,7 +997,7 @@
         return false;
     }
     
-    private static boolean check1(Type beanTypeArg, Type requiredTypeArg)
+    public static boolean checkBeanAndRequiredTypeisParametrized(Type beanTypeArg, Type requiredTypeArg)
     {
         ParameterizedType ptRequiredTypeArg = (ParameterizedType)requiredTypeArg;
         ParameterizedType ptBeanTypeArg = (ParameterizedType)beanTypeArg;
@@ -1022,7 +1022,7 @@
         return false;
     }
     
-    private static boolean check2(Type beanTypeArg, Type requiredTypeArg)
+    public static boolean checkRequiredTypeisWildCard(Type beanTypeArg, Type requiredTypeArg)
     {
         WildcardType wctRequiredTypeArg = (WildcardType)requiredTypeArg;
         Type upperBoundRequiredTypeArg =  wctRequiredTypeArg.getUpperBounds()[0];
@@ -1087,7 +1087,7 @@
         return false;
     }
     
-    private static boolean check3(Type beanTypeArg, Type requiredTypeArg)
+    public static boolean checkRequiredTypeIsClassAndBeanTypeIsVariable(Type beanTypeArg, Type requiredTypeArg)
     {
         Class<?> clazzRequiredType = (Class<?>)requiredTypeArg;
         
@@ -1107,7 +1107,7 @@
         return false;
     }
 
-    private static boolean check4(Type beanTypeArg, Type requiredTypeArg)
+    public static boolean checkBeanTypeAndRequiredIsTypeVariable(Type beanTypeArg, Type requiredTypeArg)
     {
         TypeVariable<?> tvBeanTypeArg = (TypeVariable<?>)beanTypeArg;
         Type tvBeanBound = tvBeanTypeArg.getBounds()[0];

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Sat Jan 23 16:11:06 2010
@@ -69,6 +69,15 @@
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.Interceptor;
 import javax.enterprise.inject.spi.ObserverMethod;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.inject.spi.ProcessBean;
+import javax.enterprise.inject.spi.ProcessInjectionTarget;
+import javax.enterprise.inject.spi.ProcessManagedBean;
+import javax.enterprise.inject.spi.ProcessObserverMethod;
+import javax.enterprise.inject.spi.ProcessProducer;
+import javax.enterprise.inject.spi.ProcessProducerField;
+import javax.enterprise.inject.spi.ProcessProducerMethod;
+import javax.enterprise.inject.spi.ProcessSessionBean;
 import javax.enterprise.util.TypeLiteral;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -2206,4 +2215,63 @@
         
         return false;
     }
+    
+    public static boolean isExtensionBeanEventType(Class<?> clazz)
+    {
+        if(clazz.equals(GProcessAnnotatedType.class) ||
+                clazz.equals(GProcessInjectionTarget.class) ||
+                clazz.equals(GProcessManagedBean.class) ||
+                clazz.equals(GProcessSessionBean.class)
+                )
+        {
+            return true;
+        }
+        
+        return false;        
+    }
+    
+    public static boolean isDefaultExtensionBeanEventType(Class<?> clazz)
+    {
+        if(clazz.equals(ProcessAnnotatedType.class) ||
+                clazz.equals(ProcessInjectionTarget.class) ||
+                clazz.equals(ProcessManagedBean.class) ||
+                clazz.equals(ProcessBean.class) ||
+                clazz.equals(ProcessSessionBean.class)
+                )
+        {
+            return true;
+        }
+        
+        return false;        
+    }    
+    
+    public static boolean isExtensionProducerOrObserverEventType(Class<?> clazz)
+    {
+        if(clazz.equals(GProcessProducer.class) ||
+                clazz.equals(GProcessProducerField.class) ||
+                clazz.equals(GProcessProducerMethod.class) ||
+                clazz.equals(GProcessObservableMethod.class)
+                )
+        {
+            return true;
+        }
+        
+        return false;
+
+    }
+    
+    public static boolean isDefaultExtensionProducerOrObserverEventType(Class<?> clazz)
+    {
+        if(clazz.equals(ProcessProducer.class) ||
+                clazz.equals(ProcessProducerField.class) ||
+                clazz.equals(ProcessProducerMethod.class) ||
+                clazz.equals(ProcessObserverMethod.class)
+                )
+        {
+            return true;
+        }
+        
+        return false;
+
+    }    
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java?rev=902432&r1=902431&r2=902432&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java Sat Jan 23 16:11:06 2010
@@ -60,6 +60,11 @@
         //Creates a new container
         testLifecycle = new OpenWebBeansTestLifeCycle();
         
+        for (Extension ext : extensions)
+        {
+            ExtensionLoader.getInstance().addExtension(ext);
+        }
+        
         //Deploy bean classes
         OpenWebBeansTestMetaDataDiscoveryService discoveyService = (OpenWebBeansTestMetaDataDiscoveryService)testLifecycle.getDiscoveryService();
         discoveyService.deployClasses(beanClasses);

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.newtests.AbstractUnitTest;
+import org.apache.webbeans.newtests.portable.events.beans.Apple;
+import org.apache.webbeans.newtests.portable.events.extensions.AppleExtension;
+import org.apache.webbeans.newtests.portable.events.extensions.NotAppleExtnsion;
+import org.apache.webbeans.newtests.portable.events.extensions.RawTypeExtension;
+import org.apache.webbeans.newtests.portable.events.extensions.TypeVariableExtension;
+import org.apache.webbeans.newtests.portable.events.extensions.WildcardExtension;
+import org.apache.webbeans.newtests.portable.events.extensions.WrongTypeVariableExtension;
+import org.apache.webbeans.newtests.portable.events.extensions.WrongWildcardExtension;
+import org.junit.Test;
+
+public class PortableEventTest extends AbstractUnitTest
+{
+
+    @Test
+    public void testAppleExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new AppleExtension());        
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertEquals("apple", AppleExtension.NAME);
+        
+        shutDownContainer();
+    }
+    
+    @Test
+
+    public void testNotAppleExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new NotAppleExtnsion());        
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertFalse(NotAppleExtnsion.CALLED);
+        
+        shutDownContainer();
+        
+    }
+    
+    @Test
+
+    public void testRawTypeExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new RawTypeExtension());        
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertTrue(RawTypeExtension.CALLED);
+        
+        shutDownContainer();
+        
+    }
+    
+    @Test
+
+    public void testTypeVariableExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+                
+        addExtension(new TypeVariableExtension());
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertTrue(TypeVariableExtension.CALLED);
+        
+        shutDownContainer();
+        
+    }
+    
+    @Test
+
+    public void testwildcardExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new WildcardExtension());       
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertTrue(WildcardExtension.CALLED);
+        
+        shutDownContainer();
+
+    }
+    
+    @Test
+
+    public void testWrongTypeVariableExtension()
+    {
+       Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new WrongTypeVariableExtension());  
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertFalse(WrongTypeVariableExtension.CALLED);
+        
+        shutDownContainer();
+        
+    }
+    
+    @Test
+
+    public void testWrongWildcardTypeExtension()
+    {
+        Collection<URL> beanXmls = new ArrayList<URL>();
+        
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(Apple.class);
+        
+        addExtension(new WrongWildcardExtension());        
+        startContainer(beanClasses, beanXmls);
+        
+        Assert.assertFalse(WrongWildcardExtension.CALLED);
+        
+        shutDownContainer();
+        
+    }
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/PortableEventTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.beans;
+
+import javax.inject.Named;
+
+@Named
+public class Apple
+{
+
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/beans/Apple.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+import org.apache.webbeans.newtests.portable.events.beans.Apple;
+
+
+public class AppleExtension implements Extension
+{
+    public static String NAME = "";
+    
+    public void observeProcessBean(@Observes ProcessBean<Apple> event)
+    {
+        Bean<Apple> bean = event.getBean();
+        NAME = bean.getName();
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/AppleExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+import org.apache.webbeans.newtests.concepts.alternatives.common.Pencil;
+
+public class NotAppleExtnsion implements Extension
+{
+    public static boolean CALLED = false;
+    
+    public void observeProcessBean(@Observes ProcessBean<Pencil> event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/NotAppleExtnsion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+public class RawTypeExtension implements Extension
+{
+    public static boolean CALLED = false;
+
+    public void observeProcessBean(@Observes ProcessBean event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/RawTypeExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+public class TypeVariableExtension implements Extension
+{
+    public static boolean CALLED = false;
+
+    public <T> void observeProcessBean(@Observes ProcessBean<T> event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/TypeVariableExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+public class WildcardExtension implements Extension
+{
+    public static boolean CALLED = false;
+
+    public void observeProcessBean(@Observes ProcessBean<?> event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WildcardExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+import org.apache.webbeans.newtests.concepts.alternatives.common.Pencil;
+
+public class WrongTypeVariableExtension implements Extension
+{
+    public static boolean CALLED = false;
+
+    public <T extends Pencil> void observeProcessBean(@Observes ProcessBean<T> event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongTypeVariableExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java?rev=902432&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java Sat Jan 23 16:11:06 2010
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.webbeans.newtests.portable.events.extensions;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessBean;
+
+import org.apache.webbeans.newtests.concepts.alternatives.common.Pencil;
+
+public class WrongWildcardExtension implements Extension
+{
+    public static boolean CALLED = false;
+
+    public void observeProcessBean(@Observes ProcessBean<? extends Pencil> event)
+    {
+        CALLED = true;
+    } 
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/events/extensions/WrongWildcardExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message