openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r1346624 - in /openjpa: branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
Date Tue, 05 Jun 2012 22:06:19 GMT
Author: allee8285
Date: Tue Jun  5 22:06:18 2012
New Revision: 1346624

URL: http://svn.apache.org/viewvc?rev=1346624&view=rev
Log:
OPENJPA-2208 Add getProtectionDomain doPriv function

Modified:
    openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java

Modified: openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java?rev=1346624&r1=1346623&r2=1346624&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
(original)
+++ openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
Tue Jun  5 22:06:18 2012
@@ -41,6 +41,7 @@ import java.net.UnknownHostException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import java.util.Enumeration;
 import java.util.Properties;
 import java.util.Set;
@@ -72,6 +73,7 @@ import serp.bytecode.Project;
  * <li>Class.getDeclaredFields
  * <li>Class.getDeclaredMethod
  * <li>Class.getDeclaredMethods
+ * <li>Class.getProtectionDomain
  * <li>Class.getResource
  * <li>Class.newInstance
  * <li>ClassLoader.getParent
@@ -382,6 +384,23 @@ public abstract class J2DoPrivHelper {
     }
     
     /**
+     * Return a PrivilegeAction object for class.getProtectionDomain().
+     *
+     * Requires security policy:
+     *   'permission java.lang.RuntimePermission "getProtectionDomain";'
+     *
+     * @return ProtectionDomain
+     */
+    public static final PrivilegedAction<ProtectionDomain> getProtectionDomainAction(
+        final Class<?> clazz) {
+        return new PrivilegedAction<ProtectionDomain>() {
+            public ProtectionDomain run() {
+                return clazz.getProtectionDomain();
+            }
+        };
+    }
+
+    /**
      * Return a PrivilegeAction object for loader.getParent().
      * 
      * Requires security policy:

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java?rev=1346624&r1=1346623&r2=1346624&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
Tue Jun  5 22:06:18 2012
@@ -41,6 +41,7 @@ import java.net.UnknownHostException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import java.util.Enumeration;
 import java.util.Properties;
 import java.util.Set;
@@ -72,6 +73,7 @@ import serp.bytecode.Project;
  * <li>Class.getDeclaredFields
  * <li>Class.getDeclaredMethod
  * <li>Class.getDeclaredMethods
+ * <li>Class.getProtectionDomain
  * <li>Class.getResource
  * <li>Class.newInstance
  * <li>ClassLoader.getParent
@@ -382,6 +384,23 @@ public abstract class J2DoPrivHelper {
     }
     
     /**
+     * Return a PrivilegeAction object for class.getProtectionDomain().
+     *
+     * Requires security policy:
+     *   'permission java.lang.RuntimePermission "getProtectionDomain";'
+     *
+     * @return ProtectionDomain
+     */
+    public static final PrivilegedAction<ProtectionDomain> getProtectionDomainAction(
+        final Class<?> clazz) {
+        return new PrivilegedAction<ProtectionDomain>() {
+            public ProtectionDomain run() {
+                return clazz.getProtectionDomain();
+            }
+        };
+    }
+
+    /**
      * Return a PrivilegeAction object for loader.getParent().
      * 
      * Requires security policy:



Mime
View raw message