INSTALLED bundle event must now include which bundle performed the install.
(FELIX-2950)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1136615 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
index 63ab79d..8e334ec 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
@@ -152,7 +152,7 @@
 
         if (sm != null)
         {
-            result = m_felix.installBundle(location, is);
+            result = m_felix.installBundle(m_bundle, location, is);
             // Do check the bundle again in case that is was installed
             // already.
             ((SecurityManager) sm).checkPermission(
@@ -160,7 +160,7 @@
         }
         else
         {
-            result = m_felix.installBundle(location, is);
+            result = m_felix.installBundle(m_bundle, location, is);
         }
 
         return result;
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 7dfb4ae..8d5407e 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -734,7 +734,8 @@
                         {
                             // Install the cached bundle.
                             installBundle(
-                                archives[i].getId(), archives[i].getLocation(), archives[i], null);
+                                this, archives[i].getId(), archives[i].getLocation(),
+                                archives[i], null);
                         }
                     }
                     catch (Exception ex)
@@ -2615,13 +2616,15 @@
         return (val == null) ? System.getProperty(key) : val;
     }
 
-    Bundle installBundle(String location, InputStream is)
+    Bundle installBundle(
+        Bundle origin, String location, InputStream is)
         throws BundleException
     {
-        return installBundle(-1, location, null, is);
+        return installBundle(origin, -1, location, null, is);
     }
 
-    private Bundle installBundle(long id, String location, BundleArchive ba, InputStream is)
+    private Bundle installBundle(
+        Bundle origin, long id, String location, BundleArchive ba, InputStream is)
         throws BundleException
     {
         BundleImpl bundle = null;
@@ -2825,7 +2828,7 @@
         }
 
         // Fire bundle event.
-        fireBundleEvent(BundleEvent.INSTALLED, bundle);
+        fireBundleEvent(BundleEvent.INSTALLED, bundle, origin);
 
         // Return new bundle.
         return bundle;
@@ -4157,6 +4160,11 @@
         m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle));
     }
 
+    void fireBundleEvent(int type, Bundle bundle, Bundle origin)
+    {
+        m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle, origin));
+    }
+
     /**
      * Fires service events.
      *