summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle')
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF22
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml25
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml40
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml25
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml25
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType54
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite43
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml25
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml161
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java31
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java31
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java31
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java31
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java37
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java37
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java37
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java88
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java37
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java105
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java43
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java105
22 files changed, 0 insertions, 1056 deletions
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF
deleted file mode 100644
index 82a803e3a6..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-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
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml
deleted file mode 100644
index bf4ccc3d28..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/add-component.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml
deleted file mode 100644
index e3b690f24a..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/blueprint/operations-module.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml
deleted file mode 100644
index b939a5de80..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/divide-component.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml
deleted file mode 100644
index 2bf897d72a..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/multiply-component.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType
deleted file mode 100644
index 74704be28d..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.componentType
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite
deleted file mode 100644
index 816ba3c89c..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/sca/bundle.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml
deleted file mode 100644
index 4af00695da..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/OSGI-INF/subtract-component.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml
deleted file mode 100644
index a8df97bed6..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/pom.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<?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.1</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.1</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-osgi-runtime-pom</artifactId>
- <version>2.0.1</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0.1</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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java
deleted file mode 100644
index 7d68dbd5c5..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/AddService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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);
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java
deleted file mode 100644
index 998f6e9554..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/DivideService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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);
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java
deleted file mode 100644
index 7ed6db2e6b..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/MultiplyService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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);
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java
deleted file mode 100644
index cb98b8fb67..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/SubtractService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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);
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
deleted file mode 100644
index e0a6622136..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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;
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
deleted file mode 100644
index 028f860885..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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;
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
deleted file mode 100644
index e928317c2e..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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;
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
deleted file mode 100644
index 6bc14c1c78..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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;
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
deleted file mode 100644
index 565670963f..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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;
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 66d93248f0..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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>
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
deleted file mode 100644
index 3407507e3b..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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)));
- }
- }
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
deleted file mode 100644
index faf61d11e4..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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();
- }
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
deleted file mode 100644
index ef58d1f60b..0000000000
--- a/sca-java-2.x/tags/2.0.1-RC1/samples/learning-more/distributed-osgi-static/operations-bundle/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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;
- }
- }
-
-}