felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1448797 [1/4] - in /felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-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/ip...
Date Thu, 21 Feb 2013 20:52:27 GMT
Author: clement
Date: Thu Feb 21 20:52:25 2013
New Revision: 1448797

URL: http://svn.apache.org/r1448797
Log:
Felix-3903 - Migrate service providing tests to pax exam 3

Added:
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/   (with props)
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java   (with props)
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ChildInterface.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface1.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface2.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentParentInterface.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/basics.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/callbacks/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/callbacks/callbacks.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/concrete-abstract.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/controller/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/controller/service-controller.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/cons.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/inheritance.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/provider.xml
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/strategies/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/strategies/metadata-strategies.xml   (with props)
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestCallbacks.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestClass.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicProps.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicPropsReconfiguration.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestExposition.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestInheritedClasses.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNullCheck.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestOSGiProperties.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPropertiesInAnonymousClass.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestProvidedServiceArchitecture.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestServiceController.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSimplePS.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticProps.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticPropsReconfiguration.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/InheritanceTest.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategy2Test.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategyTest.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/PerInstanceStrategyTest.java
    felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/resources/

Propchange: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Feb 21 20:52:25 2013
@@ -0,0 +1,3 @@
+target
+*.iml
+.idea

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml Thu Feb 21 20:52:25 2013
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.felix</groupId>
+    <artifactId>ipojo-core-service-providing-test</artifactId>
+
+    <name>${project.artifactId}</name>
+    
+</project>
\ No newline at end of file

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java Thu Feb 21 20:52:25 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.components;
+
+import org.apache.felix.ipojo.runtime.core.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-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,83 @@
+/* 
+ * 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.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-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,54 @@
+/* 
+ * 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooBarProviderType1 implements FooService, BarService {
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		return new Properties();
+	}
+
+	public boolean bar() {
+		return true;
+	}
+
+	public Properties getProps() {
+		return new Properties();
+	}
+
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,117 @@
+/* 
+ * 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.BundleContext;
+
+import java.util.Properties;
+
+public class FooProviderType1 implements FooService {
+	
+	private int m_bar;
+	private String m_foo;
+    
+    private BundleContext m_context;
+    
+    private static FooProviderType1 singleton;
+    private static int count = 0;
+    
+    private static FooProviderType1 singleton(BundleContext bc) {
+        if (singleton == null) {
+            count++;
+            singleton = new FooProviderType1(bc);
+        }
+        return singleton;
+    }
+    
+    public static FooProviderType1 several(BundleContext bc) {
+        count++;
+        return new FooProviderType1(bc);
+    }
+        
+    public FooProviderType1(BundleContext bc) {
+        if (bc ==null) {
+            throw new RuntimeException("Injected bundle context null");
+        }
+        m_context = bc;
+    }
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+        if(m_foo != null) {
+            p.put("foo", m_foo);
+        }
+        p.put("context", m_context);
+        
+        p.put("count", new Integer(count));
+		return p;
+	}
+    
+	public void testException() throws Exception {
+        String a = "foobarbaz";
+	    throw new Exception("foo"+a);
+    }
+    
+    public void testTry() {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    public void testTry2(String s) {
+            String a = "foo";
+            a.charAt(0);
+    }
+    
+    private void nexttry(String  s) {
+        try {
+            s += "foo";
+        } catch(RuntimeException e) {
+            
+        }
+    }
+    
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+	
+	/**
+	 * Custom constructor.
+	 * @param bar
+	 * @param foo
+	 * @param bc
+	 */
+	public FooProviderType1(int bar, String foo, BundleContext bc) {
+	    m_bar = bar;
+	    m_foo = foo;
+	    m_context = bc;
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java Thu Feb 21 20:52:25 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+
+public class FooProviderTypeDyn implements FooService {
+	
+	private int intProp;	
+	private String strProp;
+	private String[] strAProp;
+	private int[] intAProp;
+	private boolean boolProp;
+
+	public boolean foo() {
+		intProp = 3;
+		boolProp = true;
+		if(strProp.equals("foo")) { strProp = "bar"; }
+		else { strProp = "foo"; }
+		strAProp = new String[] {"foo", "bar", "baz"};
+		intAProp = new int[] {3, 2, 1};
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("intProp", new Integer(intProp));
+		p.put("boolProp", new Boolean(boolProp));
+		p.put("strProp", strProp);
+		p.put("strAProp", strAProp);
+		p.put("intAProp", intAProp);
+		return p;
+	}
+	
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,58 @@
+/* 
+ * 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooProviderTypeDyn2 implements FooService {
+	
+	private int intProp = 2;
+	private boolean boolProp = true;
+	private String strProp = "foo";
+	private String[] strAProp = new String[] {"foo", "bar"};
+	private int[] intAProp = new int[] {1, 2, 3};
+
+	public boolean foo() {
+		intAProp = null;
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("intProp", new Integer(intProp));
+		p.put("boolProp", new Boolean(boolProp));
+		p.put("strProp", strProp);
+		p.put("strAProp", strAProp);
+		p.put("intAProp", intAProp);
+		return p;
+	}
+	
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,97 @@
+/*
+ * 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.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import javax.swing.*;
+import java.util.Properties;
+
+public class FooProviderWithAnonymousClass implements FooService {
+
+	private int intProp;
+	private String strProp;
+	private String[] strAProp;
+	private int[] intAProp;
+	private boolean boolProp;
+
+	public boolean foo() {
+		Runnable runnable = new Runnable() {
+			public void run() {
+				intProp = 3;
+				boolProp = true;
+				if(strProp.equals("foo")) { strProp = "bar"; }
+				else { strProp = "foo"; }
+				strAProp = new String[] {"foo", "bar", "baz"};
+				intAProp = new int[] {3, 2, 1};
+			}
+		};
+		new Thread(runnable).start();
+
+		try {
+			Thread.sleep(500);
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("intProp", new Integer(intProp));
+		p.put("boolProp", new Boolean(boolProp));
+		p.put("strProp", strProp);
+		p.put("strAProp", strAProp);
+		p.put("intAProp", intAProp);
+		return p;
+	}
+
+	public boolean getBoolean() {
+		SwingUtilities.invokeLater(new Runnable() {
+			public void run() {
+				intProp = 3;
+				boolProp = true;
+				if(strProp.equals("foo")) { strProp = "bar"; }
+				else { strProp = "foo"; }
+				strAProp = new String[] {"foo", "bar", "baz"};
+				intAProp = new int[] {3, 2, 1};
+			}
+		});
+
+		try {
+			Thread.sleep(500);
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+
+		return true;
+	}
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,57 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class NullCheckServiceProvider implements FooService {
+    
+    private String prop1;
+    private String prop2;
+    
+    public NullCheckServiceProvider() {
+      if (prop1 == null) {
+          prop2= "0";
+      }
+    }
+    
+
+    public boolean foo() {
+        if (prop1 == null  && prop2 != null) {
+            prop1 = "0";
+            prop2 = null;
+            return true;
+        }
+        if (prop2 == null  && prop1 != null) {
+            prop1 = null;
+            prop2 = "0";
+            return true;
+        }
+        return false;
+    }
+
+    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-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+public class SimpleClass {
+
+	// This class do not implement any interface, it will be exposed as SimpleClass
+
+	public String hello() {
+		return "Hello";
+	}
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,92 @@
+package org.apache.felix.ipojo.runtime.core.components.callbacks;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class CallbacksCheckService implements FooService, CheckService {
+
+	// 4 Counters
+	int registered = 0;
+	int unregistered = 0;
+	int registered2 = 0;
+	int unregistered2 = 0;
+
+	// 4 Methods
+	public void registered(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		registered++;
+	}
+
+	public void unregistered(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		unregistered++;
+	}
+
+	public void registered2(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		registered2++;
+	}
+
+	public void unregistered2(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		unregistered2++;
+	}
+
+    public boolean foo() {
+        return true;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("registered", new Integer(registered));
+        props.put("registered2", new Integer(registered2));
+        props.put("unregistered", new Integer(unregistered));
+        props.put("unregistered2", new Integer(unregistered2));
+        return props;
+    }
+
+    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;
+    }
+
+    public boolean check() {
+       return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("registered", new Integer(registered));
+        props.put("registered2", new Integer(registered2));
+        props.put("unregistered", new Integer(unregistered));
+        props.put("unregistered2", new Integer(unregistered2));
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,56 @@
+package org.apache.felix.ipojo.runtime.core.components.controller;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class ControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controller;
+
+    public boolean foo() {
+        return controller;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+    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;
+    }
+
+    public boolean check() {
+        System.out.println("Before : " + controller);
+        controller = ! controller; // Change
+        System.out.println("After : " + controller);
+        return controller;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,66 @@
+package org.apache.felix.ipojo.runtime.core.components.controller;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class DoubleControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controllerFoo;
+    private boolean controllerCS;
+
+    public boolean foo() {
+        controllerFoo = ! controllerFoo;
+        return controllerFoo;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerFoo));
+        
+        controllerCS = true;
+        controllerFoo = true;
+        
+        return props;
+    }
+
+    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;
+    }
+
+    public boolean check() {
+        controllerCS = ! controllerCS;
+        return controllerCS;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerCS));
+        
+        // Invert both
+        controllerCS = ! controllerCS;
+        controllerFoo = ! controllerFoo;
+        
+        return props;
+        
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.a;
+
+public interface IA {
+    
+    public String methOne();
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,8 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.b;
+
+import org.apache.felix.ipojo.runtime.core.components.inheritance.a.IA;
+
+public interface IB extends IA {
+
+    public String methTwo();
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,19 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.c;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Provides;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB;
+
+@Component
+@Provides
+public class C implements IB {
+
+    public String methOne() {
+        return "one";
+    }
+
+    public String methTwo() {
+        return "two";
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,39 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.d;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Requires;
+import org.apache.felix.ipojo.annotations.Validate;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.a.IA;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB;
+
+@Component
+public class D {
+    @Requires
+    private IB[] cImpls;
+    private IB cImplDesired;
+
+    // works if I use following instead and cast to C type below
+    // in for loop
+    // but this creates dependency on bundle C instead of just
+    // the interface bundles A & B
+    // @Requires(default-implementation=C)
+    // private iB[] cImpls;
+    // private C cImplDesired;
+
+    @Validate
+    public void start() {
+        for (IB iimpl : cImpls) {
+
+            // works just fine
+            System.out.println(iimpl.methTwo());
+
+            // following produces 
+            // invalid D instance with NoMethodFoundError
+            // unless I cast to C instead of iA
+            if (((IA) iimpl).methOne().equals("one")) {
+                cImplDesired = iimpl;
+                System.out.println(iimpl.methOne());
+            }
+        }
+    }
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,45 @@
+/* 
+ * 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.components.inherited;
+
+import org.apache.felix.ipojo.runtime.core.services.ChildInterface;
+
+public class ProcessImplementation1 implements ChildInterface {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,44 @@
+/* 
+ * 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.components.inherited;
+
+
+public class ProcessImplementation2 extends ProcessParentImplementation {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,82 @@
+/* 
+ * 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.components.inherited;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class ProcessImplementation3 extends ProcessParentImplementation  implements FooService {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public boolean foo() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Properties fooProps() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean getBoolean() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public double getDouble() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getInt() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public long getLong() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public Boolean getObject() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,82 @@
+/* 
+ * 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.components.inherited;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class ProcessImplementation4 extends ProcessImplementation2  implements FooService {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public boolean foo() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Properties fooProps() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean getBoolean() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public double getDouble() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getInt() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public long getLong() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public Boolean getObject() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,46 @@
+/* 
+ * 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.components.inherited;
+
+import org.apache.felix.ipojo.runtime.core.services.ChildInterface;
+
+public class ProcessParentImplementation implements ChildInterface {
+
+    public void processChild() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParent1() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParentParent() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void processParent2() {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+
+import java.util.Properties;
+
+public class BarConsumer implements CheckService {
+    
+    private BarService bs;
+
+
+    public boolean check() {
+        return bs.bar();
+    }
+
+    public Properties getProps() {
+        Properties props = bs.getProps();
+        props.put("object", bs);
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class Consumer implements CheckService {
+    
+    private FooService fs;
+
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = fs.fooProps();
+        props.put("object", fs);
+        return props;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,164 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.IPOJOServiceFactory;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.handlers.providedservice.CreationStrategy;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.*;
+
+public class DummyCreationStrategy extends CreationStrategy implements InvocationHandler {
+
+    /**
+     * Map [ComponentInstance->ServiceObject] storing created service objects.
+     */
+    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();
+    
+    private InstanceManager m_manager;
+
+    private String[] m_specs;
+
+    /**
+     * A method is invoked on the proxy object.
+     * If the method is the {@link org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)}
+     * method, this method creates a service object if no already created for the asking
+     * component instance.
+     * If the method is {@link org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)}
+     * the service object is unget (i.e. removed from the map and deleted).
+     * In all other cases, a {@link UnsupportedOperationException} is thrown as this policy
+     * requires to use  the {@link org.apache.felix.ipojo.IPOJOServiceFactory} interaction pattern.
+     * @param arg0 the proxy object
+     * @param arg1 the called method
+     * @param arg2 the arguments
+     * @return the service object attached to the asking instance for 'get',
+     * <code>null</code> for 'unget',
+     * a {@link UnsupportedOperationException} for all other methods.
+     * @see java.lang.reflect.InvocationHandler#invoke(Object, java.lang.reflect.Method, Object[])
+     */
+    public Object invoke(Object arg0, Method arg1, Object[] arg2) {
+        if (isGetServiceMethod(arg1)) {
+            return getService((ComponentInstance) arg2[0]);
+        }
+
+        if (isUngetServiceMethod(arg1)) {
+            ungetService((ComponentInstance) arg2[0], arg2[1]);
+            return null;
+        }
+
+        throw new UnsupportedOperationException("This service requires an advanced creation policy. "
+                + "Before calling the service, call the getService(ComponentInstance) method to get "
+                + "the service object. " + arg1.getName());
+    }
+
+    /**
+     * A service object is required.
+     * This policy returns a service object per asking instance.
+     * @param instance the instance requiring the service object
+     * @return the service object for this instance
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)
+     */
+    public Object getService(ComponentInstance instance) {
+        Object obj = m_instances.get(instance);
+        if (obj == null) {
+            obj = m_manager.createPojoObject();
+            m_instances.put(instance, obj);
+        }
+        return obj;
+    }
+
+    /**
+     * A service object is unget.
+     * The service object is removed from the map and deleted.
+     * @param instance the instance releasing the service
+     * @param svcObject the service object
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)
+     */
+    public void ungetService(ComponentInstance instance, Object svcObject) {
+        Object pojo = m_instances.remove(instance);
+        m_manager.deletePojoObject(pojo);
+    }
+
+    /**
+     * The service is going to be registered.
+     * @param im the instance manager
+     * @param interfaces the published interfaces
+     * @param props the properties
+     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onPublication(org.osgi.framework.BundleContext, String[], java.util.Properties)
+     */
+    public void onPublication(InstanceManager im, String[] interfaces,
+            Properties props) {
+
+        m_manager = im;
+        m_specs = interfaces;
+
+    }
+
+    /**
+     * The service is going to be unregistered.
+     * The instance map is cleared. Created object are disposed.
+     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onUnpublication()
+     */
+    public void onUnpublication() {
+        Collection col = m_instances.values();
+        Iterator it = col.iterator();
+        while (it.hasNext()) {
+            m_manager.deletePojoObject(it.next());
+        }
+        m_instances.clear();
+    }
+
+    /**
+     * OSGi Service Factory getService method.
+     * @param arg0 the asking bundle
+     * @param arg1 the service registration
+     * @return a proxy implementing the {@link org.apache.felix.ipojo.IPOJOServiceFactory}
+     * @see org.osgi.framework.ServiceFactory#getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)
+     */
+    public Object getService(Bundle arg0, ServiceRegistration arg1) {
+        Object proxy = Proxy.newProxyInstance(m_manager.getClazz().getClassLoader(),
+                getSpecificationsWithIPOJOServiceFactory(m_specs, m_manager.getContext()), this);
+        return proxy;
+    }
+
+    /**
+     * OSGi Service factory unget method.
+     * Does nothing.
+     * @param arg0 the asking bundle
+     * @param arg1 the service registration
+     * @param arg2 the service object created for this bundle.
+     * @see org.osgi.framework.ServiceFactory#ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, Object)
+     */
+    public void ungetService(Bundle arg0, ServiceRegistration arg1,
+            Object arg2) { }
+
+    /**
+     * Utility method returning the class array of provided service
+     * specification and the {@link org.apache.felix.ipojo.IPOJOServiceFactory} interface.
+     * @param specs the published service interface
+     * @param bc the bundle context, used to load classes
+     * @return the class array containing provided service specification and
+     * the {@link org.apache.felix.ipojo.IPOJOServiceFactory} class.
+     */
+    private Class[] getSpecificationsWithIPOJOServiceFactory(String[] specs, BundleContext bc) {
+        Class[] classes = new Class[specs.length + 1];
+        int i = 0;
+        for (i = 0; i < specs.length; i++) {
+            try {
+                classes[i] = bc.getBundle().loadClass(specs[i]);
+            } catch (ClassNotFoundException e) {
+                // Should not happen.
+            }
+        }
+        classes[i] = IPOJOServiceFactory.class;
+        return classes;
+    }
+    
+    
+}
+

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,15 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.IPOJOServiceFactory;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.handlers.providedservice.strategy.ConfigurableCreationStrategy;
+
+public class DummyCreationStrategy2 extends ConfigurableCreationStrategy {
+
+	protected IPOJOServiceFactory getServiceFactory(InstanceManager manager) {
+		return new DummyServiceFactory(manager);
+	}
+    
+    
+}
+

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,61 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.handlers.providedservice.strategy.ServiceObjectFactory;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class DummyServiceFactory implements ServiceObjectFactory {
+
+    /**
+     * Map [ComponentInstance->ServiceObject] storing created service objects.
+     */
+    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();
+    
+    private InstanceManager m_manager;
+
+    public DummyServiceFactory(InstanceManager manager) {
+        m_manager = manager;
+    }
+
+    /**
+     * A service object is required.
+     * This policy returns a service object per asking instance.
+     * @param instance the instance requiring the service object
+     * @return the service object for this instance
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)
+     */
+    public Object getService(ComponentInstance instance) {
+        Object obj = m_instances.get(instance);
+        if (obj == null) {
+            obj = m_manager.createPojoObject();
+            m_instances.put(instance, obj);
+        }
+        return obj;
+    }
+
+    /**
+     * A service object is unget.
+     * The service object is removed from the map and deleted.
+     * @param instance the instance releasing the service
+     * @param svcObject the service object
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)
+     */
+    public void ungetService(ComponentInstance instance, Object svcObject) {
+        Object pojo = m_instances.remove(instance);
+        m_manager.deletePojoObject(pojo);
+    }
+
+    public void close() {
+        Collection col = m_instances.values();
+        Iterator it = col.iterator();
+        while (it.hasNext()) {
+            m_manager.deletePojoObject(it.next());
+        }
+        m_instances.clear();
+    }
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,86 @@
+/* 
+ * 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.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooBarProviderType1 implements FooService, BarService {
+    
+    public static long id = 0;
+    
+    public static long getNewId() {
+        id++;
+        return id;
+    }
+    
+    public static long getReturnedIds() {
+        return id;
+    }
+    
+    public static void resetIds() {
+        id = 0;
+    }
+	
+	private int m_bar;
+	private String m_foo;
+        
+    private long myid = getNewId();
+    
+    
+    
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+	    System.out.println(this + " - id : " + myid); //TODO DEBUG
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+        if(m_foo != null) {
+            p.put("foo", m_foo);
+        }
+        
+        p.put("id", new Long(myid));
+		return p;
+	}
+    
+    
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+    public boolean bar() {
+        return foo();
+    }
+
+    public Properties getProps() {
+        return fooProps();
+    }
+	
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java?rev=1448797&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java Thu Feb 21 20:52:25 2013
@@ -0,0 +1,86 @@
+/* 
+ * 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.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class FooProviderType1 implements FooService {
+
+    public static long id = 0;
+
+    public static long getNewId() {
+        id++;
+        return id;
+    }
+
+    public static long getReturnedIds() {
+        return id;
+    }
+
+    public static void resetIds() {
+        id = 0;
+    }
+
+    private int m_bar;
+    private String m_foo;
+
+    private long myid = getNewId();
+
+
+    public boolean foo() {
+        return true;
+    }
+
+    public Properties fooProps() {
+        System.out.println(this + " - id : " + myid); //TODO DEBUG
+        Properties p = new Properties();
+        p.put("bar", new Integer(m_bar));
+        if (m_foo != null) {
+            p.put("foo", m_foo);
+        }
+
+        p.put("id", new Long(myid));
+        return p;
+    }
+
+
+    public boolean getBoolean() {
+        return true;
+    }
+
+    public double getDouble() {
+        return 1.0;
+    }
+
+    public int getInt() {
+        return 1;
+    }
+
+    public long getLong() {
+        return 1;
+    }
+
+    public Boolean getObject() {
+        return new Boolean(true);
+    }
+
+
+}

Propchange: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message