Author: rmannibucau Date: Mon Apr 29 17:12:03 2013 New Revision: 1477204 URL: http://svn.apache.org/r1477204 Log: resolveObserverMethods not consistent with fireEevnt
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java?rev=1477204&r1=1477203&r2=1477204&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java Mon Apr 29 17:12:03 2013 @@ -32,7 +32,9 @@ import javax.enterprise.inject.spi.Annot import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.InjectionPoint; import javax.enterprise.inject.spi.InjectionTarget; +import javax.enterprise.inject.spi.ObserverMethod; import java.lang.annotation.Annotation; +import java.util.HashSet; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; @@ -58,6 +60,18 @@ public class WebappBeanManager extends B } @Override + public <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, EventMetadata metadata) { + if(ClassUtil.isDefinitionContainsTypeVariables(ClassUtil.getClass(metadata.getType()))) { + throw new IllegalArgumentException("Event type can not contain type variables. Event class is : " + event.getClass()); + } + + final Set<ObserverMethod<? super T>> set = new HashSet<ObserverMethod<? super T>>(); + set.addAll(getNotificationManager().resolveObservers(event, metadata)); + set.addAll(getParentBm().getNotificationManager().resolveObservers(event, metadata)); + return set; + } + + @Override public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> ctx) { try { return super.getInjectableReference(injectionPoint, ctx);