openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1084002 - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/ webbeans-impl/src/main/java/org/apache/webbeans/annotation/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/mai...
Date Mon, 21 Mar 2011 22:39:52 GMT
Author: struberg
Date: Mon Mar 21 22:39:52 2011
New Revision: 1084002

URL: http://svn.apache.org/viewvc?rev=1084002&view=rev
Log:
OWB-545 OWB-503 further elimination of static calls on SecurityUtil

Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.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/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/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.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/ObserverMethodImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
    openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
    openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/resource/OpenEjbResourceInjectionService.java
    openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -42,7 +42,6 @@ import org.apache.webbeans.ejb.common.co
 import org.apache.webbeans.ejb.common.interceptor.OpenWebBeansEjbInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.SecurityUtil;
 
 import javassist.util.proxy.MethodHandler;
 
@@ -120,7 +119,7 @@ public class EjbBeanProxyHandler impleme
             }
             
             boolean access = method.isAccessible();
-            SecurityUtil.doPrivilegedSetAccessible(method, true);
+            webBeansContext.getSecurityService().doPrivilegedSetAccessible(method, true);
             try
             {
                 return proceed.invoke(proxyInstance, arguments);
@@ -128,7 +127,7 @@ public class EjbBeanProxyHandler impleme
             }
             finally
             {
-                SecurityUtil.doPrivilegedSetAccessible(method, access);
+                webBeansContext.getSecurityService().doPrivilegedSetAccessible(method, access);
             }            
         }
                 
@@ -192,7 +191,7 @@ public class EjbBeanProxyHandler impleme
             //Call actual method on proxy
             //Actually it is called from OWB Proxy --> EJB Proxy --> Actual Bean Instance
             boolean access = method.isAccessible();
-            SecurityUtil.doPrivilegedSetAccessible(method, true);
+            webBeansContext.getSecurityService().doPrivilegedSetAccessible(method, true);
             try
             {
                 result = method.invoke(webbeansInstance, arguments);
@@ -200,7 +199,7 @@ public class EjbBeanProxyHandler impleme
             }
             finally
             {
-                SecurityUtil.doPrivilegedSetAccessible(method, access);
+                webBeansContext.getSecurityService().doPrivilegedSetAccessible(method, access);
             }            
             
         }

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -27,7 +27,6 @@ import org.apache.webbeans.exception.inj
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ArrayUtil;
 import org.apache.webbeans.util.Asserts;
