You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2011/11/08 10:23:03 UTC

svn commit: r1199163 [2/2] - in /tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static: ./ calculator-bundle/ calculator-bundle/META-INF/ calculator-bundle/OSGI-INF/ calculator-bundle/OSGI-INF/blueprint/ calculator-bundle/OSGI-INF/sc...

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov  8 09:23:01 2011
@@ -0,0 +1 @@
+target

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF Tue Nov  8 09:23:01 2011
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Export-Package: calculator.dosgi.operations;version="1.0.0"
+Bundle-Version: 1.0.0
+Bundle-Name: calculator.dosgi.operations
+Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator
+Bundle-ManifestVersion: 2
+Import-Package: calculator.dosgi.operations;version="[1.0.0,1.0.0]",
+ org.oasisopen.sca.annotation;version="2.0.0",
+ org.osgi.framework,
+ org.osgi.service.component;resolution:=optional,
+ org.osgi.service.packageadmin
+Bundle-SymbolicName: calculator.dosgi.operations
+Bundle-Vendor: The Apache Software Foundation
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-DocURL: http://www.apache.org/
+Service-Component-Disabled: OSGI-INF/add-component.xml,
+ OSGI-INF/subtract-component.xml,
+ OSGI-INF/multiply-component.xml,
+ OSGI-INF/divide-component.xml
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.dosgi.operations.impl.AddServiceImpl" />
+    <service>
+        <provide interface="calculator.dosgi.operations.AddService" />
+    </service>
+</scr:component>

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
+<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <component id="AddComponent" class="calculator.dosgi.operations.impl.AddServiceImpl">
+    </component>
+    <component id="SubtractComponent" class="calculator.dosgi.operations.impl.SubtractServiceImpl">
+    </component>
+    <component id="MultiplyComponent" class="calculator.dosgi.operations.impl.MultiplyServiceImpl">
+    </component>
+    <component id="DivideComponent" class="calculator.dosgi.operations.impl.DivideServiceImpl">
+    </component>
+
+    <!-- We can derive the SCA services for the implementation.osgi -->
+    <service id="AddService" ref="AddComponent" interface="calculator.dosgi.operations.AddService">
+    </service>
+    <service id="SubtractService" ref="SubtractComponent" interface="calculator.dosgi.operations.SubtractService">
+    </service>
+    <service id="MultiplyService" ref="MultiplyComponent" interface="calculator.dosgi.operations.MultiplyService">
+    </service>
+    <service id="DivideService" ref="DivideComponent" interface="calculator.dosgi.operations.DivideService">
+    </service>
+</components>
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.dosgi.operations.impl.DivideServiceImpl" />
+    <service>
+        <provide interface="calculator.dosgi.operations.DivideService" />
+    </service>
+</scr:component>

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.dosgi.operations.impl.MultiplyServiceImpl" />
+    <service>
+        <provide interface="calculator.dosgi.operations.MultiplyService" />
+    </service>
+</scr:component>

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType Tue Nov  8 09:23:01 2011
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" 
+               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+               xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+
+    
+    <!-- The service elment defines an SCA proxy to a remote OSGi service -->
+    <service name="AddService">
+        <interface.java interface="calculator.dosgi.operations.AddService"/>
+        <extensions>
+        	<t:osgi.property name="prop1">1</t:osgi.property>
+        	<t:osgi.property name="prop2">ABC</t:osgi.property>
+        </extensions>
+    </service>
+    <service name="SubtractService">
+        <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+        <extensions>
+        	<t:osgi.property name="prop1">1</t:osgi.property>
+        	<t:osgi.property name="prop2">ABC</t:osgi.property>
+        </extensions>
+    </service>
+    <service name="MultiplyService">
+        <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+        <extensions>
+        	<t:osgi.property name="prop1">1</t:osgi.property>
+        	<t:osgi.property name="prop2">ABC</t:osgi.property>
+        </extensions>
+    </service>
+    <service name="DivideService">
+        <interface.java interface="calculator.dosgi.operations.DivideService"/>
+        <extensions>
+        	<t:osgi.property name="prop1">1</t:osgi.property>
+        	<t:osgi.property name="prop2">ABC</t:osgi.property>
+        </extensions>
+    </service>
+</componentType>

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite Tue Nov  8 09:23:01 2011
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" 
+    xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+    targetNamespace="http://calculator.dosgi" 
+    name="OperationsComposite">
+
+    <component name="OperationsComponent">
+        <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
+        <service name="AddService">
+            <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+        </service>
+        <service name="SubtractService">
+            <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+        </service>
+        <service name="MultiplyService">
+            <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+        </service>
+        <service name="DivideService">
+            <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+        </service>
+        
+    </component>
+
+</composite>

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.dosgi.operations.impl.SubtractServiceImpl" />
+    <service>
+        <provide interface="calculator.dosgi.operations.SubtractService" />
+    </service>
+</scr:component>

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca.samples</groupId>
+        <artifactId>tuscany-samples</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>sample-operations-bundle</artifactId>
+    <name>Apache Tuscany SCA Sample OSGi Remote Services Calculator Operations</name>
+
+    <dependencies>
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-base-runtime-pom</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <type>pom</type>
+        </dependency>
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-osgi-runtime-pom</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <type>pom</type>
+        </dependency>
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-rmi-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-launcher-equinox</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl-osgi</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.osgi</groupId>
+            <artifactId>services</artifactId>
+            <version>3.2.0-v20090520-1800</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- Equinox Declarative Services -->
+        <dependency>
+            <groupId>org.eclipse.equinox</groupId>
+            <artifactId>ds</artifactId>
+            <version>1.1.0-v20090601</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.equinox</groupId>
+            <artifactId>util</artifactId>
+            <version>1.0.100-v20090520-1800</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.1</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <version>2.5.1</version>
+                <configuration>
+                    <buildcommands>
+                        <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+                        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+                    </buildcommands>
+                    <projectnatures>
+                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+                        <projectnature>org.eclipse.pde.PluginNature</projectnature>
+                    </projectnatures>
+                    <classpathContainers>
+                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+                        </classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+
+<!-- Don't think we need this as the JUnit test starts equinox
+            <plugin>
+                <groupId>org.apache.tuscany.maven.plugins</groupId>
+                <artifactId>maven-osgi-junit-plugin</artifactId>
+                <version>1.0</version>
+                <dependencies>
+                   <dependency>
+                      <groupId>org.apache.tuscany.sca</groupId>
+                      <artifactId>tuscany-node-launcher-equinox</artifactId>
+                      <version>${project.version}</version>
+                   </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>osgi-test</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                        <configuration>
+                            <systemProperties>
+                                <property>
+                                    <name>osgi.configuration.area</name>
+                                    <value>${project.build.directory}/equinox</value>
+                                </property>
+                            </systemProperties>                        
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+-->            
+        </plugins>
+    </build>
+
+</project>

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java Tue Nov  8 09:23:01 2011
@@ -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 calculator.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the add service
+ */
+@Remotable
+public interface AddService {
+
+    double add(double n1, double n2);
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java Tue Nov  8 09:23:01 2011
@@ -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 calculator.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the divide service
+ */
+@Remotable
+public interface DivideService {
+
+    double divide(double n1, double n2);
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java Tue Nov  8 09:23:01 2011
@@ -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 calculator.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the multiply service
+ */
+@Remotable
+public interface MultiplyService {
+
+    double multiply(double n1, double n2);
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java Tue Nov  8 09:23:01 2011
@@ -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 calculator.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the subtract service
+ */
+@Remotable
+public interface SubtractService {
+
+    double subtract(double n1, double n2);
+
+}

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.AddService;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+    public double add(double n1, double n2) {
+        Logger logger = Logger.getLogger("calculator");
+        logger.log(Level.INFO, "Adding " + n1 + " and " + n2);
+        return n1 + n2;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.DivideService;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+    public double divide(double n1, double n2) {
+        Logger logger = Logger.getLogger("calculator");
+        logger.log(Level.INFO, "Dividing " + n1 + " with " + n2);
+        return n1 / n2;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.MultiplyService;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+    public double multiply(double n1, double n2) {
+        Logger logger = Logger.getLogger("calculator");
+        logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2);
+        return n1 * n2;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,88 @@
+/*
+ * 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 calculator.dosgi.operations.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ *
+ */
+public class OperationsActivator implements BundleActivator {
+    private Logger logger = Logger.getLogger(OperationsActivator.class.getName());
+
+    public void start(BundleContext context) throws Exception {
+        logger.info("Starting " + context.getBundle());
+
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        
+        logger.info("Registering " + AddService.class.getName());
+        props.put("sca.service", "AddComponent#service-name(Add)");
+        context.registerService(AddService.class.getName(), new AddServiceImpl(), props);
+
+        logger.info("Registering " + SubtractService.class.getName());
+        props.put("sca.service", "SubtractComponent#service-name(Subtract)");
+        context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props);
+
+        logger.info("Registering " + MultiplyService.class.getName());
+        props.put("sca.service", "MultiplyComponent#service-name(Multiply)");
+        context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props);
+
+        logger.info("Registering " + DivideService.class.getName());
+        props.put("sca.service", "DivideComponent#service-name(Divide)");
+        context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props);
+
+        getBundle(context, AddService.class);
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        logger.info("Stopping " + context.getBundle());
+        // Registered services will be automatically unregistered
+    }
+
+    private Bundle getBundle(BundleContext bundleContext, Class<?> cls) {
+        PackageAdmin packageAdmin = null;
+        // PackageAdmin is used to resolve bundles
+        ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
+        if (ref != null) {
+            packageAdmin = (PackageAdmin)bundleContext.getService(ref);
+            Bundle bundle = packageAdmin.getBundle(cls);
+            if (bundle != null) {
+                logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName());
+            }
+            bundleContext.ungetService(ref);
+            return bundle;
+        }
+        return null;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+    public double subtract(double n1, double n2) {
+        Logger logger = Logger.getLogger("calculator");
+        logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2);
+        return n1 - n2;
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* 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.    
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" 
+              xmlns:c="http://calculator.dosgi">
+    <deployable composite="c:OperationsComposite" />
+</contribution>

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,105 @@
+/*
+ * 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 calculator.dosgi.operations.test;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * Utility class to create OSGi bundles
+ *
+ * @version $Rev: 796166 $ $Date: 2009-07-21 08:03:47 +0100 (Tue, 21 Jul 2009) $
+ */
+public class OSGiTestUtils {
+    private static class InvocationHandlerImpl implements InvocationHandler {
+        private Object instance;
+
+        public InvocationHandlerImpl(Object instance) {
+            super();
+            this.instance = instance;
+        }
+
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+            Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
+            return m.invoke(instance, args);
+        }
+
+    }
+
+    /**
+     * Returns a string representation of the given bundle.
+     *
+     * @param b
+     * @param verbose
+     * @return
+     */
+    public static String bundleStatus(Bundle bundle, boolean verbose) {
+        StringBuffer sb = new StringBuffer();
+        sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
+        int s = bundle.getState();
+        if ((s & Bundle.UNINSTALLED) != 0) {
+            sb.append(" UNINSTALLED");
+        }
+        if ((s & Bundle.INSTALLED) != 0) {
+            sb.append(" INSTALLED");
+        }
+        if ((s & Bundle.RESOLVED) != 0) {
+            sb.append(" RESOLVED");
+        }
+        if ((s & Bundle.STARTING) != 0) {
+            sb.append(" STARTING");
+        }
+        if ((s & Bundle.STOPPING) != 0) {
+            sb.append(" STOPPING");
+        }
+        if ((s & Bundle.ACTIVE) != 0) {
+            sb.append(" ACTIVE");
+        }
+
+        if (verbose) {
+            sb.append(" ").append(bundle.getLocation());
+            sb.append(" ").append(bundle.getHeaders());
+        }
+        return sb.toString();
+    }
+
+    /**
+     * A utility to cast the object to the given interface. If the class for the object
+     * is loaded by a different classloader, a proxy will be created.
+     *
+     * @param <T>
+     * @param obj
+     * @param cls
+     * @return
+     */
+    public static <T> T cast(Object obj, Class<T> cls) {
+        if (cls.isInstance(obj)) {
+            return cls.cast(obj);
+        } else {
+            return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
+                                                   new Class<?>[] {cls},
+                                                   new InvocationHandlerImpl(obj)));
+        }
+    }
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,43 @@
+/*
+ * 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 calculator.dosgi.operations.test;
+
+import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
+
+/**
+ *
+ */
+public class OperationsNode {
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        if (args.length == 0) {
+            args = new String[] {"-bundles"};
+        }
+        try {
+            NodeLauncher.main(args);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java Tue Nov  8 09:23:01 2011
@@ -0,0 +1,105 @@
+/*
+ * 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 calculator.dosgi.operations.test;
+
+import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+import calculator.dosgi.operations.AddService;
+
+/**
+ *
+ */
+public class OperationsOSGiNodeTestCase {
+    private static EquinoxHost host;
+    private static BundleContext context;
+    private static Bundle operationsBundle;
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        try {
+            host = new EquinoxHost();
+            context = host.start();
+
+            for (Bundle b : context.getBundles()) {
+                if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
+                    .startsWith("org.apache.tuscany.sca.")) {
+                    try {
+                        if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+                            // Start the non-fragment bundle
+                            b.start();
+                        }
+                    } catch (Exception e) {
+                        System.out.println("Error for bundle: " + b.getSymbolicName());
+                        e.printStackTrace();
+                    }
+                    System.out.println(bundleStatus(b, false));
+                }
+                if ("calculator.dosgi.operations".equals(b.getSymbolicName())) {
+                    operationsBundle = b;
+                }
+            }
+
+            if (operationsBundle != null) {
+                operationsBundle.start();
+                System.out.println(bundleStatus(operationsBundle, false));
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+    @Test
+    public void testOSGi() throws Exception {
+        Registry registry = LocateRegistry.getRegistry(8085);
+        Object add = registry.lookup("AddService");
+        AddService addService = OSGiTestUtils.cast(add, AddService.class);
+        double sum = addService.add(1.0, 2.0);
+        Assert.assertEquals(3.0, sum, 0.0);
+    }
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        if (host != null) {
+            host.stop();
+            context = null;
+        }
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/resources/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/pom.xml?rev=1199163&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/learning-more/distributed-osgi-static/pom.xml Tue Nov  8 09:23:01 2011
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca.samples</groupId>
+        <artifactId>tuscany-samples-learning-more</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>tuscany-samples-distributed-osgi-static</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Tuscany SCA Distributed OSGI Statically Configured Samples</name>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>calculator-bundle</module>
+                <module>operations-bundle</module>
+            </modules>
+        </profile>
+    </profiles>    
+</project>