geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1083676 - /geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
Date Mon, 21 Mar 2011 05:24:43 GMT
Author: genspring
Date: Mon Mar 21 05:24:43 2011
New Revision: 1083676

URL: http://svn.apache.org/viewvc?rev=1083676&view=rev
Log:
fix compile error due to changes in API org.apache.webbeans.spi.SecurityService

Modified:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java?rev=1083676&r1=1083675&r2=1083676&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoWebBeansPlugin.java
Mon Mar 21 05:24:43 2011
@@ -18,7 +18,13 @@
  */
 package org.apache.geronimo.openwebbeans;
 
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.security.Principal;
+import java.security.PrivilegedActionException;
+import java.util.Properties;
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.event.TransactionPhase;
@@ -148,5 +154,81 @@ public class GeronimoWebBeansPlugin
         // TODO Auto-generated method stub
         return null;
     }
+    
+    
+
+    @Override
+    public <T> Constructor<T> doPrivilegedGetDeclaredConstructor(Class<T>
clazz, Class<?>... parameterTypes) {
+        try {
+            return clazz.getDeclaredConstructor(parameterTypes);
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    @Override
+    public <T> Constructor<?>[] doPrivilegedGetDeclaredConstructors(Class<T>
clazz) {
+        return clazz.getDeclaredConstructors();
+    }
+
+    @Override
+    public <T> Method doPrivilegedGetDeclaredMethod(Class<T> clazz, String name,
Class<?>... parameterTypes) {
+        try {
+            return clazz.getDeclaredMethod(name, parameterTypes);
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    @Override
+    public <T> Method[] doPrivilegedGetDeclaredMethods(Class<T> clazz) {
+        return clazz.getDeclaredMethods();
+    }
+
+    @Override
+    public <T> Field doPrivilegedGetDeclaredField(Class<T> clazz, String name)
{
+        try {
+            return clazz.getDeclaredField(name);
+        } catch (NoSuchFieldException e) {
+            return null;
+        }
+    }
+
+    @Override
+    public <T> Field[] doPrivilegedGetDeclaredFields(Class<T> clazz) {
+        return clazz.getDeclaredFields();
+    }
+
+    @Override
+    public void doPrivilegedSetAccessible(AccessibleObject obj, boolean flag) {
+        obj.setAccessible(flag);
+    }
+
+    @Override
+    public boolean doPrivilegedIsAccessible(AccessibleObject obj) {
+        return obj.isAccessible();
+    }
+
+    @Override
+    public <T> T doPrivilegedObjectCreate(Class<T> clazz) throws PrivilegedActionException,
IllegalAccessException,
+            InstantiationException {
+        return clazz.newInstance();
+    }
+
+    @Override
+    public void doPrivilegedSetSystemProperty(String propertyName, String value) {
+        System.setProperty(propertyName, value);
+    }
+
+    @Override
+    public String doPrivilegedGetSystemProperty(String propertyName, String defaultValue)
{
+        return System.getProperty(propertyName, defaultValue);
+    }
+
+    @Override
+    public Properties doPrivilegedGetSystemProperties() {
+        return System.getProperties();
+    }
+    
 
 }



Mime
View raw message