openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1061122 [1/4] - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/p...
Date Thu, 20 Jan 2011 04:47:02 GMT
Author: dblevins
Date: Thu Jan 20 04:46:59 2011
New Revision: 1061122

URL: http://svn.apache.org/viewvc?rev=1061122&view=rev
Log:
Getting down to the bottom of the pile
Destatic ResolutionUtil
Destatic InjectionPointFactory
A few methods moved from OWBInterceptor into the AnnotationManager instance
A few methods moved from WebBeansAnnotatedTypeUtil into the WebBeansUtil instance
The vast majority of the rest is converting code to get WebBeansContext instances where they were already close at hand.

OWB-503 status: 550 code uses
Total of 5535 static synchronized accesses and 5958 hashed calls in 340 tests
Average of 16 static synchronized accesses and 17 hashed calls per test

Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/BaseEjbBean.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/OpenWebBeansEjbInterceptor.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/third/ThirdpartyBeanImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.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/config/ManagedBeanConfigurator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WebBeansELResolver.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/inject/AbstractInjectable.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataComparator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/DefaultInjectionTargetImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.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/AfterDeploymentValidationImpl.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/XMLDefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/concepts/apiTypes/tests/ApiTypeTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/javaee/JavaEeInjectionTest.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/mock/MockManager.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/named/NamedTests.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java
    openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java
    openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/BaseEjbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/BaseEjbBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/BaseEjbBean.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/BaseEjbBean.java Thu Jan 20 04:46:59 2011
@@ -49,11 +49,12 @@ public abstract class BaseEjbBean<T> ext
 
     /**
      * Creates a new instance of the session bean.
+     * @param webBeansContext
      * @param ejbClassType ebj class type
      */
