Fix FELIX-3995

Add the proxy attribute in the @Bind and @Unbind annotations

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1466444 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java b/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java
index 29461ce..07595f2 100644
--- a/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java
+++ b/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java
@@ -73,6 +73,11 @@
     protected String m_from;
 
     /**
+     * proxy attribute.
+     */
+    protected String m_proxy;
+
+    /**
      * Visit annotation's attributes.
      *
      * @param name : annotation name
@@ -112,6 +117,9 @@
         if (name.equals("from")) {
             m_from = value.toString();
         }
+        if (name.equals("proxy")) {
+            m_proxy = value.toString();
+        }
 
     }
 
@@ -156,6 +164,9 @@
         if (!completeAttribute(requires, "from", m_from))
             return false;
 
+        if(!completeAttribute(requires, "proxy", m_proxy))
+            return false;
+
         return true;
     }
 
@@ -203,6 +214,9 @@
         if (m_from != null) {
             requires.addAttribute(new Attribute("from", m_from));
         }
+        if (m_proxy != null) {
+            requires.addAttribute(new Attribute("proxy", m_proxy));
+        }
         return requires;
     }
 
diff --git a/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java b/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java
index d84c831..05a7a61 100644
--- a/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java
+++ b/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java
@@ -77,4 +77,11 @@
      */

     String from() default "";

 

+    /**

+     * Set to true if the service dependency is injected

+     * as a proxy.

+     * Default: true

+     */

+    boolean proxy() default true;

+

 }

diff --git a/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java b/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java
index b44ca3b..f34129f 100644
--- a/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java
+++ b/ipojo/runtime/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java
@@ -77,5 +77,12 @@
      * Set the from attribute.

      */

     String from() default "";

+

+    /**

+     * Set to true if the service dependency is injected

+     * as a proxy.

+     * Default: true

+     */

+    boolean proxy() default true;

     

 }