Added a private getContext() method so that it is possible to run
Equinox' Declarative Services impl on Felix.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@418060 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
index dcb81d4..0bf5448 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
@@ -50,6 +50,22 @@
         m_info = info;
     }
 
+    /**
+     * This method is a hack to make Felix compatible with Equinox'
+     * Declarative Services implementation; this should be revisited
+     * in the future.
+     * @return the bundle context associated with this bundle.
+    **/
+    private BundleContext getContext()
+    {
+        BundleContext bc = m_info.getContext();
+        if (bc == null)
+        {
+            m_info.setContext(new BundleContextImpl(m_felix, this));
+        }
+        return m_info.getContext();
+    }
+
     public long getBundleId()
     {
         return m_info.getBundleId();