From 36a407185baa909b889bad840852ad79cad86d69 Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 31 Jul 2009 10:49:50 +0000 Subject: Delete old RC tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@799571 13f79535-47bb-0310-9956-ffa450edef68 --- .../calculator/dosgi/operations/AddService.java | 31 ------ .../calculator/dosgi/operations/DivideService.java | 31 ------ .../dosgi/operations/MultiplyService.java | 31 ------ .../dosgi/operations/SubtractService.java | 31 ------ .../dosgi/operations/impl/AddServiceImpl.java | 37 -------- .../dosgi/operations/impl/DivideServiceImpl.java | 37 -------- .../dosgi/operations/impl/MultiplyServiceImpl.java | 37 -------- .../dosgi/operations/impl/OperationsActivator.java | 88 ----------------- .../dosgi/operations/impl/SubtractServiceImpl.java | 37 -------- .../main/resources/META-INF/sca-contribution.xml | 23 ----- .../src/main/resources/OSGI-INF/add-component.xml | 25 ----- .../OSGI-INF/blueprint/operations-module.xml | 40 -------- .../main/resources/OSGI-INF/divide-component.xml | 25 ----- .../main/resources/OSGI-INF/multiply-component.xml | 25 ----- .../resources/OSGI-INF/sca/bundle.componentType | 47 --------- .../main/resources/OSGI-INF/sca/bundle.composite | 43 --------- .../main/resources/OSGI-INF/subtract-component.xml | 25 ----- .../dosgi/operations/test/OSGiTestUtils.java | 105 --------------------- .../dosgi/operations/test/OperationsNode.java | 43 --------- .../test/OperationsOSGiNodeTestCase.java | 104 -------------------- 20 files changed, 865 deletions(-) delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/add-component.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/blueprint/operations-module.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/divide-component.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/multiply-component.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.componentType delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.composite delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/subtract-component.xml delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java delete mode 100644 tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java (limited to 'tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src') diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 7d68dbd5c5..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 998f6e9554..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index 7ed6db2e6b..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index cb98b8fb67..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java deleted file mode 100644 index e0a6622136..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java deleted file mode 100644 index 028f860885..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java deleted file mode 100644 index e928317c2e..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java deleted file mode 100644 index f9e606bd9a..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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 props = new Hashtable(); - - 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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java deleted file mode 100644 index 565670963f..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index ed7083fb29..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/add-component.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/add-component.xml deleted file mode 100644 index bf4ccc3d28..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/blueprint/operations-module.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/blueprint/operations-module.xml deleted file mode 100644 index e3b690f24a..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/blueprint/operations-module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/divide-component.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/divide-component.xml deleted file mode 100644 index b939a5de80..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/multiply-component.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/multiply-component.xml deleted file mode 100644 index 2bf897d72a..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.componentType b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.componentType deleted file mode 100644 index 6f6f4bdce6..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.componentType +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - 1 - ABC - - - - 1 - ABC - - - - 1 - ABC - - - - 1 - ABC - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.composite b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.composite deleted file mode 100644 index c9fb3818b8..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/sca/bundle.composite +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/subtract-component.xml b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/subtract-component.xml deleted file mode 100644 index 4af00695da..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/main/resources/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java deleted file mode 100644 index 332ba44396..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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: 758877 $ $Date: 2009-03-26 14:51:19 -0700 (Thu, 26 Mar 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 - * @param obj - * @param cls - * @return - */ - public static T cast(Object obj, Class 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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java deleted file mode 100644 index faf61d11e4..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/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/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java deleted file mode 100644 index bca04d11a4..0000000000 --- a/tags/java/sca/2.0-M3-RC1/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java +++ /dev/null @@ -1,104 +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) { - 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; - } - } - -} -- cgit v1.2.3