Invoke bundle hooks in privileged block; missed one. (FELIX-3032)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1153161 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java b/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
index 5dc703c..05e01cb 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
@@ -76,6 +76,8 @@
     // Pooled requests to avoid memory allocation.
     private static final List<Request> m_requestPool = new ArrayList<Request>();
 
+    private static final SecureAction m_secureAction = new SecureAction();
+
     public EventDispatcher(Logger logger, ServiceRegistry registry)
     {
         m_logger = logger;
@@ -668,8 +670,9 @@
                             }
                             else if (eh instanceof org.osgi.framework.hooks.bundle.EventHook)
                             {
-                                ((org.osgi.framework.hooks.bundle.EventHook)
-                                    eh).event((BundleEvent) event, shrinkable);
+                                m_secureAction.invokeBundleEventHook(
+                                    (org.osgi.framework.hooks.bundle.EventHook) eh,
+                                    (BundleEvent) event, shrinkable);
                             }
                         }
                         catch (Throwable th)