felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r1640956 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
Date Fri, 21 Nov 2014 16:50:59 GMT
Author: bob
Date: Fri Nov 21 16:50:58 2014
New Revision: 1640956

URL: http://svn.apache.org/r1640956
Log:
FELIX-4582 Add secure action for woven class listeners.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java?rev=1640956&r1=1640955&r2=1640956&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
Fri Nov 21 16:50:58 2014
@@ -1448,6 +1448,30 @@ public class SecureAction
             rh.end();
         }
     }
+    
+    public void invokeWovenClassListener(
+            org.osgi.framework.hooks.weaving.WovenClassListener wcl,
+            org.osgi.framework.hooks.weaving.WovenClass wc)
+            throws Exception
+    {
+        if (System.getSecurityManager() != null)
+        {
+            Actions actions = (Actions) m_actions.get();
+            actions.set(Actions.INVOKE_WOVEN_CLASS_LISTENER, wcl, wc);
+            try
+            {
+                AccessController.doPrivileged(actions, m_acc);
+            }
+            catch (PrivilegedActionException e)
+            {
+                throw e.getException();
+            }
+        }
+        else
+        {
+            wcl.modified(wc);
+        }
+    }
 
     private static class Actions implements PrivilegedExceptionAction
     {
@@ -1507,6 +1531,7 @@ public class SecureAction
         public static final int INVOKE_BUNDLE_COLLISION_HOOK = 53;
         public static final int OPEN_JARFILE_ACTION = 54;
         public static final int DELETE_FILEONEXIT_ACTION = 55;
+        public static final int INVOKE_WOVEN_CLASS_LISTENER = 56;
 
         private int m_action = -1;
         private Object m_arg1 = null;



Mime
View raw message