-    public BaseEjbBean(Class<T> ejbClassType, SessionBeanType type)
+    public BaseEjbBean(Class<T> ejbClassType, SessionBeanType type, WebBeansContext webBeansContext)
     {
-        super(WebBeansType.ENTERPRISE,ejbClassType);
+        super(WebBeansType.ENTERPRISE,ejbClassType, webBeansContext);
         
         //type of the ejb
         this.ejbType = type;

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/OpenWebBeansEjbInterceptor.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/OpenWebBeansEjbInterceptor.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/OpenWebBeansEjbInterceptor.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/OpenWebBeansEjbInterceptor.java Thu Jan 20 04:46:59 2011
@@ -300,10 +300,10 @@ public class OpenWebBeansEjbInterceptor 
         
         lifecycleCommon(context, InterceptorType.POST_CONSTRUCT);
 
-        if (WebBeansContext.getInstance().getOpenWebBeansConfiguration().isUseEJBInterceptorInjection())
+        if (webBeansContext.getOpenWebBeansConfiguration().isUseEJBInterceptorInjection())
         {
             Object instance = context.getTarget();
-            this.injector = new OWBInjector();
+            this.injector = new OWBInjector(webBeansContext);
             try
             {
                 this.injector.inject(instance, this.cc);
@@ -551,7 +551,7 @@ public class OpenWebBeansEjbInterceptor 
             if (delegateHandler != null)
             {
                 WebBeansDecoratorInterceptor lastInterceptor = new WebBeansDecoratorInterceptor(delegateHandler, instance);
-                decoratorInterceptorDataImpl = new InterceptorDataImpl(true, lastInterceptor);
+                decoratorInterceptorDataImpl = new InterceptorDataImpl(true, lastInterceptor, webBeansContext);
                 decoratorInterceptorDataImpl.setDefinedInInterceptorClass(true);
                 decoratorInterceptorDataImpl.setAroundInvoke(SecurityUtil.doPrivilegedGetDeclaredMethods(lastInterceptor.getClass())[0]);
                 filteredInterceptorStack.add(decoratorInterceptorDataImpl);

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java Thu Jan 20 04:46:59 2011
@@ -84,7 +84,7 @@ public class EjbBeanProxyHandler impleme
     {
         this.ejbBean = ejbBean;
 
-        if(ejbBean.getWebBeansContext().getWebBeansUtil()._isScopeTypeNormal(ejbBean.getScope()))
+        if(ejbBean.getWebBeansContext().getWebBeansUtil().isScopeTypeNormal(ejbBean.getScope()))
         {
             initiateBeanBag((OwbBean<Object>)ejbBean, (CreationalContext<Object>)creationalContext);
         }

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java Thu Jan 20 04:46:59 2011
@@ -87,7 +87,7 @@ public class CdiDefaultEjbInjector
      */
     public void injectDependenciesOfEjbInterceptor(Object ejbInstance, Object interceptorInstance, Object mapKey) throws Exception
     {
-        OWBInjector owbInjector = new OWBInjector();
+        OWBInjector owbInjector = new OWBInjector(webBeansContext);
         CreationalContextImpl<Object> cc = null;
         //Look for contextual ejb or not
         if(this.injectedContextuals.containsKey(mapKey))
@@ -188,7 +188,7 @@ public class CdiDefaultEjbInjector
      */
     private void injectDependenciesOfNonContextualEjb(Object instance, Object mapKey) throws Exception
     {
-        OWBInjector owbInjector = new OWBInjector();        
+        OWBInjector owbInjector = new OWBInjector(webBeansContext);
         CreationalContextImpl<Object> cc = (CreationalContextImpl<Object>)this.beanManager.createCreationalContext(null);
         owbInjector.inject(instance,cc);
         

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java Thu Jan 20 04:46:59 2011
@@ -100,8 +100,8 @@ public final class EjbUtility
         
         //Fires ProcessInjectionTarget
         ProcessInjectionTargetImpl<T> processInjectionTargetEvent =
-            webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEvent(ejbBean);
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEvent(ejbBean);
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessInjectionTarget event observers. Look at logs for further details");
         //Put final InjectionTarget instance
         manager.putInjectionTargetWrapper(ejbBean, new InjectionTargetWrapper(processInjectionTargetEvent.getInjectionTarget()));
@@ -111,9 +111,9 @@ public final class EjbUtility
         {
             AnnotatedMethod<?> method = annotatedElementFactory.newAnnotatedMethod(producerMethod.getCreatorMethod(), annotatedType);
             ProcessProducerImpl<?, ?> producerEvent =
-                webBeansContext.getWebBeansUtil()._fireProcessProducerEventForMethod(producerMethod,
+                webBeansContext.getWebBeansUtil().fireProcessProducerEventForMethod(producerMethod,
                                                                                                    method);
-            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            webBeansContext.getWebBeansUtil().inspectErrorStack(
                 "There are errors that are added by ProcessProducer event observers for ProducerMethods. Look at logs for further details");
 
             annotatedMethods.put(producerMethod, method);
@@ -127,8 +127,8 @@ public final class EjbUtility
         {
             AnnotatedField<?> field = annotatedElementFactory.newAnnotatedField(producerField.getCreatorField(), annotatedType);
             ProcessProducerImpl<?, ?> producerEvent =
-                webBeansContext.getWebBeansUtil()._fireProcessProducerEventForField(producerField, field);
-            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+                webBeansContext.getWebBeansUtil().fireProcessProducerEventForField(producerField, field);
+            webBeansContext.getWebBeansUtil().inspectErrorStack(
                 "There are errors that are added by ProcessProducer event observers for ProducerFields. Look at logs for further details");
 
             annotatedFields.put(producerField, field);
@@ -150,23 +150,23 @@ public final class EjbUtility
         //Fires ProcessManagedBean
         ProcessSessionBeanImpl<T> processBeanEvent = new GProcessSessionBean((Bean<Object>)ejbBean,annotatedType,ejbBean.getEjbName(),ejbBean.getEjbType());
         webBeansContext.getBeanManagerImpl().fireEvent(processBeanEvent, new Annotation[0]);
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessSessionBean event observers for managed beans. Look at logs for further details");
 
         //Fires ProcessProducerMethod
-        webBeansContext.getWebBeansUtil()._fireProcessProducerMethodBeanEvent(annotatedMethods,
+        webBeansContext.getWebBeansUtil().fireProcessProducerMethodBeanEvent(annotatedMethods,
                                                                                             annotatedType);
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessProducerMethod event observers for producer method beans. Look at logs for further details");
 
         //Fires ProcessProducerField
-        webBeansContext.getWebBeansUtil()._fireProcessProducerFieldBeanEvent(annotatedFields);
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().fireProcessProducerFieldBeanEvent(annotatedFields);
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessProducerField event observers for producer field beans. Look at logs for further details");
 
         //Fire ObservableMethods
-        webBeansContext.getWebBeansUtil()._fireProcessObservableMethodBeanEvent(observerMethodsMap);
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().fireProcessObservableMethodBeanEvent(observerMethodsMap);
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessObserverMethod event observers for observer methods. Look at logs for further details");
 
         manager.addBean(ejbBean);

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=1061122&r1=1061121&r2=1061122&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 Thu Jan 20 04:46:59 2011
@@ -39,14 +39,19 @@ import javax.enterprise.inject.Stereotyp
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.util.Nonbinding;
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.inject.Qualifier;
 import javax.inject.Scope;
 import javax.interceptor.InterceptorBinding;
+
+import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
@@ -811,4 +816,52 @@ public final class AnnotationManager
 
     }
 
+    /**
+     * JavaEE components can not inject {@link javax.enterprise.inject.spi.InjectionPoint}.
+     * @param clazz javaee component class info
+     * @throws WebBeansConfigurationException exception if condition is not applied
+     */
+    public void checkInjectionPointForInjectInjectionPoint(Class<?> clazz)
+    {
+        Asserts.nullCheckForClass(clazz);
+        Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(clazz);
+        for(Field field : fields)
+        {
+            if(field.getAnnotation(Inject.class) != null)
+            {
+                if(field.getType() == InjectionPoint.class)
+                {
+                    Annotation[] anns = getQualifierAnnotations(field.getDeclaredAnnotations());
+                    if (AnnotationUtil.hasAnnotation(anns, Default.class))
+                    {
+                        throw new WebBeansConfigurationException("Java EE Component class :  " + clazz + " can not inject InjectionPoint");
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns trur for serializable types.
+     * @param clazz class info
+     * @return true if class is serializable
+     */
+    public static boolean checkInjectionPointForInterceptorPassivation(Class<?> clazz)
+    {
+        Asserts.nullCheckForClass(clazz);
+        Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(clazz);
+        for(Field field : fields)
+        {
+            if(field.getAnnotation(Inject.class) != null)
+            {
+                Class<?> type = field.getType();
+                if(!Serializable.class.isAssignableFrom(type))
+                {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java Thu Jan 20 04:46:59 2011
@@ -34,8 +34,11 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.Decorator;
 import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.inheritance.BeanInheritedMetaData;
 import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
 import org.apache.webbeans.decorator.WebBeansDecorator;
@@ -43,7 +46,6 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.InjectableField;
 import org.apache.webbeans.inject.InjectableMethods;
-import org.apache.webbeans.inject.OWBInjector;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.intercept.InterceptorType;
 import org.apache.webbeans.intercept.InterceptorUtil;
@@ -98,10 +100,11 @@ public abstract class AbstractInjectionT
      * 
      * @param webBeansType webbean type
      * @param returnType bean class type
+     * @param webBeansContext
      */
-    protected AbstractInjectionTargetBean(WebBeansType webBeansType, Class<T> returnType)
+    protected AbstractInjectionTargetBean(WebBeansType webBeansType, Class<T> returnType, WebBeansContext webBeansContext)
     {
-        super(webBeansType, returnType);
+        super(webBeansType, returnType, webBeansContext);
     }
 
     /**
@@ -635,7 +638,7 @@ public abstract class AbstractInjectionT
                     }               
                     else
                     {
-                        if(!OWBInjector.checkInjectionPointForInterceptorPassivation(interceptorClass))
+                        if(!AnnotationManager.checkInjectionPointForInterceptorPassivation(interceptorClass))
                         {
                             throw new WebBeansConfigurationException(MessageFormat.format(
                                     logger.getTokenString(OWBLogConst.EXCEPT_0017), toString(), interceptorClass));

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java Thu Jan 20 04:46:59 2011
@@ -110,23 +110,25 @@ public abstract class AbstractOwbBean<T>
      * calling this.
      * 
      * @param returnType of the bean
+     * @param webBeansContext
      * @param webBeansType web beans type
      */
-    protected AbstractOwbBean(WebBeansType webBeansType, Class<T> returnType)
+    protected AbstractOwbBean(WebBeansType webBeansType, Class<T> returnType, WebBeansContext webBeansContext)
     {
         this.webBeansType = webBeansType;
         this.returnType = returnType;
-        webBeansContext = WebBeansContext.getInstance();
+        this.webBeansContext = webBeansContext;
     }
     
     /**
      * Creates a new instance.
      * 
      * @param webBeanType beans type
+     * @param webBeansContext
      */
-    protected AbstractOwbBean(WebBeansType webBeanType)
+    protected AbstractOwbBean(WebBeansType webBeanType, WebBeansContext webBeansContext)
     {
-        this(webBeanType, null);
+        this(webBeanType, null, webBeansContext);
     }
 
     /**
@@ -681,7 +683,7 @@ public abstract class AbstractOwbBean<T>
             {
                 if(!injectionPoint.isTransient())
                 {
-                    if(!getWebBeansContext().getWebBeansUtil()._isPassivationCapableDependency(injectionPoint))
+                    if(!getWebBeansContext().getWebBeansUtil().isPassivationCapableDependency(injectionPoint))
                     {
                         if(injectionPoint.getAnnotated().isAnnotationPresent(Disposes.class))
                         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java Thu Jan 20 04:46:59 2011
@@ -48,7 +48,7 @@ public abstract class AbstractProducerBe
      */
     protected AbstractProducerBean(WebBeansType type, Class<T> returnType, InjectionTargetBean<?> ownerComponent)
     {
-        super(type, returnType);
+        super(type, returnType, ownerComponent.getWebBeansContext());
         this.ownerComponent = ownerComponent;
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BeanManagerBean.java Thu Jan 20 04:46:59 2011
@@ -22,15 +22,16 @@ import javax.enterprise.context.spi.Crea
 import javax.enterprise.inject.spi.BeanManager;
 
 import org.apache.webbeans.annotation.ApplicationScopeLiteral;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectableBeanManager;
 
 public class BeanManagerBean extends AbstractOwbBean<BeanManager>
 {
     private BeanManager manager = null;
 
-    public BeanManagerBean()
+    public BeanManagerBean(WebBeansContext webBeansContext)
     {
-        super(WebBeansType.MANAGER, BeanManager.class);
+        super(WebBeansType.MANAGER, BeanManager.class, webBeansContext);
         setImplScopeType(new ApplicationScopeLiteral());
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java Thu Jan 20 04:46:59 2011
@@ -160,7 +160,7 @@ public abstract class BuildInOwbBean<T> 
     @SuppressWarnings("unchecked")
     protected BuildInOwbBean(WebBeansType webBeansType, Class<T> returnType)
     {
-        super(webBeansType, returnType);
+        super(webBeansType, returnType, WebBeansContext.getInstance());
         initBuildInBeanConfig(getWebBeansContext());
         this.handlerClassName = proxyHandlerMap.get(this.getWebBeansType());
         if (handlerClassName.equalsIgnoreCase(PROXY_HANDLER_VALUE_NONE) ||

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java Thu Jan 20 04:46:59 2011
@@ -20,6 +20,8 @@ package org.apache.webbeans.component;
 
 import javax.enterprise.context.Conversation;
 import javax.enterprise.context.spi.CreationalContext;
+
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.conversation.ConversationImpl;
 import org.apache.webbeans.spi.ConversationService;
 
@@ -32,10 +34,11 @@ public class ConversationBean extends Ab
 {
     /**
      * Default constructor.
+     * @param webBeansContext
      */
-    public ConversationBean()
+    public ConversationBean(WebBeansContext webBeansContext)
     {
-        super(WebBeansType.CONVERSATION, Conversation.class);
+        super(WebBeansType.CONVERSATION, Conversation.class, webBeansContext);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/EventBean.java Thu Jan 20 04:46:59 2011
@@ -27,6 +27,7 @@ import javax.enterprise.event.Event;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.util.TypeLiteral;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.event.EventImpl;
 import org.apache.webbeans.exception.WebBeansException;
 
@@ -42,11 +43,12 @@ public class EventBean<T> extends Abstra
 
     /**
      * Creates a new instance of event bean.
+     * @param webBeansContext
      */
     @SuppressWarnings("serial")
-    public EventBean()
+    public EventBean(WebBeansContext webBeansContext)
     {
-        super(WebBeansType.OBSERVABLE,new TypeLiteral<Event<T>>(){}.getRawType());
+        super(WebBeansType.OBSERVABLE,new TypeLiteral<Event<T>>(){}.getRawType(), webBeansContext);
     }
     
     /**
@@ -77,7 +79,7 @@ public class EventBean<T> extends Abstra
             
             try
             {
-                instance = new EventImpl<T>(qualifiers, eventType);
+                instance = new EventImpl<T>(qualifiers, eventType, getWebBeansContext());
             }
             catch (Exception e)
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ExtensionBean.java Thu Jan 20 04:46:59 2011
@@ -21,6 +21,7 @@ package org.apache.webbeans.component;
 import javax.enterprise.context.spi.CreationalContext;
 
 import org.apache.webbeans.annotation.ApplicationScopeLiteral;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.portable.events.ExtensionLoader;
 
 /**
@@ -36,10 +37,11 @@ public class ExtensionBean<T> extends Ab
      * Creates a new extesion bean.
      * 
      * @param returnType return type
+     * @param webBeansContext
      */
-    public ExtensionBean(Class<T> returnType)
+    public ExtensionBean(Class<T> returnType, WebBeansContext webBeansContext)
     {
-        super(WebBeansType.EXTENSION,returnType);
+        super(WebBeansType.EXTENSION,returnType, webBeansContext);
         setImplScopeType(new ApplicationScopeLiteral());
     }
     

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionPointBean.java Thu Jan 20 04:46:59 2011
@@ -20,6 +20,7 @@ package org.apache.webbeans.component;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.annotation.DependentScopeLiteral;
+import org.apache.webbeans.config.WebBeansContext;
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.InjectionPoint;
@@ -38,9 +39,9 @@ public class InjectionPointBean extends 
         local.remove();
     }
 
-    public InjectionPointBean()
+    public InjectionPointBean(WebBeansContext webBeansContext)
     {
-        super(WebBeansType.INJECTIONPOINT,InjectionPoint.class);
+        super(WebBeansType.INJECTIONPOINT,InjectionPoint.class, webBeansContext);
         
         addQualifier(new DefaultLiteral());
         setImplScopeType(new DependentScopeLiteral());

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InstanceBean.java Thu Jan 20 04:46:59 2011
@@ -28,6 +28,7 @@ import javax.enterprise.inject.spi.Injec
 import javax.enterprise.util.TypeLiteral;
 import javax.inject.Provider;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.inject.instance.InstanceFactory;
 
 public class InstanceBean<T> extends AbstractOwbBean<Provider<T>>
@@ -36,9 +37,9 @@ public class InstanceBean<T> extends Abs
     public static ThreadLocal<InjectionPoint> local = new ThreadLocal<InjectionPoint>();
     
     @SuppressWarnings("serial")
-    public InstanceBean()
+    public InstanceBean(WebBeansContext webBeansContext)
     {
-        super(WebBeansType.INSTANCE, new TypeLiteral<Provider<T>>(){}.getRawType());        
+        super(WebBeansType.INSTANCE, new TypeLiteral<Provider<T>>(){}.getRawType(), webBeansContext);
     }
     
          

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagedBean.java Thu Jan 20 04:46:59 2011
@@ -26,6 +26,7 @@ import javassist.util.proxy.ProxyObject;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Decorator;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.decorator.AbstractDecoratorMethodHandler;
 import org.apache.webbeans.inject.InjectableConstructor;
 import org.apache.webbeans.intercept.InterceptorData;
@@ -42,9 +43,9 @@ public class ManagedBean<T> extends Abst
     
     boolean isAbstractDecorator;
 
-    public ManagedBean(Class<T> returnType)
+    public ManagedBean(Class<T> returnType, WebBeansContext webBeansContext)
     {
-        this(returnType, WebBeansType.MANAGED);
+        this(returnType, WebBeansType.MANAGED, webBeansContext);
     }
 
     /**
@@ -52,10 +53,11 @@ public class ManagedBean<T> extends Abst
      * 
      * @param returnType bean class
      * @param type webbeans type
+     * @param webBeansContext
      */
-    public ManagedBean(Class<T> returnType, WebBeansType type)
+    public ManagedBean(Class<T> returnType, WebBeansType type, WebBeansContext webBeansContext)
     {
-        super(type, returnType);
+        super(type, returnType, webBeansContext);
         
         //Setting inherited meta data instance
         setInheritedMetaData();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewBean.java Thu Jan 20 04:46:59 2011
@@ -20,6 +20,8 @@ package org.apache.webbeans.component;
 
 import javax.enterprise.context.spi.CreationalContext;
 
+import org.apache.webbeans.config.WebBeansContext;
+
 /**
  * Component definition with {@link javax.enterprise.inject.New} binding annotation.
  * 
@@ -32,9 +34,9 @@ public class NewBean<T> extends ManagedB
 {
     private WebBeansType definedType;
 
-    public NewBean(Class<T> returnType, WebBeansType definedType)
+    public NewBean(Class<T> returnType, WebBeansType definedType, WebBeansContext webBeansContext)
     {
-        super(returnType);
+        super(returnType, webBeansContext);
         this.definedType = definedType;        
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java Thu Jan 20 04:46:59 2011
@@ -178,7 +178,7 @@ public class ProducerFieldBean<T> extend
                               " return type in the component implementation class : " +
                               this.ownerComponent.getReturnType().getName() + " with passivating scope @" +
                               this.getScope().getName() + " must be Serializable";
-        getWebBeansContext().getWebBeansUtil()._checkSerializableScopeType(this.getScope(),
+        getWebBeansContext().getWebBeansUtil().checkSerializableScopeType(this.getScope(),
                                                                                     this.isSerializable(), errorMessage);
     }
     

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java Thu Jan 20 04:46:59 2011
@@ -385,7 +385,7 @@ public class ProducerMethodBean<T> exten
                               " return type in the component implementation class : " +
                               this.ownerComponent.getReturnType().getName() + " with passivating scope @" +
                               this.getScope().getName() + " must be Serializable";
-        getWebBeansContext().getWebBeansUtil()._checkSerializableScopeType(this.getScope(),
+        getWebBeansContext().getWebBeansUtil().checkSerializableScopeType(this.getScope(),
                                                                                     this.isSerializable(), errorMessage);
 
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java Thu Jan 20 04:46:59 2011
@@ -64,12 +64,12 @@ public class ManagedBeanCreatorImpl<T> e
         }
         else
         {
-            WebBeansAnnotatedTypeUtil.checkManagedBeanCondition(getAnnotatedType());
+            webBeansContext.getWebBeansUtil().checkManagedBeanCondition(getAnnotatedType());
         }
         
         WebBeansUtil.checkGenericType(getBean());
         //Check Unproxiable
-        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(getBean(), getBean().getScope());
+        webBeansContext.getWebBeansUtil().checkUnproxiableApiType(getBean(), getBean().getScope());
     }
 
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/third/ThirdpartyBeanImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/third/ThirdpartyBeanImpl.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/third/ThirdpartyBeanImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/third/ThirdpartyBeanImpl.java Thu Jan 20 04:46:59 2011
@@ -29,6 +29,7 @@ import javax.enterprise.inject.spi.Passi
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.WebBeansType;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.inject.AlternativesManager;
 
 public class ThirdpartyBeanImpl<T> extends AbstractOwbBean<T> implements Bean<T>
@@ -36,9 +37,9 @@ public class ThirdpartyBeanImpl<T> exten
     private Bean<T> bean = null;
     
     
-    public ThirdpartyBeanImpl(Bean<T> bean)
+    public ThirdpartyBeanImpl(Bean<T> bean, WebBeansContext webBeansContext)
     {
-        super(WebBeansType.THIRDPARTY);
+        super(WebBeansType.THIRDPARTY, webBeansContext);
         
         this.bean = bean;
         

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java Thu Jan 20 04:46:59 2011
@@ -31,6 +31,7 @@ import javax.enterprise.context.spi.Crea
 
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.xml.XMLInjectableConstructor;
 import org.apache.webbeans.inject.xml.XMLInjectableField;
@@ -61,10 +62,11 @@ public class XMLManagedBean<T> extends M
      * Creates new XML defined webbeans component.
      * 
      * @param returnType type of the webbeans component
+     * @param webBeansContext
      */
-    public XMLManagedBean(Class<T> returnType)
+    public XMLManagedBean(Class<T> returnType, WebBeansContext webBeansContext)
     {
-        super(returnType);
+        super(returnType, webBeansContext);
     }
 
     /*

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=1061122&r1=1061121&r2=1061122&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 Thu Jan 20 04:46:59 2011
@@ -60,7 +60,6 @@ import org.apache.webbeans.deployment.St
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansDeploymentException;
 import org.apache.webbeans.exception.inject.InconsistentSpecializationException;
-import org.apache.webbeans.inject.OWBInjector;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
@@ -75,7 +74,6 @@ import org.apache.webbeans.spi.plugins.O
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.InjectionExceptionUtils;
-import org.apache.webbeans.util.WebBeansAnnotatedTypeUtil;
 import org.apache.webbeans.util.WebBeansConstants;
 import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.xml.WebBeansXMLConfigurator;
@@ -148,7 +146,7 @@ public class BeansDeployer
                 }
 
                 // Register Manager built-in component
-                webBeansContext.getBeanManagerImpl().addBean(WebBeansUtil.getManagerBean());
+                webBeansContext.getBeanManagerImpl().addBean(webBeansContext.getWebBeansUtil().getManagerBean());
 
                 //Fire Event
                 fireBeforeBeanDiscoveryEvent();
@@ -199,18 +197,19 @@ public class BeansDeployer
     private void configureDefaultBeans()
     {
         BeanManagerImpl beanManager = webBeansContext.getBeanManagerImpl();
-        
+        WebBeansUtil webBeansUtil = webBeansContext.getWebBeansUtil();
+
         // Register Conversation built-in component
-        beanManager.addBean(WebBeansUtil.getConversationBean());
+        beanManager.addBean(webBeansUtil.getConversationBean());
         
         // Register InjectionPoint bean
-        beanManager.addBean(WebBeansUtil.getInjectionPointBean());
+        beanManager.addBean(webBeansUtil.getInjectionPointBean());
         
         //Register Instance Bean
-        beanManager.addBean(WebBeansUtil.getInstanceBean());
+        beanManager.addBean(webBeansUtil.getInstanceBean());
         
         //Register Event Bean
-        beanManager.addBean(WebBeansUtil.getEventBean());
+        beanManager.addBean(webBeansUtil.getEventBean());
         
         //REgister Provider Beans
         OpenWebBeansJavaEEPlugin beanEeProvider = webBeansContext.getPluginLoader().getJavaEEPlugin();
@@ -252,7 +251,7 @@ public class BeansDeployer
     private void fireBeforeBeanDiscoveryEvent()
     {
         BeanManager manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new BeforeBeanDiscoveryImpl(),new Annotation[0]);
+        manager.fireEvent(new BeforeBeanDiscoveryImpl(webBeansContext),new Annotation[0]);
     }
     
     /**
@@ -261,9 +260,9 @@ public class BeansDeployer
     private void fireAfterBeanDiscoveryEvent()
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new AfterBeanDiscoveryImpl(),new Annotation[0]);
+        manager.fireEvent(new AfterBeanDiscoveryImpl(webBeansContext),new Annotation[0]);
 
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by AfterBeanDiscovery event observers. Look at logs for further details");
     }
     
@@ -273,9 +272,9 @@ public class BeansDeployer
     private void fireAfterDeploymentValidationEvent()
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new AfterDeploymentValidationImpl(),new Annotation[0]);
+        manager.fireEvent(new AfterDeploymentValidationImpl(manager),new Annotation[0]);
 
-        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+        webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by AfterDeploymentValidation event observers. Look at logs for further details");
     }
     
@@ -522,7 +521,7 @@ public class BeansDeployer
     {
         // Fires ProcessAnnotatedType
         ProcessAnnotatedTypeImpl<?> processAnnotatedEvent =
-            webBeansContext.getWebBeansUtil()._fireProcessAnnotatedTypeEvent(annotatedType);
+            webBeansContext.getWebBeansUtil().fireProcessAnnotatedTypeEvent(annotatedType);
 
         // if veto() is called
         if (processAnnotatedEvent.isVeto())
@@ -631,14 +630,14 @@ public class BeansDeployer
                         specialClassList.add(specialClass);
                     }
                 }
-                webBeansContext.getWebBeansUtil()._configureSpecializations(specialClassList);
+                webBeansContext.getWebBeansUtil().configureSpecializations(specialClassList);
             }
 
             // XML Defined Specializations
             checkXMLSpecializations();
             
             //configure specialized producer beans.
-            webBeansContext.getWebBeansUtil()._configureProducerMethodSpecializations();
+            webBeansContext.getWebBeansUtil().configureProducerMethodSpecializations();
         }
         catch(Exception e)
         {
@@ -681,7 +680,7 @@ public class BeansDeployer
             }
             specialClassList.add(specialClass);
         }
-        webBeansContext.getWebBeansUtil()._configureSpecializations(specialClassList);
+        webBeansContext.getWebBeansUtil().configureSpecializations(specialClassList);
     }
 
     /**
@@ -748,7 +747,7 @@ public class BeansDeployer
                         if (!webBeansContext.getxMLAnnotationTypeManager().hasStereoType(stereoClass))
                         {
                             webBeansContext.getAnnotationManager().checkStereoTypeClass(stereoClass, stereoClass.getDeclaredAnnotations());
-                            StereoTypeModel model = new StereoTypeModel(stereoClass);
+                            StereoTypeModel model = new StereoTypeModel(webBeansContext, stereoClass);
                             webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
                         }
                     }                    
@@ -764,13 +763,13 @@ public class BeansDeployer
      */
     protected void addDefaultStereoTypes()
     {
-        StereoTypeModel model = new StereoTypeModel(Model.class);
+        StereoTypeModel model = new StereoTypeModel(webBeansContext, Model.class);
         webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
         
-        model = new StereoTypeModel(javax.decorator.Decorator.class);
+        model = new StereoTypeModel(webBeansContext, javax.decorator.Decorator.class);
         webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
         
-        model = new StereoTypeModel(Interceptor.class);
+        model = new StereoTypeModel(webBeansContext, Interceptor.class);
         webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
     }
     
@@ -791,13 +790,13 @@ public class BeansDeployer
         //Fires ProcessInjectionTarget event for Java EE components instances
         //That supports injections but not managed beans
         ProcessInjectionTargetImpl<T> processInjectionTargetEvent = null;
-        if(webBeansContext.getWebBeansUtil()._supportsJavaEeComponentInjections(clazz))
+        if(webBeansContext.getWebBeansUtil().supportsJavaEeComponentInjections(clazz))
         {
             //Fires ProcessInjectionTarget
             processInjectionTargetEvent =
-                webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEventForJavaEeComponents(
+                webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEventForJavaEeComponents(
                     clazz);
-            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            webBeansContext.getWebBeansUtil().inspectErrorStack(
                 "There are errors that are added by ProcessInjectionTarget event observers. Look at logs for further details");
 
             //Sets custom InjectionTarget instance
@@ -808,7 +807,7 @@ public class BeansDeployer
             }
             
             //Checks that not contains @Inject InjectionPoint
-            OWBInjector.checkInjectionPointForInjectInjectionPoint(clazz);
+            webBeansContext.getAnnotationManager().checkInjectionPointForInjectInjectionPoint(clazz);
         }
         
         //Check for whether this class is candidate for Managed Bean
@@ -818,7 +817,7 @@ public class BeansDeployer
             ManagedBeanConfigurator.checkManagedBeanCondition(clazz);
             
             //Temporary managed bean instance creationa
-            ManagedBean<T> managedBean = new ManagedBean<T>(clazz,WebBeansType.MANAGED);                  
+            ManagedBean<T> managedBean = new ManagedBean<T>(clazz,WebBeansType.MANAGED, webBeansContext);                  
             ManagedBeanCreatorImpl<T> managedBeanCreator = new ManagedBeanCreatorImpl<T>(managedBean);
             
             boolean annotationTypeSet = false;
@@ -835,11 +834,11 @@ public class BeansDeployer
             if(processInjectionTargetEvent == null)
             {
                 processInjectionTargetEvent =
-                    webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEvent(managedBean);
+                    webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEvent(managedBean);
             }    
             
             //Decorator
-            if(WebBeansAnnotatedTypeUtil.isAnnotatedTypeDecorator(annotatedType))
+            if(WebBeansUtil.isAnnotatedTypeDecorator(annotatedType))
             {
                 if (logger.wblWillLogDebug())
                 {
@@ -847,16 +846,16 @@ public class BeansDeployer
                 }
                 if(annotationTypeSet)
                 {
-                    WebBeansAnnotatedTypeUtil.defineDecorator(annotatedType);
+                    webBeansContext.getWebBeansUtil().defineDecorator(annotatedType);
                 }
                 else
                 {
-                    webBeansContext.getWebBeansUtil()._defineDecorator(managedBeanCreator,
+                    webBeansContext.getWebBeansUtil().defineDecorator(managedBeanCreator,
                                                                                      processInjectionTargetEvent);
                 }
             }
             //Interceptor
-            else if(WebBeansAnnotatedTypeUtil.isAnnotatedTypeInterceptor(annotatedType))
+            else if(WebBeansUtil.isAnnotatedTypeInterceptor(annotatedType))
             {
                 if (logger.wblWillLogDebug())
                 {
@@ -864,11 +863,11 @@ public class BeansDeployer
                 }
                 if(annotationTypeSet)
                 {
-                    WebBeansAnnotatedTypeUtil.defineInterceptor(annotatedType);
+                    webBeansContext.getWebBeansUtil().defineInterceptor(annotatedType);
                 }
                 else
                 {
-                    webBeansContext.getWebBeansUtil()._defineInterceptor(managedBeanCreator,
+                    webBeansContext.getWebBeansUtil().defineInterceptor(managedBeanCreator,
                                                                                        processInjectionTargetEvent);
                 }
             }
@@ -884,7 +883,7 @@ public class BeansDeployer
                 {
                     logger.debug("Found Managed Bean with class name : [{0}]", annotatedType.getJavaClass().getName());
                 }
-                webBeansContext.getWebBeansUtil()._defineManagedBean(managedBeanCreator,
+                webBeansContext.getWebBeansUtil().defineManagedBean(managedBeanCreator,
                                                                                    processInjectionTargetEvent);
             }
             
@@ -906,6 +905,6 @@ public class BeansDeployer
     protected <T> void defineEnterpriseWebBean(Class<T> clazz, ProcessAnnotatedType<T> processAnnotatedTypeEvent)
     {
         InjectionTargetBean<T> bean = (InjectionTargetBean<T>) EJBWebBeansConfigurator.defineEjbBean(clazz, processAnnotatedTypeEvent);
-        webBeansContext.getWebBeansUtil()._setInjectionTargetBeanEnableFlag(bean);
+        webBeansContext.getWebBeansUtil().setInjectionTargetBeanEnableFlag(bean);
     }
 }

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=1061122&r1=1061121&r2=1061122&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 Thu Jan 20 04:46:59 2011
@@ -70,8 +70,6 @@ import org.apache.webbeans.decorator.Web
 import org.apache.webbeans.event.EventUtil;
 import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
-import org.apache.webbeans.inject.OWBInjector;
-import org.apache.webbeans.inject.impl.InjectionPointFactory;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.intercept.WebBeansInterceptorConfig;
 import org.apache.webbeans.intercept.ejb.EJBInterceptorConfig;
@@ -685,12 +683,12 @@ public final class DefinitionUtil
         Annotation[] methodAnns = method.getDeclaredAnnotations();
 
         WebBeansContext webBeansContext = parent.getWebBeansContext();
-        webBeansContext.getWebBeansUtil()._setBeanEnableFlagForProducerBean(parent, component, methodAnns);
+        webBeansContext.getWebBeansUtil().setBeanEnableFlagForProducerBean(parent, component, methodAnns);
 
         DefinitionUtil.defineProducerMethodApiTypes(component, method.getGenericReturnType(), methodAnns);
         DefinitionUtil.defineScopeType(component, methodAnns, "WebBeans producer method : " + method.getName() + " in class " + parent.getReturnType().getName()
                                                               + " must declare default @Scope annotation");
-        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(component, component.getScope());
+        webBeansContext.getWebBeansUtil().checkUnproxiableApiType(component, component.getScope());
         WebBeansUtil.checkProducerGenericType(component,method);
         DefinitionUtil.defineQualifiers(component, methodAnns);
         DefinitionUtil.defineName(component, methodAnns, WebBeansUtil.getProducerDefaultName(method.getName()));
@@ -742,12 +740,12 @@ public final class DefinitionUtil
         Annotation[] fieldAnns = field.getDeclaredAnnotations();
 
         WebBeansContext webBeansContext = parent.getWebBeansContext();
-        webBeansContext.getWebBeansUtil()._setBeanEnableFlagForProducerBean(parent, component, fieldAnns);
+        webBeansContext.getWebBeansUtil().setBeanEnableFlagForProducerBean(parent, component, fieldAnns);
 
         DefinitionUtil.defineProducerMethodApiTypes(component, field.getGenericType(), fieldAnns);
         DefinitionUtil.defineScopeType(component, fieldAnns, "WebBeans producer method : " + field.getName() + " in class " + parent.getReturnType().getName()
                                                              + " must declare default @Scope annotation");
-        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(component, component.getScope());
+        webBeansContext.getWebBeansUtil().checkUnproxiableApiType(component, component.getScope());
         WebBeansUtil.checkProducerGenericType(component,field);
         DefinitionUtil.defineQualifiers(component, fieldAnns);
         DefinitionUtil.defineName(component, fieldAnns, field.getName());
@@ -779,8 +777,9 @@ public final class DefinitionUtil
             Type type = AnnotationUtil.getMethodFirstParameterWithAnnotation(declaredMethod, Disposes.class);
             Annotation[] annot = annotationManager.getMethodFirstParameterQualifierWithGivenAnnotation(declaredMethod, Disposes.class);
 
+            InjectionResolver instance = component.getWebBeansContext().getBeanManagerImpl().getInjectionResolver();
 
-            Set<Bean<?>> set = InjectionResolver.getInstance().implResolveByType(type, annot);
+            Set<Bean<?>> set = instance.implResolveByType(type, annot);
             if (set.isEmpty())
             {
                 throwUnsatisfiedResolutionException(clazz, declaredMethod, annot);
@@ -965,7 +964,7 @@ public final class DefinitionUtil
                     continue;
                 }
                 
-                checkForInjectedInitializerMethod(clazz, method);
+                checkForInjectedInitializerMethod(clazz, method, component.getWebBeansContext());
             }
             else
             {
@@ -1006,7 +1005,8 @@ public final class DefinitionUtil
     /**
      * add the definitions for a &#x0040;Initializer method.
      */
-    private static <T> void checkForInjectedInitializerMethod(Class<T> clazz, Method method)
+    private static <T> void checkForInjectedInitializerMethod(Class<T> clazz, Method method,
+                                                              WebBeansContext webBeansContext)
     {
         TypeVariable<?>[] args = method.getTypeParameters();
         if(args.length > 0)
@@ -1021,7 +1021,7 @@ public final class DefinitionUtil
         {
             Annotation[] a = anns[i];
             Type t = type[i];
-            WebBeansContext.getInstance().getAnnotationManager().checkForNewQualifierForDeployment(t, clazz, method.getName(), a);
+            webBeansContext.getAnnotationManager().checkForNewQualifierForDeployment(t, clazz, method.getName(), a);
         }
 
         if (method.getAnnotation(Produces.class) == null)
@@ -1046,18 +1046,18 @@ public final class DefinitionUtil
         // If bean is not session bean
         if(!(bean instanceof EnterpriseBeanMarker))
         {
-            EJBInterceptorConfig.configure(((AbstractOwbBean)bean).getReturnType(), bean.getInterceptorStack());   
+            EJBInterceptorConfig.configure(((AbstractOwbBean)bean).getReturnType(), bean.getInterceptorStack(), bean);
         }
         else
         {
             //Check for injected fields in EJB @Interceptors
             List<InterceptorData> stack = new ArrayList<InterceptorData>();
-            EJBInterceptorConfig.configure(bean.getBeanClass(), stack);
+            EJBInterceptorConfig.configure(bean.getBeanClass(), stack, bean);
             for(InterceptorData data : stack)
             {
                 if(data.isDefinedInInterceptorClass())
                 {
-                    if(!OWBInjector.checkInjectionPointForInterceptorPassivation(data.getInterceptorClass()))
+                    if(!AnnotationManager.checkInjectionPointForInterceptorPassivation(data.getInterceptorClass()))
                     {
                         throw new WebBeansConfigurationException("Enterprise bean : " + bean.toString() + " interceptors must have serializable injection points");
                     }
@@ -1130,7 +1130,7 @@ public final class DefinitionUtil
 
     public static <T> void addFieldInjectionPointMetaData(AbstractOwbBean<T> owner, Field field)
     {
-        InjectionPoint injectionPoint = InjectionPointFactory.getFieldInjectionPointData(owner, field);
+        InjectionPoint injectionPoint = owner.getWebBeansContext().getInjectionPointFactory().getFieldInjectionPointData(owner, field);
         if (injectionPoint != null)
         {
             addImplicitComponentForInjectionPoint(injectionPoint);
@@ -1140,7 +1140,7 @@ public final class DefinitionUtil
 
     public static <T> void addMethodInjectionPointMetaData(AbstractOwbBean<T> owner, Method method)
     {
-        List<InjectionPoint> injectionPoints = InjectionPointFactory.getMethodInjectionPointData(owner, method);
+        List<InjectionPoint> injectionPoints = owner.getWebBeansContext().getInjectionPointFactory().getMethodInjectionPointData(owner, method);
         for (InjectionPoint injectionPoint : injectionPoints)
         {
             addImplicitComponentForInjectionPoint(injectionPoint);
@@ -1150,7 +1150,7 @@ public final class DefinitionUtil
 
     public static <T> void addConstructorInjectionPointMetaData(AbstractOwbBean<T> owner, Constructor<T> constructor)
     {
-        List<InjectionPoint> injectionPoints = InjectionPointFactory.getConstructorInjectionPointData(owner, constructor);
+        List<InjectionPoint> injectionPoints = owner.getWebBeansContext().getInjectionPointFactory().getConstructorInjectionPointData(owner, constructor);
         for (InjectionPoint injectionPoint : injectionPoints)
         {
             addImplicitComponentForInjectionPoint(injectionPoint);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java Thu Jan 20 04:46:59 2011
@@ -95,7 +95,7 @@ public final class ManagedBeanConfigurat
     {
         try
         {
-            WebBeansContext.getInstance().getWebBeansUtil()._isManagedBeanClass(clazz);
+            WebBeansContext.getInstance().getWebBeansUtil().isManagedBeanClass(clazz);
 
         }
         catch (WebBeansConfigurationException e)
@@ -122,10 +122,10 @@ public final class ManagedBeanConfigurat
 
         checkManagedBeanCondition(clazz);
 
-        ManagedBean<T> component = new ManagedBean<T>(clazz, type);
+        ManagedBean<T> component = new ManagedBean<T>(clazz, type, webBeansContext);
         manager.putInjectionTargetWrapper(component, new InjectionTargetWrapper(new InjectionTargetProducer(component)));
 
-        webBeansContext.getWebBeansUtil()._setInjectionTargetBeanEnableFlag(component);
+        webBeansContext.getWebBeansUtil().setInjectionTargetBeanEnableFlag(component);
 
         DefinitionUtil.defineSerializable(component);
         DefinitionUtil.defineStereoTypes(component, clazz.getDeclaredAnnotations());

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java Thu Jan 20 04:46:59 2011
@@ -26,6 +26,7 @@ import java.util.Map;
 
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.container.ResolutionUtil;
 import org.apache.webbeans.container.SerializableBeanVault;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.creational.CreationalContextFactory;
@@ -37,6 +38,7 @@ import org.apache.webbeans.decorator.Dec
 import org.apache.webbeans.deployment.StereoTypeManager;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.AlternativesManager;
+import org.apache.webbeans.inject.impl.InjectionPointFactory;
 import org.apache.webbeans.intercept.InterceptorsManager;
 import org.apache.webbeans.jms.JMSManager;
 import org.apache.webbeans.plugins.PluginLoader;
@@ -78,6 +80,8 @@ public class WebBeansContext
     private AnnotationManager annotationManager = new AnnotationManager(this);
     private WebBeansNameSpaceContainer webBeansNameSpaceContainer = new WebBeansNameSpaceContainer();
     private XMLSpecializesManager xmlSpecializesManager = new XMLSpecializesManager();
+    private ResolutionUtil resolutionUtil = new ResolutionUtil(this);
+    private InjectionPointFactory injectionPointFactory = new InjectionPointFactory(this);
 
     private final Map<Class<?>, Object> managerMap = new HashMap<Class<?>, Object>();
 
@@ -160,6 +164,16 @@ public class WebBeansContext
         return serviceInterface.cast(get(implName));
     }
 
+    public InjectionPointFactory getInjectionPointFactory()
+    {
+        return injectionPointFactory;
+    }
+
+    public ResolutionUtil getResolutionUtil()
+    {
+        return resolutionUtil;
+    }
+
     public WebBeansUtil getWebBeansUtil()
     {
         return webBeansUtil;

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=1061122&r1=1061121&r2=1061122&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 Thu Jan 20 04:46:59 2011
@@ -91,7 +91,6 @@ import org.apache.webbeans.spi.plugins.O
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.WebBeansAnnotatedTypeUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.xml.WebBeansXMLConfigurator;
 
@@ -322,7 +321,7 @@ public class BeanManagerImpl implements 
         }
         else
         {
-            ThirdpartyBeanImpl<?> bean = new ThirdpartyBeanImpl(newBean);
+            ThirdpartyBeanImpl<?> bean = new ThirdpartyBeanImpl(newBean, webBeansContext);
             addPassivationInfo(bean);
             this.deploymentBeans.add(bean);
         }
@@ -438,10 +437,10 @@ public class BeanManagerImpl implements 
     @Deprecated
     public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes)
     {
-        ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
+        webBeansContext.getResolutionUtil().getInstanceByTypeConditions(bindingTypes);
         Set<Bean<?>> set = resolveByType(type, bindingTypes);
 
-        ResolutionUtil.checkResolvedBeans(set, type, bindingTypes);
+        webBeansContext.getResolutionUtil().checkResolvedBeans(set, type, bindingTypes);
 
         Bean<?> bean = set.iterator().next();
         
@@ -451,10 +450,10 @@ public class BeanManagerImpl implements 
     @Deprecated
     public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindingTypes)
     {
-        ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
+        webBeansContext.getResolutionUtil().getInstanceByTypeConditions(bindingTypes);
         Set<Bean<?>> set = resolveByType(type, bindingTypes);
 
-        ResolutionUtil.checkResolvedBeans(set, type.getRawType(),bindingTypes);
+        webBeansContext.getResolutionUtil().checkResolvedBeans(set, type.getRawType(), bindingTypes);
 
         Bean<?> bean = set.iterator().next();
         
@@ -470,8 +469,8 @@ public class BeanManagerImpl implements 
     @Deprecated
     public Set<Bean<?>> resolveByType(Class<?> apiType, Annotation... bindingTypes)
     {
-        ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
-        
+        webBeansContext.getResolutionUtil().getInstanceByTypeConditions(bindingTypes);
+
         return this.injectionResolver.implResolveByType(apiType, bindingTypes);
     }
 
@@ -481,8 +480,8 @@ public class BeanManagerImpl implements 
         ParameterizedType ptype = (ParameterizedType) apiType.getType();
         ResolutionUtil.resolveByTypeConditions(ptype);
 
-        ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
-       
+        webBeansContext.getResolutionUtil().getInstanceByTypeConditions(bindingTypes);
+
         return this.injectionResolver.implResolveByType(apiType.getType(), bindingTypes);
     }
 
@@ -542,7 +541,7 @@ public class BeanManagerImpl implements 
     public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindingTypes)
     {
         webBeansContext.getAnnotationManager().checkDecoratorResolverParams(types, bindingTypes);
-        Set<Decorator<?>> intsSet = WebBeansDecoratorConfig.findDeployedWebBeansDecorator(types, bindingTypes);
+        Set<Decorator<?>> intsSet = WebBeansDecoratorConfig.findDeployedWebBeansDecorator(this, types, bindingTypes);
         Iterator<Decorator<?>> itSet = intsSet.iterator();
 
         List<Decorator<?>> decoratorList = new ArrayList<Decorator<?>>();
@@ -553,7 +552,7 @@ public class BeanManagerImpl implements 
 
         }
 
-        Collections.sort(decoratorList, new DecoratorComparator());
+        Collections.sort(decoratorList, new DecoratorComparator(webBeansContext));
 
         return decoratorList;
 
@@ -567,7 +566,7 @@ public class BeanManagerImpl implements 
     {
         webBeansContext.getAnnotationManager().checkInterceptorResolverParams(interceptorBindings);
 
-        Set<Interceptor<?>> intsSet = WebBeansInterceptorConfig.findDeployedWebBeansInterceptor(interceptorBindings);
+        Set<Interceptor<?>> intsSet = WebBeansInterceptorConfig.findDeployedWebBeansInterceptor(interceptorBindings, webBeansContext);
         Iterator<Interceptor<?>> itSet = intsSet.iterator();
 
         List<Interceptor<?>> interceptorList = new ArrayList<Interceptor<?>>();
@@ -836,7 +835,7 @@ public class BeanManagerImpl implements 
         
                 
         //Scope is normal
-        if (webBeansContext.getWebBeansUtil()._isScopeTypeNormal(bean.getScope()))
+        if (webBeansContext.getWebBeansUtil().isScopeTypeNormal(bean.getScope()))
         {
             instance = getEjbOrJmsProxyReference(bean, beanType,creationalContext);
             
@@ -883,7 +882,7 @@ public class BeanManagerImpl implements 
         //Create session bean proxy
         if(bean instanceof EnterpriseBeanMarker)
         {
-            if(webBeansContext.getWebBeansUtil()._isScopeTypeNormal(bean.getScope()))
+            if(webBeansContext.getWebBeansUtil().isScopeTypeNormal(bean.getScope()))
             {
                 //Maybe it is cached
                 if(this.cacheProxies.containsKey(bean))
@@ -1077,7 +1076,7 @@ public class BeanManagerImpl implements 
     @Override
     public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
     {
-        InjectionTargetBean<T> bean = WebBeansAnnotatedTypeUtil.defineManagedBean(type);
+        InjectionTargetBean<T> bean = webBeansContext.getWebBeansUtil().defineManagedBean(type);
 
         return new InjectionTargetProducer<T>(bean);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/InjectionResolver.java Thu Jan 20 04:46:59 2011
@@ -176,18 +176,19 @@ public class InjectionResolver
                 
                 if(newQualifier.value() == New.class)
                 {
-                    beanSet.add(WebBeansUtil.createNewComponent(clazz, type));    
+                    beanSet.add(webBeansContext.getWebBeansUtil().createNewComponent(clazz, type));
                 }
                 else
                 {
-                    beanSet.add(WebBeansUtil.createNewComponent(newQualifier.value(),null));
+                    beanSet.add(webBeansContext.getWebBeansUtil().createNewComponent(newQualifier.value(),null));
                 }
                 
             }
         }
-        
-        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers, injectionPoint);
-        
+
+        webBeansContext.getResolutionUtil().checkResolvedBeans(beanSet, clazz, qualifiers,
+                                                                              injectionPoint);
+
         Bean<?> bean = beanSet.iterator().next();
         
         if(clazz.isPrimitive())
@@ -242,18 +243,18 @@ public class InjectionResolver
                 
                 if(newQualifier.value() == New.class)
                 {
-                    beanSet.add(WebBeansUtil.createNewComponent(clazz,type));    
+                    beanSet.add(webBeansContext.getWebBeansUtil().createNewComponent(clazz,type));
                 }
                 else
                 {
-                    beanSet.add(WebBeansUtil.createNewComponent(newQualifier.value(),null));
+                    beanSet.add(webBeansContext.getWebBeansUtil().createNewComponent(newQualifier.value(),null));
                 }
 
             }
         }
-        
 
-        ResolutionUtil.checkResolvedBeans(beanSet, clazz, qualifiers, injectionPoint);   
+        webBeansContext.getResolutionUtil().checkResolvedBeans(beanSet, clazz, qualifiers,
+                                                                              injectionPoint);
 
         return beanSet.iterator().next();
         

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java Thu Jan 20 04:46:59 2011
@@ -34,22 +34,25 @@ import static org.apache.webbeans.util.I
 
 public final class ResolutionUtil
 {
-    private ResolutionUtil()
-    {
 
+    private final WebBeansContext webBeansContext;
+
+    public ResolutionUtil(WebBeansContext webBeansContext)
+    {
+        this.webBeansContext = webBeansContext;
     }
 
     public static boolean checkBeanTypeAssignableToGivenType(Set<Type> beanTypes, Type givenType, boolean newBean)
-    { 
+    {
         Iterator<Type> itBeanApiTypes = beanTypes.iterator();
         while (itBeanApiTypes.hasNext())
         {
-            Type beanApiType = itBeanApiTypes.next();                    
-            
+            Type beanApiType = itBeanApiTypes.next();
+
             if(ClassUtil.isAssignable(beanApiType, givenType))
             {
                 return true;
-            }           
+            }
             else
             {
                 //Check for @New
@@ -60,13 +63,13 @@ public final class ResolutionUtil
                     {
                         return true;
                     }
-                }                
+                }
             }
         }
-        
+
         return false;
     }
-    
+
     public static void resolveByTypeConditions(ParameterizedType type)
     {
         Asserts.assertNotNull(type, "type parameter can not be null");
@@ -78,17 +81,17 @@ public final class ResolutionUtil
         }
     }
 
-    public static void getInstanceByTypeConditions(Annotation[] qualifiers)
+    public void getInstanceByTypeConditions(Annotation[] qualifiers)
     {
-        WebBeansContext.getInstance().getAnnotationManager().checkQualifierConditions(qualifiers);
+        webBeansContext.getAnnotationManager().checkQualifierConditions(qualifiers);
     }
 
-    public static void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?> type, Annotation[] qualifiers) 
+    public void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?> type, Annotation[] qualifiers)
     {
         checkResolvedBeans(resolvedSet, type, qualifiers, null);
     }
-    
-    public static void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?> type, Annotation[] qualifiers, InjectionPoint injectionPoint)
+
+    public void checkResolvedBeans(Set<Bean<?>> resolvedSet, Class<?> type, Annotation[] qualifiers, InjectionPoint injectionPoint)
     {
         if (resolvedSet.isEmpty())
         {
@@ -101,7 +104,7 @@ public final class ResolutionUtil
         }
 
         Bean<?> bean = resolvedSet.iterator().next();
-        WebBeansContext.getInstance().getWebBeansUtil()._checkUnproxiableApiType(bean, bean.getScope());
+        webBeansContext.getWebBeansUtil().checkUnproxiableApiType(bean, bean.getScope());
 
-    }    
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java?rev=1061122&r1=1061121&r2=1061122&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java Thu Jan 20 04:46:59 2011
@@ -31,6 +31,13 @@ public class DecoratorComparator<T> impl
     /** default serial version UID */
     private static final long serialVersionUID = 1L;
 
+    private final WebBeansContext webBeansContext;
+
+    public DecoratorComparator(WebBeansContext webBeansContext)
+    {
+        this.webBeansContext = webBeansContext;
+    }
+
     public int compare(Decorator<T> o1, Decorator<T> o2)
     {
         WebBeansDecorator<T> src = (WebBeansDecorator<T>) o1;
@@ -45,7 +52,7 @@ public class DecoratorComparator<T> impl
             Class<?> o1Clazz = src.getClazz();
             Class<?> o2Clazz = target.getClazz();
 
-            return WebBeansContext.getInstance().getDecoratorsManager().compare(o1Clazz, o2Clazz);
+            return webBeansContext.getDecoratorsManager().compare(o1Clazz, o2Clazz);
 
         }
     }



Mime
View raw message