-import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 import javax.enterprise.context.NormalScope;
@@ -65,11 +64,13 @@ public final class AnnotationManager
 {
 
     private final BeanManagerImpl beanManagerImpl;
+    private final WebBeansContext webBeansContext;
 
     // No instantiate
 
     public AnnotationManager(WebBeansContext context)
     {
+        this.webBeansContext = context;
         beanManagerImpl = context.getBeanManagerImpl();
     }
 
@@ -359,7 +360,7 @@ public final class AnnotationManager
 
     private void checkQualifierConditions(Annotation ann)
     {
-        Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(ann.annotationType());
+        Method[] methods = webBeansContext.getSecurityService().doPrivilegedGetDeclaredMethods(ann.annotationType());
 
         for (Method method : methods)
         {
@@ -792,7 +793,7 @@ public final class AnnotationManager
     public void checkInjectionPointForInjectInjectionPoint(Class<?> clazz)
     {
         Asserts.nullCheckForClass(clazz);
-        Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(clazz);
+        Field[] fields = webBeansContext.getSecurityService().doPrivilegedGetDeclaredFields(clazz);
         for(Field field : fields)
         {
             if(field.getAnnotation(Inject.class) != null)
@@ -814,10 +815,10 @@ public final class AnnotationManager
      * @param clazz class info
      * @return true if class is serializable
      */
-    public static boolean checkInjectionPointForInterceptorPassivation(Class<?> clazz)
+    public boolean checkInjectionPointForInterceptorPassivation(Class<?> clazz)
     {
         Asserts.nullCheckForClass(clazz);
-        Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(clazz);
+        Field[] fields = webBeansContext.getSecurityService().doPrivilegedGetDeclaredFields(clazz);
         for(Field field : fields)
         {
             if(field.getAnnotation(Inject.class) != null)

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -35,7 +35,6 @@ 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;
@@ -625,7 +624,7 @@ public abstract class AbstractInjectionT
                     }               
                     else
                     {
-                        if(!AnnotationManager.checkInjectionPointForInterceptorPassivation(interceptorClass))
+                        if(!getWebBeansContext().getAnnotationManager().checkInjectionPointForInterceptorPassivation(interceptorClass))
                         {
                             throw new WebBeansConfigurationException(MessageFormat.format(
                                     getLogger().getTokenString(OWBLogConst.EXCEPT_0017),
toString(), interceptorClass));

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -369,7 +369,7 @@ public class BeansDeployer
                     //If intercepted marker
                     if(bean instanceof InterceptedMarker)
                     {
-                        DefinitionUtil.defineBeanInterceptorStack((AbstractInjectionTargetBean<Object>)bean);
  
+                        webBeansContext.getDefinitionUtil().defineBeanInterceptorStack((AbstractInjectionTargetBean<Object>)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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -86,9 +86,11 @@ import static org.apache.webbeans.util.I
 @SuppressWarnings("unchecked")
 public final class DefinitionUtil
 {
-    private DefinitionUtil()
-    {
+    private final WebBeansContext webBeansContext;
 
+    public DefinitionUtil(WebBeansContext webBeansContext)
+    {
+        this.webBeansContext = webBeansContext;
     }
     
     /**
@@ -1151,7 +1153,7 @@ public final class DefinitionUtil
      * Configure bean instance interceptor stack.
      * @param bean bean instance
      */
-    public static void defineBeanInterceptorStack(AbstractInjectionTargetBean<?> bean)
+    public void defineBeanInterceptorStack(AbstractInjectionTargetBean<?> bean)
     {
         Asserts.assertNotNull(bean, "bean parameter can no be null");
         if (!bean.getInterceptorStack().isEmpty())
@@ -1174,7 +1176,8 @@ public final class DefinitionUtil
             {
                 if(data.isDefinedInInterceptorClass())
                 {
-                    if(!AnnotationManager.checkInjectionPointForInterceptorPassivation(data.getInterceptorClass()))
+                    AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+                    if(!annotationManager.checkInjectionPointForInterceptorPassivation(data.getInterceptorClass()))
                     {
                         throw new WebBeansConfigurationException("Enterprise bean : " + bean.toString()
+
                                                                  " interceptors must have
serializable injection points");

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -86,6 +86,7 @@ public class WebBeansContext
     private ResolutionUtil resolutionUtil = new ResolutionUtil(this);
     private InjectionPointFactory injectionPointFactory = new InjectionPointFactory(this);
     private InterceptorUtil interceptorUtil = new InterceptorUtil(this);
+    private DefinitionUtil definitionUtil = new DefinitionUtil(this);
     private ManagedBeanConfigurator managedBeanConfigurator = new ManagedBeanConfigurator(this);
     private SecurityService securityService = getService(SecurityService.class);
 
@@ -187,6 +188,11 @@ public class WebBeansContext
         return interceptorUtil;
     }
 
+    public DefinitionUtil getDefinitionUtil()
+    {
+        return definitionUtil;
+    }
+
     public InjectionPointFactory getInjectionPointFactory()
     {
         return injectionPointFactory;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java?rev=1084002&r1=1084001&r2=1084002&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
Mon Mar 21 22:39:52 2011
@@ -35,7 +35,6 @@ import org.apache.webbeans.config.OWBLog
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 import javassist.util.proxy.MethodHandler;
@@ -93,7 +92,7 @@ public class DelegateHandler implements 
                 {
                     if (!decMethod.isAccessible())
                     {
-                        SecurityUtil.doPrivilegedSetAccessible(decMethod, true);
+                        bean.getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(decMethod,
true);
                     }
 
                     Object returnValue = decMethod.invoke(decorator, arguments);
@@ -134,7 +133,7 @@ public class DelegateHandler implements 
 
         if (!method.isAccessible())
         {
-            SecurityUtil.doPrivilegedSetAccessible(method, true);
+            bean.getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(method,
true);
         }
 
         Object result = null;
@@ -172,8 +171,8 @@ public class DelegateHandler implements 
     /**
      * Helper method to locate method in any of the interfaces of the Decorator.
      * 
-     * @param Class whose interfaces we want to check
-     * @param Method to check for in Interfaces
+     * @param class1 whose interfaces we want to check
+     * @param m to check for in Interfaces
      * @return True if the method exists in any of the interfaces of the
      *         Decorator
      */

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -30,7 +30,6 @@ import org.apache.webbeans.inject.Inject
 import org.apache.webbeans.inject.InjectableMethods;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.SecurityUtil;
 
 import javax.decorator.Delegate;
 import javax.enterprise.context.spi.Context;
@@ -312,7 +311,7 @@ public class WebBeansDecorator<T> extend
     {
         if (!delegateField.isAccessible())
         {
-            SecurityUtil.doPrivilegedSetAccessible(delegateField, true);
+            getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(delegateField,
true);
         }
 
         try

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=1084002&r1=1084001&r2=1084002&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
Mon Mar 21 22:39:52 2011
@@ -56,7 +56,6 @@ import org.apache.webbeans.logger.WebBea
 import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
@@ -209,7 +208,7 @@ public class ObserverMethodImpl<T> imple
             boolean isPrivateMethod = !this.observerMethod.isAccessible();
             if (isPrivateMethod)
             {
-                SecurityUtil.doPrivilegedSetAccessible(observerMethod, true);
+                bean.getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(observerMethod,
true);
             }
 
             obargs = new ObserverParams[methodArgsMap.size()];

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -1241,7 +1241,7 @@ public final class WebBeansUtil
 
         if (!ct.isAccessible())
         {
-            SecurityUtil.doPrivilegedSetAccessible(ct, true);
+            webBeansContext.getSecurityService().doPrivilegedSetAccessible(ct, true);
         }
 
         try
@@ -2931,7 +2931,7 @@ public final class WebBeansUtil
         managedBeanCreator.defineInjectedMethods();
         managedBeanCreator.defineObserverMethods();
         DefinitionUtil.defineDecoratorStack(managedBean);
-        DefinitionUtil.defineBeanInterceptorStack(managedBean);
+        webBeansContext.getDefinitionUtil().defineBeanInterceptorStack(managedBean);
 
         managedBeanCreator.defineDisposalMethods();//Define disposal method after adding
producers
 
@@ -3090,8 +3090,8 @@ public final class WebBeansUtil
         managedBeanCreator.defineInjectedFields();
         managedBeanCreator.defineInjectedMethods();
         managedBeanCreator.defineObserverMethods();
-        DefinitionUtil.defineDecoratorStack(managedBean);
-        DefinitionUtil.defineBeanInterceptorStack(managedBean);
+        webBeansContext.getDefinitionUtil().defineDecoratorStack(managedBean);
+        webBeansContext.getDefinitionUtil().defineBeanInterceptorStack(managedBean);
 
         managedBeanCreator.defineDisposalMethods(); //Define disposal method after adding
producers
 
@@ -3106,8 +3106,8 @@ public final class WebBeansUtil
         managedBeanCreator.defineInjectedFields();
         managedBeanCreator.defineInjectedMethods();
         managedBeanCreator.defineObserverMethods();
-        DefinitionUtil.defineDecoratorStack(managedBean);
-        DefinitionUtil.defineBeanInterceptorStack(managedBean);
+        webBeansContext.getDefinitionUtil().defineDecoratorStack(managedBean);
+        webBeansContext.getDefinitionUtil().defineBeanInterceptorStack(managedBean);
 
         managedBeanCreator.defineDisposalMethods(); //Define disposal method after adding
producers
     }

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=1084002&r1=1084001&r2=1084002&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
Mon Mar 21 22:39:52 2011
@@ -38,7 +38,6 @@ import org.apache.webbeans.component.Abs
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.component.WebBeansType;
-import org.apache.webbeans.config.DefinitionUtil;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.DependentContext;
 import org.apache.webbeans.decorator.DecoratorUtil;
@@ -307,7 +306,7 @@ public abstract class TestContext implem
             manager.addBean(WebBeansUtil.createNewBean(bean));
             DecoratorUtil.checkManagedBeanDecoratorConditions(bean,null);
             WebBeansDecoratorConfig.configureDecarotors(bean);
-            DefinitionUtil.defineBeanInterceptorStack(bean);
+            webBeansContext.getDefinitionUtil().defineBeanInterceptorStack(bean);
 
             getComponents().add((AbstractOwbBean<?>) bean);
             manager.addBean(bean);

Modified: openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java?rev=1084002&r1=1084001&r2=1084002&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
(original)
+++ openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
Mon Mar 21 22:39:52 2011
@@ -40,7 +40,6 @@ import org.apache.webbeans.jms.JMSModel;
 import org.apache.webbeans.jms.JMSModel.JMSType;
 import org.apache.webbeans.jms.component.JmsBean;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.SecurityUtil;
 
 import javassist.util.proxy.MethodHandler;
 
@@ -257,7 +256,7 @@ public class JmsProxyHandler implements 
                 
                 if(!method.isAccessible())
                 {
-                    SecurityUtil.doPrivilegedSetAccessible(method, true);
+                    jmsComponent.getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(method,
true);
                 }
                 
                 method.invoke(this.jmsObject, new Object[]{});                

Modified: openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/resource/OpenEjbResourceInjectionService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/resource/OpenEjbResourceInjectionService.java?rev=1084002&r1=1084001&r2=1084002&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/resource/OpenEjbResourceInjectionService.java
(original)
+++ openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/resource/OpenEjbResourceInjectionService.java
Mon Mar 21 22:39:52 2011
@@ -40,7 +40,6 @@ import org.apache.webbeans.spi.FailOverS
 import org.apache.webbeans.spi.ResourceInjectionService;
 import org.apache.webbeans.spi.api.ResourceReference;
 import org.apache.webbeans.util.AnnotationUtil;
-import org.apache.webbeans.util.SecurityUtil;
 
 public class OpenEjbResourceInjectionService implements ResourceInjectionService
 {
@@ -84,7 +83,7 @@ public class OpenEjbResourceInjectionSer
     @Override
     public void injectJavaEEResources(Object managedBeanInstance)
     {
-        Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(managedBeanInstance.getClass());
+        Field[] fields = webBeansContext.getSecurityService().doPrivilegedGetDeclaredFields(managedBeanInstance.getClass());
         for(Field field : fields)
         {
             if(!field.isAnnotationPresent(Produces.class))
@@ -99,7 +98,7 @@ public class OpenEjbResourceInjectionSer
                         boolean acess = field.isAccessible();
                         try
                         {
-                            SecurityUtil.doPrivilegedSetAccessible(field, true);
+                            webBeansContext.getSecurityService().doPrivilegedSetAccessible(field,
true);
                             field.set(managedBeanInstance, getResourceReference(resourceRef));
                             
                         }
@@ -111,7 +110,7 @@ public class OpenEjbResourceInjectionSer
                         }
                         finally
                         {
-                            SecurityUtil.doPrivilegedSetAccessible(field, acess);
+                            webBeansContext.getSecurityService().doPrivilegedSetAccessible(field,
acess);
                         }                                            
                     }
                 }                

Modified: openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java?rev=1084002&r1=1084001&r2=1084002&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
(original)
+++ openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
Mon Mar 21 22:39:52 2011
@@ -45,7 +45,6 @@ import org.apache.webbeans.spi.FailOverS
 import org.apache.webbeans.spi.ResourceInjectionService;
 import org.apache.webbeans.spi.api.ResourceReference;
 import org.apache.webbeans.util.AnnotationUtil;
-import org.apache.webbeans.util.SecurityUtil;
 
 public class StandaloneResourceInjectionService implements ResourceInjectionService
 {
@@ -121,7 +120,7 @@ public class StandaloneResourceInjection
 
         while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
         {
-            Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(currentClass);
+            Field[] fields = webBeansContext.getSecurityService().doPrivilegedGetDeclaredFields(currentClass);
 
             for(Field field : fields)
             {
@@ -137,7 +136,7 @@ public class StandaloneResourceInjection
                             boolean acess = field.isAccessible();
                             try
                             {
-                                SecurityUtil.doPrivilegedSetAccessible(field, true);
+                                webBeansContext.getSecurityService().doPrivilegedSetAccessible(field,
true);
                                 field.set(managedBeanInstance, getResourceReference(resourceRef));
 
                                 containsEeResource = Boolean.TRUE;
@@ -150,7 +149,7 @@ public class StandaloneResourceInjection
                             }
                             finally
                             {
-                                SecurityUtil.doPrivilegedSetAccessible(field, acess);
+                                webBeansContext.getSecurityService().doPrivilegedSetAccessible(field,
acess);
                             }
                         }
                     }



Mime
View raw message