openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1056549 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/annotation/ main/java/org/apache/webbeans/config/ main/java/org/apache/webbeans/container/ main/java/org/apache/webbeans/decorator/ main/java/org/apache/webb...
Date Fri, 07 Jan 2011 22:37:17 GMT
Author: dblevins
Date: Fri Jan  7 22:37:16 2011
New Revision: 1056549

URL: http://svn.apache.org/viewvc?rev=1056549&view=rev
Log:
Deprecated moved methods of WebBeansUtil and WebBeansAnnotatedTypeUtil
Consolidated more references to WebBeansContext.getInstance()
OWB-503 status: 555 code uses
Total of 94232 static synchronized accesses and 94656 hashed calls in 340 tests
Average of 277 static synchronized accesses and 278 hashed calls per test


Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java
    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/discovery/AfterBeanDiscoveryImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLAnnotationTypeManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/EventTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/exception/EventExceptionTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java Fri Jan  7 22:37:16 2011
@@ -32,10 +32,13 @@ import org.apache.webbeans.util.WebBeans
 import org.apache.webbeans.xml.XMLAnnotationTypeManager;
 
 import javax.enterprise.context.NormalScope;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.Disposes;
 import javax.enterprise.inject.New;
 import javax.enterprise.inject.Stereotype;
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.util.Nonbinding;
 import javax.inject.Named;
 import javax.inject.Qualifier;
@@ -750,4 +753,62 @@ public final class AnnotationManager
 
     }
 
