FELIX-2127: improve explanations by adding a way to link the requirement to the requesting resource

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@916502 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
index df44aea..6c42ec8 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
@@ -22,9 +22,11 @@
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.obr.Capability;
 import org.osgi.service.obr.Requirement;
+import org.osgi.service.obr.Resource;
 
 public class RequirementImpl implements Requirement
 {
+    private Resource m_resource;
     private String m_name = null;
     private boolean m_extend = false;
     private boolean m_multiple = false;
@@ -36,6 +38,16 @@
     {
     }
 
+    public Resource getResource()
+    {
+        return m_resource;
+    }
+
+    public void setResource(Resource resource)
+    {
+        m_resource = resource;
+    }
+
     public synchronized String getName()
     {
         return m_name;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java
index 4b06b74..fd454f8 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java
@@ -135,6 +135,7 @@
 
     protected void addRequire(Requirement req)
     {
+        ((RequirementImpl) req).setResource(this);
         m_reqList.add(req);
     }