felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1448522 [2/20] - in /felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/...
Date Thu, 21 Feb 2013 06:35:20 GMT
Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/SetCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/SetCheckService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/SetCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/SetCheckService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,164 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+public class SetCheckService implements CheckService {
+
+    Set fs;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.size() != 0;
+        Iterator it = fs.iterator();
+        while(it.hasNext()) {
+            r = r & ((FooService) it.next()).foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        Iterator it = fs.iterator();
+        while(it.hasNext()) {
+            r = r + ((FooService) it.next()).getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        Iterator it = fs.iterator();
+        while(it.hasNext()) {
+            r = r + ((FooService) it.next()).getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        Iterator it = fs.iterator();
+        while(it.hasNext()) {
+            r = r + ((FooService) it.next()).getLong();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+        simpleB++;
+    }
+
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectU++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/VectorCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/VectorCheckService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/VectorCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/VectorCheckService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,159 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+import java.util.Vector;
+
+public class VectorCheckService implements CheckService {
+
+    Vector fs;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.size() != 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r & ((FooService) fs.get(i)).foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getDouble();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+       // simpleB++;
+    }
+
+    public void voidUnbind() {
+       // simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+     //       objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+    //        objectU++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/CheckServiceProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/CheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/CheckServiceProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,64 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.comparator;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class CheckServiceProvider implements CheckService {
+
+    FooService fs;
+
+    FooService fs2;
+
+    FooService[] fss;
+
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("fs", new Integer(fs.getInt()));
+        props.put("fs2", new Integer(fs2.getInt()));
+
+        int[] grades = new int[fss.length];
+
+        for (int i = 0; i < grades.length; i++) {
+            grades[i] = fss[i].getInt();
+        }
+
+        props.put("fss", grades);
+
+        return props;
+    }
+
+    void bind(FooService svc) {
+        fs2 = svc;
+    }
+
+    void unbind(FooService svc) {
+        fs2 = null;
+    }
+
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradeComparator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradeComparator.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradeComparator.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradeComparator.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,31 @@
+package org.apache.felix.ipojo.runtime.core.test.components.comparator;
+
+import org.osgi.framework.ServiceReference;
+
+import java.util.Comparator;
+
+public class GradeComparator implements Comparator {
+
+    public int compare(Object arg0, Object arg1) {
+        ServiceReference ref0 = null;
+        ServiceReference ref1 = null;
+        Integer grade0 = null;
+        Integer grade1 = null;
+        if (arg0 instanceof ServiceReference) {
+            ref0 = (ServiceReference)  arg0;
+            grade0 = (Integer) ref0.getProperty("grade");
+        }
+        if (arg1 instanceof ServiceReference) {
+            ref1 = (ServiceReference) arg1;
+            grade1 = (Integer) ref1.getProperty("grade");
+        }
+        
+        if (ref0 != null && ref1 != null
+                && grade0 != null && grade1 != null) {
+            return grade1.compareTo(grade0); // Best grade first.
+        } else {
+            return 0; // Equals
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradedFooServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradedFooServiceProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradedFooServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/comparator/GradedFooServiceProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,40 @@
+package org.apache.felix.ipojo.runtime.core.test.components.comparator;
+
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class GradedFooServiceProvider implements FooService {
+    
+    
+    private int grade;
+
+    public boolean foo() {
+        return grade > 0;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return grade;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,90 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.filter;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class FilterCheckProvider implements CheckService, FooService {
+
+    private String m_toto;
+
+    private int bind;
+
+    private int unbind;
+
+    public FilterCheckProvider() {
+        m_toto = "A";
+    }
+
+    public boolean check() {
+        if (m_toto.equals("A")) {
+            m_toto = "B";
+            return true;
+        } else {
+            m_toto = "A";
+            return false;
+        }
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(bind - unbind));
+        return null;
+    }
+
+    private void Bind() {
+        bind++;
+    }
+
+    private void Unbind() {
+        unbind++;
+    }
+
+    public boolean foo() {
+        return true;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckSubscriber.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckSubscriber.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckSubscriber.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/FilterCheckSubscriber.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,56 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.filter;
+
+import org.apache.felix.ipojo.Nullable;
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class FilterCheckSubscriber implements CheckService {
+
+    private FooService m_foo;
+
+    private int bound;
+
+    public FilterCheckSubscriber() {
+    }
+
+    public boolean check() {
+        m_foo.foo();
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(bound));
+        props.put("Nullable", new Boolean(m_foo instanceof Nullable));
+        return props;
+    }
+
+    private void Bind() {
+        bound++;
+    }
+
+    private void Unbind() {
+        bound--;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/MultipleFilterCheckSubscriber.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/MultipleFilterCheckSubscriber.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/MultipleFilterCheckSubscriber.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/filter/MultipleFilterCheckSubscriber.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,57 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.filter;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class MultipleFilterCheckSubscriber implements CheckService {
+
+    private FooService[] m_foo;
+
+    private int bound;
+
+    public MultipleFilterCheckSubscriber() {
+    }
+
+    public boolean check() {
+        for (int i = 0; i < m_foo.length; i++) {
+            m_foo[i].foo();
+        }
+        return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("Bind", new Integer(bound));
+        props.put("Size", new Integer(m_foo.length));
+        return props;
+    }
+
+    private void Bind() {
+        bound++;
+    }
+
+    private void Unbind() {
+        bound--;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C1.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C1.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.runtime.core.test.components.inner;
+
+import org.apache.felix.ipojo.runtime.core.test.services.Call;
+
+public class C1 implements Call {
+
+	public String callMe() {
+		return "called";
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C2.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C2.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C2.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,13 @@
+package org.apache.felix.ipojo.runtime.core.test.components.inner;
+
+import org.apache.felix.ipojo.runtime.core.test.services.Call;
+
+public class C2 {
+
+	private Call c1;
+
+	public String authenticate() {
+		return c1.callMe();
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C3.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C3.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C3.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/C3.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,19 @@
+package org.apache.felix.ipojo.runtime.core.test.components.inner;
+
+public class C3 {
+
+	private C2 c2;
+
+	public MyFilter getFilter()	{
+		return new MyFilter() {
+			public String authenticate() {
+				System.out.println("My Filter ...");
+				String r = c2.authenticate();
+				System.out.println(" ... " + r);
+				return r;
+			}
+		};
+
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/MyFilter.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/MyFilter.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/MyFilter.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/inner/MyFilter.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.runtime.core.test.components.inner;
+
+public interface MyFilter {
+
+	public String authenticate();
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/optional/MyComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/optional/MyComponent.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/optional/MyComponent.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/optional/MyComponent.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.runtime.core.test.components.optional;
+
+import org.apache.felix.ipojo.Nullable;
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Requires;
+import org.osgi.service.log.LogService;
+
+
+@Component(immediate=true, name="optional-log-cons")
+public class MyComponent {
+
+    @Requires(optional=true, proxy=false)
+    private LogService log;
+    
+    
+    public MyComponent() {
+        System.out.println("Created ! : " + (log instanceof Nullable) + " - " + log);
+        log.log(LogService.LOG_INFO, "Created !");
+        
+    }
+    
+    
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckProviderParentClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckProviderParentClass.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckProviderParentClass.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckProviderParentClass.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,51 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+public abstract class CheckProviderParentClass {
+    
+    int simpleU = 0;
+    int objectU = 0;
+    int refU = 0;
+    int bothU = 0;
+    
+    
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if(sr != null && o != null && o instanceof FooService) { bothU++; }
+    }
+    
+    public void refUnbind(ServiceReference sr) {
+        if(sr != null) { refU++; }
+    }
+    
+    public void objectUnbind(FooService o) {
+        if(o != null && o instanceof FooService) { objectU++; }
+        else {
+            System.err.println("Unbind null : " + o);
+        }
+    }
+    
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckServiceProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/CheckServiceProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,91 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
+
+    FooService fs;
+
+    int simpleB = 0;
+    int objectB = 0;
+    int refB = 0;
+    int bothB = 0;
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        if (fs != null) {
+            props.put("result", new Boolean(fs.foo()));
+            props.put("boolean", new Boolean(fs.getBoolean()));
+            props.put("int", new Integer(fs.getInt()));
+            props.put("long", new Long(fs.getLong()));
+            props.put("double", new Double(fs.getDouble()));
+            if (fs.getObject() != null) {
+                props.put("object", fs.getObject());
+            }
+        }
+        props.put("static", CheckService.foo);
+        props.put("class", CheckService.class.getName());
+        return props;
+    }
+
+    private void voidBind() {
+        simpleB++;
+    }
+
+    protected void objectBind(FooService o) {
+        if (o == null) {
+            System.err.println("Bind receive null !!! ");
+            return;
+        }
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (sr != null && o != null && o instanceof FooService) {
+            bothB++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/DynCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/DynCheckServiceProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/DynCheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/DynCheckServiceProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,87 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class DynCheckServiceProvider extends CheckProviderParentClass implements CheckService {
+
+    FooService fs;
+
+    int simpleB = 0;
+    int objectB = 0;
+    int refB = 0;
+    int bothB = 0;
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        if (fs != null) {
+            props.put("int", new Integer(fs.getInt()));
+            if (fs.getObject() != null) {
+                props.put("object", fs.getObject());
+            }
+        }
+        props.put("static", CheckService.foo);
+        props.put("class", CheckService.class.getName());
+        return props;
+    }
+
+    private void voidBind() {
+        simpleB++;
+    }
+
+    protected void objectBind(FooService o) {
+        if (o == null) {
+            System.err.println("Bind receive null !!! ");
+            return;
+        }
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (sr != null && o != null && o instanceof FooService) {
+            bothB++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodCheckServiceProvider.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodCheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodCheckServiceProvider.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,123 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class MethodCheckServiceProvider implements CheckService {
+
+    FooService fs;
+
+    BundleContext context;
+
+    int simpleB = 0;
+    int objectB = 0;
+    int refB = 0;
+    int bothB = 0;
+    int simpleU = 0;
+    int objectU = 0;
+    int refU = 0;
+    int bothU = 0;
+
+
+    public MethodCheckServiceProvider(BundleContext bc) {
+        context = bc;
+    }
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        if (fs != null) {
+            props.put("result", new Boolean(fs.foo()));
+            props.put("boolean", new Boolean(fs.getBoolean()));
+            props.put("int", new Integer(fs.getInt()));
+            props.put("long", new Long(fs.getLong()));
+            props.put("double", new Double(fs.getDouble()));
+        } else {
+            props.put("result", new Boolean(false));
+        }
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+
+        if (fs != null) {
+            if (fs.getObject() != null) {
+                props.put("object", fs.getObject());
+            }
+        }
+
+        return props;
+    }
+
+    protected void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+        fs = o;
+    }
+
+    protected void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectU++;
+        }
+        fs = null;
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+        fs = (FooService) context.getService(sr);
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+        context.ungetService(sr);
+        fs = null;
+    }
+
+    protected void bothBind(FooService o, ServiceReference ref) {
+        if (ref != null && o != null && o instanceof FooService) {
+            bothB++;
+        }
+        fs = o;
+    }
+
+    protected void bothUnbind(FooService o, ServiceReference ref) {
+        if (ref != null && o != null && o instanceof FooService) {
+            bothU++;
+        }
+        fs = null;
+    }
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodMultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodMultipleCheckService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodMultipleCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MethodMultipleCheckService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,165 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class MethodMultipleCheckService implements CheckService {
+
+    List fs = new ArrayList();
+    BundleContext context;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public MethodMultipleCheckService(BundleContext bc) {
+        context = bc;
+    }
+
+    public boolean check() {
+        boolean r = fs.size() != 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r & ((FooService) fs.get(i)).foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getInt();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+//	private Object getObject() {
+//		boolean r = true;
+//		for(int i = 0; i < fs.length; i++) {
+//			r = r && ((Boolean) fs[i].getObject()).booleanValue();
+//		}
+//		return new Boolean(r);
+//	}
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+        fs.add(o);
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectU++;
+        }
+        fs.remove(o);
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+        fs.add(context.getService(sr));
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+        fs.remove(context.getService(sr));
+        context.ungetService(sr);
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            fs.add(o);
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            fs.remove(o);
+            bothU++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MultipleCheckService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MultipleCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/MultipleCheckService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,158 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class MultipleCheckService implements CheckService {
+
+    FooService fs[];
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.length != 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r & fs[i].foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.length; i++) {
+            r = r + fs[i].getInt();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+        simpleB++;
+    }
+
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectU++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/RankedFooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/RankedFooProviderType1.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/RankedFooProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/policies/RankedFooProviderType1.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,61 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.components.policies;
+
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+
+import java.util.Properties;
+
+public class RankedFooProviderType1 implements FooService {
+    private int m_grade;
+
+
+    public boolean foo() {
+        m_grade = m_grade + 2;
+        return true;
+    }
+
+    public Properties fooProps() {
+        Properties p = new Properties();
+        p.put("grade", new Integer(m_grade));
+
+        return p;
+    }
+
+    public boolean getBoolean() {
+        return true;
+    }
+
+    public double getDouble() {
+        return 1.0;
+    }
+
+    public int getInt() {
+        return m_grade;
+    }
+
+    public long getLong() {
+        return 1;
+    }
+
+    public Boolean getObject() {
+        return new Boolean(true);
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceDelegator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceDelegator.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceDelegator.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceDelegator.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,31 @@
+package org.apache.felix.ipojo.runtime.core.test.components.proxy;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class CheckServiceDelegator implements CheckService {
+
+    private FooService fs;
+
+    private Helper helper;
+
+    public CheckServiceDelegator(BundleContext bc) {
+        helper = new Helper(bc, fs);
+    }
+
+    public boolean check() {
+        // Don't access the service
+        // Just delegate
+        return helper.check();
+    }
+
+    public Properties getProps() {
+        // Don't access the service
+        // Just delegate
+        return helper.getProps();
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceGetAndDelegate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceGetAndDelegate.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceGetAndDelegate.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceGetAndDelegate.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,29 @@
+package org.apache.felix.ipojo.runtime.core.test.components.proxy;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class CheckServiceGetAndDelegate implements CheckService {
+
+    private FooService fs;
+
+    private Helper helper;
+
+    public CheckServiceGetAndDelegate(BundleContext bc) {
+        helper = new Helper(bc, fs);
+    }
+
+    public boolean check() {
+        fs.foo();
+        return helper.check();
+    }
+
+    public Properties getProps() {
+        fs.getBoolean();
+        return helper.getProps();
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceNoDelegate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceNoDelegate.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceNoDelegate.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceNoDelegate.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,42 @@
+package org.apache.felix.ipojo.runtime.core.test.components.proxy;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class CheckServiceNoDelegate implements CheckService {
+
+    private FooService fs;
+    
+    private Helper helper;
+    
+    private BundleContext context;
+    
+    public CheckServiceNoDelegate(BundleContext bc) {
+       context = bc;
+       helper = new Helper(context, fs);
+    }
+    
+    public void start() {
+        helper.publish();
+    }
+    
+    public void stop() {
+        helper.unpublish();
+    }
+    
+    public boolean check() {
+        // Don't access the service
+        // Just delegate
+        return helper.check();
+    }
+
+    public Properties getProps() {
+        // Don't access the service
+        // Just delegate
+        return helper.getProps();
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceUsingStringService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceUsingStringService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceUsingStringService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/CheckServiceUsingStringService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,28 @@
+package org.apache.felix.ipojo.runtime.core.test.components.proxy;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+
+import java.util.AbstractMap;
+import java.util.Properties;
+
+public class CheckServiceUsingStringService implements CheckService {
+
+    private String string;
+    private AbstractMap map;
+
+
+    public CheckServiceUsingStringService() {
+        System.out.println("Service : " + string);
+        System.out.println("Map : " + map);
+    }
+
+    public boolean check() {
+        return string != null
+                && map != null;
+    }
+
+    public Properties getProps() {
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/Helper.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/Helper.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/Helper.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/proxy/Helper.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,50 @@
+package org.apache.felix.ipojo.runtime.core.test.components.proxy;
+
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.test.services.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Properties;
+
+public class Helper implements CheckService {
+
+
+    private FooService fs;
+    private BundleContext context;
+    private ServiceRegistration reg;
+
+    public Helper(BundleContext bc, FooService svc) {
+        fs = svc;
+        context = bc;
+    }
+
+    public void publish() {
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put(Constants.SERVICE_PID, "Helper");
+        context.registerService(CheckService.class, this, props);
+        reg = context.registerService(CheckService.class.getName(), this, props);
+    }
+
+    public void unpublish() {
+        if (reg != null) {
+            reg.unregister();
+        }
+        reg = null;
+    }
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        fs.getBoolean();
+        props.put("helper.fs", fs);
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/Call.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/Call.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/Call.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/Call.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,8 @@
+package org.apache.felix.ipojo.runtime.core.test.services;
+
+public interface Call {
+
+
+	public String callMe();
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/CheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/CheckService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/CheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/CheckService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,31 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.services;
+
+import java.util.Properties;
+
+public interface CheckService {
+    
+    public static final String foo = "foo";
+	
+	public boolean check();
+	
+	public Properties getProps();
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/FooService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/FooService.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/FooService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/services/FooService.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,39 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.services;
+
+import java.util.Properties;
+
+public interface FooService {
+
+	boolean foo();
+	
+	Properties fooProps();
+	
+	Boolean getObject();
+	
+	boolean getBoolean();
+	
+	int getInt();
+	
+	long getLong();
+	
+	double getDouble();
+	
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-comparator.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-comparator.xml?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-comparator.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-comparator.xml Thu Feb 21 06:35:17 2013
@@ -0,0 +1,36 @@
+<ipojo 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+    xmlns="org.apache.felix.ipojo"
+>
+	<component classname="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradedFooServiceProvider"
+		name="COMPARATOR-gradedFooProvider">
+		<provides>
+			<property field="grade"/>
+		</provides>
+	</component>
+	
+	
+	<component classname="org.apache.felix.ipojo.runtime.core.test.components.comparator.CheckServiceProvider"
+		name="COMPARATOR-DynamicCheckService">
+		<provides/>
+		<requires field="fs" comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator"/>
+		<requires field="fss" comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator"/>
+		<requires comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator">
+			<callback type="bind" method="bind"/>
+			<callback type="unbind" method="unbind"/>
+		</requires>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.runtime.core.test.components.comparator.CheckServiceProvider"
+		name="COMPARATOR-DynamicPriorityCheckService">
+		<provides/>
+		<requires policy="dynamic-priority" field="fs" comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator"/>
+		<requires policy="dynamic-priority" field="fss" comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator"/>
+		<requires policy="dynamic-priority" comparator="org.apache.felix.ipojo.runtime.core.test.components.comparator.GradeComparator">
+			<callback type="bind" method="bind"/>
+			<callback type="unbind" method="unbind"/>
+		</requires>
+	</component>
+	
+</ipojo>

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-filter.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-filter.xml?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-filter.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-filter.xml Thu Feb 21 06:35:17 2013
@@ -0,0 +1,122 @@
+<ipojo
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+    xmlns="org.apache.felix.ipojo">
+
+  <!--  Simple Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckProvider"
+    name="SimpleFilterCheckServiceProvider" architecture="true">
+    <provides>
+      <property field="m_toto" name="toto" value="A" />
+    </provides>
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckSubscriber"
+    name="SimpleFilterCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+  
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckSubscriber"
+    name="SimpleFromCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" from="A" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+  
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckProvider"
+    name="SimplePIDCheckServiceProvider" architecture="true">
+    <provides>
+      <property type="String" name="service.pid" />
+    </provides>
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckSubscriber"
+    name="SimpleFilterCheckServiceSubscriber2" architecture="true">
+    <requires field="m_foo" id="id2" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Optional Simple Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckSubscriber"
+    name="OptionalSimpleFilterCheckServiceSubscriber"
+    architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1"
+      optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.FilterCheckSubscriber"
+    name="OptionalSimpleFilterCheckServiceSubscriber2"
+    architecture="true">
+    <requires field="m_foo" id="id2" optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!-- Aggregate filter Dependencies-->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.MultipleFilterCheckSubscriber"
+    name="MultipleFilterCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.MultipleFilterCheckSubscriber"
+    name="MultipleFilterCheckServiceSubscriber2" architecture="true">
+    <requires field="m_foo" id="id2" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Optional Aggregate Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.MultipleFilterCheckSubscriber"
+    name="OptionalMultipleFilterCheckServiceSubscriber"
+    architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false"
+      optional="true">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.filter.MultipleFilterCheckSubscriber"
+    name="OptionalMultipleFilterCheckServiceSubscriber2"
+    architecture="true">
+    <requires field="m_foo" id="id2" optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+</ipojo>



Mime
View raw message