+    @SuppressWarnings("unchecked")
+    public <X> Method getDisposalWithGivenAnnotatedMethod(AnnotatedType<X> annotatedType, Type beanType, Annotation[] qualifiers)
+    {
+        Set<AnnotatedMethod<? super X>> annotatedMethods = annotatedType.getMethods();
+
+        if(annotatedMethods != null)
+        {
+            for (AnnotatedMethod<? super X> annotatedMethod : annotatedMethods)
+            {
+                AnnotatedMethod<X> annt = (AnnotatedMethod<X>)annotatedMethod;
+                List<AnnotatedParameter<X>> parameters = annt.getParameters();
+                if(parameters != null)
+                {
+                    boolean found = false;
+                    for(AnnotatedParameter<X> parameter : parameters)
+                    {
+                        if(parameter.isAnnotationPresent(Disposes.class))
+                        {
+                            found = true;
+                            break;
+                        }
+                    }
+
+                    if(found)
+                    {
+                        Type type = AnnotationUtil.getAnnotatedMethodFirstParameterWithAnnotation(annotatedMethod, Disposes.class);
+                        Annotation[] annots = this.getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(annotatedMethod, Disposes.class);
+
+                        if(type.equals(beanType))
+                        {
+                            for(Annotation qualifier : qualifiers)
+                            {
+                                if(qualifier.annotationType() != Default.class)
+                                {
+                                    for(Annotation ann :annots)
+                                    {
+                                        if(!AnnotationUtil.isQualifierEqual(qualifier, ann))
+                                        {
+                                            return null;
+                                        }
+                                        else
+                                        {
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+
+                            return annotatedMethod.getJavaMember();
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+
+    }
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Fri Jan  7 22:37:16 2011
@@ -743,7 +743,7 @@ public class BeansDeployer
                     {
                         if (!webBeansContext.getxMLAnnotationTypeManager().hasStereoType(stereoClass))
                         {
-                            WebBeansUtil.checkStereoTypeClass(stereoClass);
+                            webBeansContext.getAnnotationManager().checkStereoTypeClass(stereoClass, stereoClass.getDeclaredAnnotations());
                             StereoTypeModel model = new StereoTypeModel(stereoClass);
                             webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
                         }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Fri Jan  7 22:37:16 2011
@@ -534,7 +534,7 @@ public final class DefinitionUtil
         if (nameAnnot == null) // no @Named
         {
             // Check for stereottype
-            if (WebBeansUtil.hasNamedOnStereoTypes(component))
+            if (WebBeansContext.getInstance().getAnnotationManager().hasNamedOnStereoTypes(component))
             {
                 isDefault = true;
             }
@@ -894,7 +894,7 @@ public final class DefinitionUtil
                 {
                     if (qualifierAnns.length > 0)
                     {
-                        WebBeansUtil.checkForNewQualifierForDeployment(field.getGenericType(), clazz, field.getName(), anns);
+                        annotationManager.checkForNewQualifierForDeployment(field.getGenericType(), clazz, field.getName(), anns);
                     }
 
                     int mod = field.getModifiers();
@@ -1018,7 +1018,7 @@ public final class DefinitionUtil
         {
             Annotation[] a = anns[i];
             Type t = type[i];
-            WebBeansUtil.checkForNewQualifierForDeployment(t, clazz, method.getName(), a);
+            WebBeansContext.getInstance().getAnnotationManager().checkForNewQualifierForDeployment(t, clazz, method.getName(), a);
         }
 
         if (method.getAnnotation(Produces.class) == null)
@@ -1080,7 +1080,7 @@ public final class DefinitionUtil
         Asserts.assertNotNull(component, "component parameter can not be null");
         Asserts.nullCheckForClass(clazz);
 
-        NotificationManager manager = NotificationManager.getInstance();
+        NotificationManager manager = WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager();
 
         Method[] candidateMethods = AnnotationUtil.getMethodsWithParameterAnnotation(clazz, Observes.class);
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java Fri Jan  7 22:37:16 2011
@@ -553,7 +553,7 @@ public class BeanManagerImpl implements 
     @Override    
     public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindingTypes)
     {
-        WebBeansUtil.checkDecoratorResolverParams(types, bindingTypes);
+        webBeansContext.getAnnotationManager().checkDecoratorResolverParams(types, bindingTypes);
         Set<Decorator<?>> intsSet = WebBeansDecoratorConfig.findDeployedWebBeansDecorator(types, bindingTypes);
         Iterator<Decorator<?>> itSet = intsSet.iterator();
 
@@ -577,7 +577,7 @@ public class BeanManagerImpl implements 
     @Override
     public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
     {
-        WebBeansUtil.checkInterceptorResolverParams(interceptorBindings);
+        webBeansContext.getAnnotationManager().checkInterceptorResolverParams(interceptorBindings);
 
         Set<Interceptor<?>> intsSet = WebBeansInterceptorConfig.findDeployedWebBeansInterceptor(interceptorBindings);
         Iterator<Interceptor<?>> itSet = intsSet.iterator();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java Fri Jan  7 22:37:16 2011
@@ -342,9 +342,10 @@ public class WebBeansDecorator<T> extend
             return this.customDecorator.create(creationalContext);
         }
 
-        Context context = WebBeansContext.getInstance().getBeanManagerImpl().getContext(getScope());
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        Context context = webBeansContext.getBeanManagerImpl().getContext(getScope());
         Object actualInstance = context.get((Bean<Object>)this.wrappedBean, (CreationalContext<Object>)creationalContext);
-        T proxy = (T) WebBeansContext.getInstance().getJavassistProxyFactory().createDependentScopedBeanProxy(this.wrappedBean, actualInstance, creationalContext);
+        T proxy = (T) webBeansContext.getJavassistProxyFactory().createDependentScopedBeanProxy(this.wrappedBean, actualInstance, creationalContext);
         
         return proxy;        
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java Fri Jan  7 22:37:16 2011
@@ -54,6 +54,7 @@ public class EventImpl<T> implements Eve
 
     /**Bean manager*/
     private transient BeanManagerImpl manager = null;
+    private final WebBeansContext webBeansContext;
 
     /**
      * Creates a new event.
@@ -65,7 +66,8 @@ public class EventImpl<T> implements Eve
     {
         this.injectedBindings = injectedBindings;
         this.eventType = eventType;
-        this.manager = WebBeansContext.getInstance().getBeanManagerImpl();
+        webBeansContext = WebBeansContext.getInstance();
+        this.manager = webBeansContext.getBeanManagerImpl();
     }
 
     /**
@@ -84,7 +86,7 @@ public class EventImpl<T> implements Eve
      */
     private Annotation[] getEventBindings(Annotation... annotations)
     {
-        WebBeansContext.getInstance().getAnnotationManager().checkQualifierConditions(annotations);
+        webBeansContext.getAnnotationManager().checkQualifierConditions(annotations);
 
         Set<Annotation> eventBindings = new HashSet<Annotation>();
         
@@ -165,6 +167,6 @@ public class EventImpl<T> implements Eve
         this.eventType = (Type)inputStream.readObject();
         this.injectedBindings = (Annotation[])inputStream.readObject();
 
-        this.manager = WebBeansContext.getInstance().getBeanManagerImpl();
+        this.manager = webBeansContext.getBeanManagerImpl();
     }
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java Fri Jan  7 22:37:16 2011
@@ -58,6 +58,7 @@ public final class EventUtil
         }
     }
 
+    @Deprecated
     public static void checkEventBindings(Set<Annotation> annotations)
     {
         WebBeansContext.getInstance().getAnnotationManager().checkQualifierConditions(annotations);

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=1056549&r1=1056548&r2=1056549&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 Fri Jan  7 22:37:16 2011
@@ -43,7 +43,6 @@ import org.apache.webbeans.annotation.An
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
-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;
@@ -70,14 +69,12 @@ public final class NotificationManager
 
     public static NotificationManager getInstance()
     {
-        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
-
-        return manager.getNotificationManager();
+        return WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager();
     }
 
     public <T> void addObserver(ObserverMethod<T> observer, Type eventType)
     {
-        EventUtil.checkEventBindings(observer.getObservedQualifiers());
+        webBeansContext.getAnnotationManager().checkQualifierConditions(observer.getObservedQualifiers());
 
         Set<ObserverMethod<?>> set = observers.get(eventType);
         if (set == null)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java Fri Jan  7 22:37:16 2011
@@ -34,7 +34,6 @@ import org.apache.webbeans.config.OWBLog
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.decorator.WebBeansDecorator;
-import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.intercept.custom.CustomInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.portable.events.generics.GProcessBean;
@@ -52,11 +51,13 @@ public class AfterBeanDiscoveryImpl impl
 {
     private BeanManagerImpl beanManager = null;
     
-    private static final WebBeansLogger logger = WebBeansLogger.getLogger(AfterBeanDiscoveryImpl.class); 
-    
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(AfterBeanDiscoveryImpl.class);
+    private final WebBeansContext webBeansContext;
+
     public AfterBeanDiscoveryImpl()
     {
-        this.beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
+        webBeansContext = WebBeansContext.getInstance();
+        this.beanManager = webBeansContext.getBeanManagerImpl();
     }
     
     /**
@@ -66,7 +67,7 @@ public class AfterBeanDiscoveryImpl impl
     @SuppressWarnings("unchecked")
     public void addBean(Bean<?> bean)
     {
-        AnnotatedType<?> annotatedType = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(bean.getBeanClass());
+        AnnotatedType<?> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(bean.getBeanClass());
         
         //Fire Event
         ProcessBean<?> processBeanEvent = new GProcessBean(bean,annotatedType);
@@ -103,7 +104,7 @@ public class AfterBeanDiscoveryImpl impl
             }
             
             this.beanManager.addInterceptor(interceptor);
-            WebBeansContext.getInstance().getBeanManagerImpl().addCustomInterceptorClass(bean.getBeanClass());
+            webBeansContext.getBeanManagerImpl().addCustomInterceptorClass(bean.getBeanClass());
         }
         
         else if(bean instanceof Decorator)
@@ -136,7 +137,7 @@ public class AfterBeanDiscoveryImpl impl
             
             
             this.beanManager.addDecorator(new WebBeansDecorator(managedBean, (Decorator)bean));
-            WebBeansContext.getInstance().getBeanManagerImpl().addCustomDecoratorClass(bean.getBeanClass());
+            webBeansContext.getBeanManagerImpl().addCustomDecoratorClass(bean.getBeanClass());
         }
         else
         {
@@ -171,7 +172,7 @@ public class AfterBeanDiscoveryImpl impl
     {
         ProcessObserverMethod<?, ?> event = new GProcessObservableMethod(null,observerMethod);
         this.beanManager.fireEvent(event, AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
-        NotificationManager.getInstance().addObserver(observerMethod, observerMethod.getObservedType());
+        this.beanManager.getNotificationManager().addObserver(observerMethod, observerMethod.getObservedType());
     }
 
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java Fri Jan  7 22:37:16 2011
@@ -27,7 +27,6 @@ import org.apache.webbeans.config.WebBea
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.ExternalScope;
 import org.apache.webbeans.deployment.StereoTypeModel;
-import org.apache.webbeans.util.WebBeansUtil;
 
 /**
  * Events that is fired before container starts to discover beans.
@@ -39,10 +38,12 @@ public class BeforeBeanDiscoveryImpl imp
 {
     
     private BeanManagerImpl beanManager = null;
+    private final WebBeansContext webBeansContext;
 
     public BeforeBeanDiscoveryImpl()
     {
-        beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
+        webBeansContext = WebBeansContext.getInstance();
+        beanManager = webBeansContext.getBeanManagerImpl();
     }
     
     /**
@@ -70,7 +71,7 @@ public class BeforeBeanDiscoveryImpl imp
     @Override
     public void addInterceptorBinding(Class<? extends Annotation> binding, Annotation... bindingDef)
     {
-        WebBeansContext.getInstance().getxMLAnnotationTypeManager().addInterceotorBindingTypeInheritAnnotation(binding, bindingDef);
+        webBeansContext.getxMLAnnotationTypeManager().addInterceotorBindingTypeInheritAnnotation(binding, bindingDef);
     }
 
     /**
@@ -89,11 +90,11 @@ public class BeforeBeanDiscoveryImpl imp
     @Override
     public void addStereotype(Class<? extends Annotation> stereotype, Annotation... stereotypeDef)
     {
-        if (!WebBeansContext.getInstance().getxMLAnnotationTypeManager().hasStereoType(stereotype))
+        if (!webBeansContext.getxMLAnnotationTypeManager().hasStereoType(stereotype))
         {
-            WebBeansUtil.checkStereoTypeClass(stereotype, stereotypeDef);
+            webBeansContext.getAnnotationManager().checkStereoTypeClass(stereotype, stereotypeDef);
             StereoTypeModel model = new StereoTypeModel(stereotype, stereotypeDef);
-            WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
+            webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
         }
         
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java Fri Jan  7 22:37:16 2011
@@ -35,7 +35,6 @@ import org.apache.webbeans.config.OWBLog
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
-import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.inject.impl.InjectionPointFactory;
 import org.apache.webbeans.intercept.InterceptorUtil;
@@ -48,7 +47,6 @@ import javax.decorator.Delegate;
 import javax.enterprise.context.Dependent;
 import javax.enterprise.event.Observes;
 import javax.enterprise.event.Reception;
-import javax.enterprise.inject.Default;
 import javax.enterprise.inject.Disposes;
 import javax.enterprise.inject.Produces;
 import javax.enterprise.inject.Specializes;
@@ -178,6 +176,7 @@ public final class WebBeansAnnotatedType
     @SuppressWarnings("unchecked")
     public static <X> Set<ObserverMethod<?>> defineObserverMethods(AbstractInjectionTargetBean<X> bean,AnnotatedType<X> annotatedType)
     {
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
         Set<ObserverMethod<?>> definedObservers = new HashSet<ObserverMethod<?>>();
         Set<AnnotatedMethod<? super X>> annotatedMethods = annotatedType.getMethods();    
         for (AnnotatedMethod<? super X> annotatedMethod : annotatedMethods)
@@ -217,7 +216,7 @@ public final class WebBeansAnnotatedType
                 addMethodInjectionPointMetaData(bean, annotatedMethod);
                 
                 //Looking for ObserverMethod
-                ObserverMethod<?> definedObserver = NotificationManager.getInstance().getObservableMethodForAnnotatedMethod(annotatedMethod, bean);
+                ObserverMethod<?> definedObserver = webBeansContext.getBeanManagerImpl().getNotificationManager().getObservableMethodForAnnotatedMethod(annotatedMethod, bean);
                 if(definedObserver != null)
                 {
                     definedObservers.add(definedObserver);
@@ -372,7 +371,7 @@ public final class WebBeansAnnotatedType
             {
                 if (qualifierAnns.length > 0)
                 {
-                    WebBeansUtil.checkForNewQualifierForDeployment(annotatedField.getBaseType(), annotatedField.getDeclaringType().getJavaClass(), field.getName(), anns);
+                    annotationManager.checkForNewQualifierForDeployment(annotatedField.getBaseType(), annotatedField.getDeclaringType().getJavaClass(), field.getName(), anns);
                 }
 
                 int mod = field.getModifiers();
@@ -610,13 +609,15 @@ public final class WebBeansAnnotatedType
             ". Reason : Initializer method can not be annotated with @Produces.");
         
         }
-        
+
+        AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+
         List<AnnotatedParameter<X>> annotatedParameters = annotatedMethod.getParameters();
         for (AnnotatedParameter<X> annotatedParameter : annotatedParameters)
         {
-            WebBeansUtil.checkForNewQualifierForDeployment(annotatedParameter.getBaseType(), annotatedMethod.getDeclaringType().getJavaClass(), 
+            annotationManager.checkForNewQualifierForDeployment(annotatedParameter.getBaseType(), annotatedMethod.getDeclaringType().getJavaClass(),
                     method.getName(), AnnotationUtil.getAnnotationsFromSet(annotatedParameter.getAnnotations()));
-            
+
             if(annotatedParameter.isAnnotationPresent(Disposes.class) ||
                     annotatedParameter.isAnnotationPresent(Observes.class))
             {
@@ -994,66 +995,12 @@ public final class WebBeansAnnotatedType
             }
         }
 
-    }    
-    
+    }
+
     @SuppressWarnings("unchecked")
+    @Deprecated
     public static <X> Method getDisposalWithGivenAnnotatedMethod(AnnotatedType<X> annotatedType, Type beanType, Annotation[] qualifiers)
     {
-        Set<AnnotatedMethod<? super X>> annotatedMethods = annotatedType.getMethods();  
-        
-        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
-        
-        if(annotatedMethods != null)
-        {
-            for (AnnotatedMethod<? super X> annotatedMethod : annotatedMethods)
-            {
-                AnnotatedMethod<X> annt = (AnnotatedMethod<X>)annotatedMethod;
-                List<AnnotatedParameter<X>> parameters = annt.getParameters();
-                if(parameters != null)
-                {
-                    boolean found = false;                    
-                    for(AnnotatedParameter<X> parameter : parameters)
-                    {
-                        if(parameter.isAnnotationPresent(Disposes.class))
-                        {
-                            found = true;
-                            break;
-                        }
-                    }
-                    
-                    if(found)
-                    {
-                        Type type = AnnotationUtil.getAnnotatedMethodFirstParameterWithAnnotation(annotatedMethod, Disposes.class);
-                        Annotation[] annots = annotationManager.getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(annotatedMethod, Disposes.class);
-                        
-                        if(type.equals(beanType))
-                        {
-                            for(Annotation qualifier : qualifiers)
-                            {
-                                if(qualifier.annotationType() != Default.class)
-                                {
-                                    for(Annotation ann :annots)
-                                    {
-                                        if(!AnnotationUtil.isQualifierEqual(qualifier, ann))
-                                        {
-                                            return null;
-                                        }
-                                        else
-                                        {
-                                            break;
-                                        }
-                                    }
-                                }
-                            }
-                            
-                            return annotatedMethod.getJavaMember();
-                        }                
-                    }                                
-                }
-            }            
-        }        
-        return null;
-        
+        return WebBeansContext.getInstance().getAnnotationManager().getDisposalWithGivenAnnotatedMethod(annotatedType, beanType, qualifiers);
     }
-    
 }

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=1056549&r1=1056548&r2=1056549&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 Fri Jan  7 22:37:16 2011
@@ -94,6 +94,7 @@ import javax.interceptor.AroundTimeout;
 import javax.interceptor.InvocationContext;
 
 import javassist.util.proxy.ProxyFactory;
+import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.annotation.ApplicationScopeLiteral;
 import org.apache.webbeans.annotation.DefaultLiteral;
@@ -570,11 +571,12 @@ public final class WebBeansUtil
     }
 
     /**
-     * Check conditions for the new binding. 
+     * Check conditions for the new binding.
      * @param annotations annotations
      * @return Annotation[] with all binding annotations
-     * @throws WebBeansConfigurationException if New plus any other binding annotation is set         
+     * @throws WebBeansConfigurationException if New plus any other binding annotation is set
      */
+    @Deprecated
     public static Annotation[] checkForNewQualifierForDeployment(Type type, Class<?> clazz, String name,
                                                                  Annotation[] annotations)
     {
@@ -1389,6 +1391,7 @@ public final class WebBeansUtil
      *
      * @return true if array contains the StereoType meta annotation
      */
+    @Deprecated
     public static boolean isComponentHasStereoType(OwbBean<?> component)
     {
         return WebBeansContext.getInstance().getAnnotationManager().isComponentHasStereoType(component);
@@ -1399,6 +1402,7 @@ public final class WebBeansUtil
      * @param bean bean instance
      * @return bean stereotypes
      */
+    @Deprecated
     public static Annotation[] getComponentStereoTypes(OwbBean<?> bean)
     {
         return WebBeansContext.getInstance().getAnnotationManager().getComponentStereoTypes(bean);
@@ -1409,6 +1413,7 @@ public final class WebBeansUtil
      * @param bean bean instance
      * @return true if name exists
      */
+    @Deprecated
     public static boolean hasNamedOnStereoTypes(OwbBean<?> bean)
     {
         return WebBeansContext.getInstance().getAnnotationManager().hasNamedOnStereoTypes(bean);
@@ -1465,6 +1470,7 @@ public final class WebBeansUtil
      * defined by the specification.
      * @param clazz stereotype class
      */
+    @Deprecated
     public static void checkStereoTypeClass(Class<? extends Annotation> clazz)
     {
         WebBeansContext.getInstance().getAnnotationManager().checkStereoTypeClass(clazz, clazz.getDeclaredAnnotations());
@@ -1475,6 +1481,7 @@ public final class WebBeansUtil
      * defined by the specification.
      * @param clazz stereotype class
      */
+    @Deprecated
     public static void checkStereoTypeClass(Class<? extends Annotation> clazz, Annotation...annotations)
     {
         WebBeansContext.getInstance().getAnnotationManager().checkStereoTypeClass(clazz, annotations);
@@ -2046,11 +2053,13 @@ public final class WebBeansUtil
 
     }
 
+    @Deprecated
     public static void checkInterceptorResolverParams(Annotation... interceptorBindings)
     {
         WebBeansContext.getInstance().getAnnotationManager().checkInterceptorResolverParams(interceptorBindings);
     }
 
+    @Deprecated
     public static void checkDecoratorResolverParams(Set<Type> apiTypes, Annotation... qualifiers)
     {
         WebBeansContext.getInstance().getAnnotationManager().checkDecoratorResolverParams(apiTypes, qualifiers);
@@ -2437,17 +2446,20 @@ public final class WebBeansUtil
                                                           AnnotatedMethod<?>> annotatedMethods,
                                                           AnnotatedType<?> annotatedType)
     {
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
+
         for(ProducerMethodBean<?> bean : annotatedMethods.keySet())
         {
             AnnotatedMethod<?> annotatedMethod = annotatedMethods.get(bean);
-            Method disposal = WebBeansAnnotatedTypeUtil.getDisposalWithGivenAnnotatedMethod(annotatedType,
-                    bean.getReturnType(), AnnotationUtil.getAnnotationsFromSet(bean.getQualifiers()));
+            Annotation[] annotationsFromSet = AnnotationUtil.getAnnotationsFromSet(bean.getQualifiers());
+            Method disposal = annotationManager.getDisposalWithGivenAnnotatedMethod(annotatedType, bean.getReturnType(), annotationsFromSet);
 
             AnnotatedMethod<?> disposalAnnotated = null;
             GProcessProducerMethod processProducerMethodEvent = null;
             if(disposal != null)
             {
-                disposalAnnotated = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedMethod(disposal, annotatedType);
+                disposalAnnotated = webBeansContext.getAnnotatedElementFactory().newAnnotatedMethod(disposal, annotatedType);
                 processProducerMethodEvent = new GProcessProducerMethod(bean,annotatedMethod,
                                                                         disposalAnnotated.getParameters().get(0));
             }
@@ -2458,7 +2470,7 @@ public final class WebBeansUtil
 
 
             //Fires ProcessProducer
-            WebBeansContext.getInstance().getBeanManagerImpl().fireEvent(processProducerMethodEvent, AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
+            webBeansContext.getBeanManagerImpl().fireEvent(processProducerMethodEvent, AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
         }
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java Fri Jan  7 22:37:16 2011
@@ -784,9 +784,10 @@ public final class WebBeansXMLConfigurat
         XMLDefinitionUtil.checkSimpleWebBeansInXML(simpleClass, webBeanDecleration, createConfigurationFailedMessage());
 
         /* If interceptor, check this is enabled */
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
         if (XMLUtil.hasChildElementWithWebBeansNameSpace(webBeanDecleration, WebBeansConstants.WEB_BEANS_XML_INTERCEPTOR_ELEMENT))
         {
-            if (!WebBeansContext.getInstance().getInterceptorsManager().isInterceptorEnabled(simpleClass))
+            if (!webBeansContext.getInterceptorsManager().isInterceptorEnabled(simpleClass))
             {
                 return null;
             }
@@ -795,7 +796,7 @@ public final class WebBeansXMLConfigurat
         /* If decorator, check this is enabled */
         if (XMLUtil.hasChildElementWithWebBeansNameSpace(webBeanDecleration, WebBeansConstants.WEB_BEANS_XML_DECORATOR_ELEMENT))
         {
-            if (!WebBeansContext.getInstance().getDecoratorsManager().isDecoratorEnabled(simpleClass))
+            if (!webBeansContext.getDecoratorsManager().isDecoratorEnabled(simpleClass))
             {
                 return null;
             }
@@ -810,7 +811,7 @@ public final class WebBeansXMLConfigurat
         /* Configures child elements of this webbeans decleration element */
         configureWebBeanDeclerationChilds(component, webBeanDecleration);
 
-        WebBeansContext.getInstance().getBeanManagerImpl().addBean(component);
+        webBeansContext.getBeanManagerImpl().addBean(component);
 
         return component;
     }
@@ -1797,7 +1798,8 @@ public final class WebBeansXMLConfigurat
 
 
         JMSModel model = new JMSModel(type, jndiName, mapName);
-        WebBeansContext.getInstance().getjMSManager().addJmsModel(model);
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getjMSManager().addJmsModel(model);
 
         for (Annotation ann : bindingTypes)
         {
@@ -1805,8 +1807,8 @@ public final class WebBeansXMLConfigurat
         }
 
         //Adding JMS Beans
-        OpenWebBeansJmsPlugin plugin = WebBeansContext.getInstance().getPluginLoader().getJmsPlugin();
-        WebBeansContext.getInstance().getBeanManagerImpl().addBean(plugin.getJmsBean(model));
+        OpenWebBeansJmsPlugin plugin = webBeansContext.getPluginLoader().getJmsPlugin();
+        webBeansContext.getBeanManagerImpl().addBean(plugin.getJmsBean(model));
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLAnnotationTypeManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLAnnotationTypeManager.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLAnnotationTypeManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLAnnotationTypeManager.java Fri Jan  7 22:37:16 2011
@@ -29,7 +29,6 @@ import java.util.concurrent.CopyOnWriteA
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.deployment.StereoTypeManager;
 import org.apache.webbeans.deployment.XMLStereoTypeModel;
-import org.apache.webbeans.util.WebBeansUtil;
 import org.w3c.dom.Element;
 
 public class XMLAnnotationTypeManager
@@ -42,11 +41,13 @@ public class XMLAnnotationTypeManager
 
     private Set<Class<? extends Annotation>> xmlStereoTypes = new CopyOnWriteArraySet<Class<? extends Annotation>>();
     private final StereoTypeManager manager;
+    private final WebBeansContext webBeansContext;
 
     public XMLAnnotationTypeManager(WebBeansContext webBeansContext)
     {
 
-        manager = webBeansContext.getStereoTypeManager();
+        this.webBeansContext = webBeansContext;
+        manager = this.webBeansContext.getStereoTypeManager();
     }
 
     public static XMLAnnotationTypeManager getInstance()
@@ -87,7 +88,7 @@ public class XMLAnnotationTypeManager
 
     public void addStereoType(Class<? extends Annotation> stereoType, Element decleration, String name, String errorMessage)
     {
-        WebBeansUtil.checkStereoTypeClass(stereoType);
+        webBeansContext.getAnnotationManager().checkStereoTypeClass(stereoType, stereoType.getDeclaredAnnotations());
 
         XMLStereoTypeModel model = new XMLStereoTypeModel(decleration, name, errorMessage);
         manager.addStereoTypeModel(model);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java Fri Jan  7 22:37:16 2011
@@ -48,7 +48,6 @@ import org.apache.webbeans.component.xml
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
-import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.event.xml.BeanObserverXMLImpl;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.definition.NonexistentFieldException;
@@ -360,13 +359,14 @@ public final class XMLDefinitionUtil
 
     public static <T> void defineXMLSpecializes(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet)
     {
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
         Iterator<Class<? extends Annotation>> it = annotationSet.iterator();
         while (it.hasNext())
         {
             Class<? extends Annotation> temp = it.next();
             if (temp.equals(Specializes.class))
             {
-                WebBeansContext.getInstance().getxMLSpecializesManager().addXMLSpecializeClass(temp);
+                webBeansContext.getxMLSpecializesManager().addXMLSpecializeClass(temp);
             }
         }
     }
@@ -798,6 +798,8 @@ public final class XMLDefinitionUtil
      */
     public static <T, K> void defineXMLObservesMethod(XMLManagedBean<T> component, Method observesMethod, Element observesMethodElement, String errorMessage)
     {
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+
         component.addObservableMethod(observesMethod);
 
 
@@ -843,7 +845,7 @@ public final class XMLDefinitionUtil
 
                 beanObserver.addXMLInjectionObservesParameter(model);
 
-                NotificationManager.getInstance().addObserver(beanObserver, eventType);
+                webBeansContext.getBeanManagerImpl().getNotificationManager().addObserver(beanObserver, eventType);
 
             }
             /* Disposal method parameter other than @Disposes */

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java Fri Jan  7 22:37:16 2011
@@ -560,7 +560,7 @@ public abstract class TestContext implem
      */
     protected void initializeStereoType(Class<? extends Annotation> stereoClass)
     {
-        WebBeansUtil.checkStereoTypeClass(stereoClass);
+        WebBeansContext.getInstance().getAnnotationManager().checkStereoTypeClass(stereoClass, stereoClass.getDeclaredAnnotations());
         StereoTypeModel model = new StereoTypeModel(stereoClass);
         WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/EventTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/EventTest.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/EventTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/EventTest.java Fri Jan  7 22:37:16 2011
@@ -23,7 +23,7 @@ import java.lang.annotation.Annotation;
 import javax.enterprise.util.AnnotationLiteral;
 import javax.enterprise.util.TypeLiteral;
 
-import org.apache.webbeans.event.NotificationManager;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.annotation.binding.Binding1;
 import org.apache.webbeans.test.event.ITypeArgumentEventInterface;
@@ -53,7 +53,7 @@ public class EventTest extends TestConte
         };
 
         LoggedInObserver observer = new LoggedInObserver(ArrayUtil.asSet(anns));
-        NotificationManager.getInstance().addObserver(observer, LoggedInEvent.class);
+        WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager().addObserver(observer, LoggedInEvent.class);
 
         getManager().fireEvent(new LoggedInEvent(), anns);
 
@@ -73,7 +73,7 @@ public class EventTest extends TestConte
         {
         };
 
-        NotificationManager.getInstance().addObserver(observer, tl);
+        WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager().addObserver(observer, tl);
 
         getManager().fireEvent(new TypeArgumentEvent(), anns);
 
@@ -89,7 +89,7 @@ public class EventTest extends TestConte
         };
 
         TypeArgumentInterfaceObserver observer = new TypeArgumentInterfaceObserver(ArrayUtil.asSet(anns));
-        NotificationManager.getInstance().addObserver(observer, ITypeArgumentEventInterface.class);
+        WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager().addObserver(observer, ITypeArgumentEventInterface.class);
 
         getManager().fireEvent(new TypeArgumentEvent(), anns);
         Assert.assertEquals("ok", observer.getResult());

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/exception/EventExceptionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/exception/EventExceptionTest.java?rev=1056549&r1=1056548&r2=1056549&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/exception/EventExceptionTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/exception/EventExceptionTest.java Fri Jan  7 22:37:16 2011
@@ -23,7 +23,7 @@ import java.lang.annotation.Annotation;
 import javax.enterprise.context.NormalScope;
 import javax.enterprise.util.AnnotationLiteral;
 
-import org.apache.webbeans.event.NotificationManager;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.annotation.binding.Binding1;
 import org.apache.webbeans.test.event.LoggedInEvent;
@@ -104,7 +104,7 @@ public class EventExceptionTest extends 
             };
 
             LoggedInObserver observer = new LoggedInObserver(ArrayUtil.asSet(anns));
-            NotificationManager.getInstance().addObserver(observer, LoggedInEvent.class);
+            WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager().addObserver(observer, LoggedInEvent.class);
 
             getManager().fireEvent(new LoggedInEvent(), anns);
 
@@ -134,7 +134,7 @@ public class EventExceptionTest extends 
             };
             
             LoggedInObserver observer = new LoggedInObserver(ArrayUtil.asSet(anns));
-            NotificationManager.getInstance().addObserver(observer, LoggedInEvent.class);
+            WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager().addObserver(observer, LoggedInEvent.class);
 
             getManager().fireEvent(new LoggedInEvent(), anns);
 



Mime
View raw message