summaryrefslogtreecommitdiffstats
path: root/sandbox/samples/temp
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/samples/temp')
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/LICENSE205
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF23
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/NOTICE6
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml40
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml29
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/README196
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/pom.xml148
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java94
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java105
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java43
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java104
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/LICENSE205
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/META-INF/MANIFEST.MF23
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/NOTICE6
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml43
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml36
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml61
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml32
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/README145
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/dosgi-calculator.pngbin85103 -> 0 bytes
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/pom.xml153
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java36
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java78
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java114
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java99
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java93
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java132
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java43
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java144
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java105
-rw-r--r--sandbox/samples/temp/distributed-osgi/dynamic/pom.xml44
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/LICENSE205
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF22
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/NOTICE6
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml40
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType54
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite43
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml25
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/README185
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/pom.xml148
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java88
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java105
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java43
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java104
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/LICENSE205
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/META-INF/MANIFEST.MF20
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/NOTICE6
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml43
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/calculator-component.xml36
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType64
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite45
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/README143
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/dosgi-calculator.pngbin85103 -> 0 bytes
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/pom.xml153
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java36
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java76
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java114
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java105
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java31
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java93
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java132
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java37
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml24
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java43
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java152
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java105
-rw-r--r--sandbox/samples/temp/distributed-osgi/implementation.osgi/pom.xml44
-rw-r--r--sandbox/samples/temp/distributed-osgi/pom.xml44
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/README214
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/build.xml101
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/helloworld-ws-sdo.pngbin7549 -> 0 bytes
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/maven-eclipse.xml8
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/pom.xml180
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java51
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java33
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java51
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java34
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java42
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java59
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java29
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java40
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml28
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldws.composite31
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite34
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/logging.properties30
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite34
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/test.xsd35
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl88
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java85
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java67
-rw-r--r--sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java329
123 files changed, 0 insertions, 8003 deletions
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/LICENSE b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF
deleted file mode 100644
index cea4e2ff79..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: calculator.dosgi.operations;version="1.0.1"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi.dynamic.operations
-Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator
-Bundle-ManifestVersion: 2
-Import-Package: calculator.dosgi.operations;version="[1.0.1,1.0.1]",
- 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.dynamic.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
-SCA-Configuration: OSGI-INF/sca-config/*.xml
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/NOTICE b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/NOTICE
deleted file mode 100644
index 9ddba06a32..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2010 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml
deleted file mode 100644
index 99845257ff..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml
deleted file mode 100644
index f6b5f4690e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml
deleted file mode 100644
index 322d4daf2f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml
deleted file mode 100644
index b9ca777bd8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml
deleted file mode 100644
index 1965b571a9..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml
+++ /dev/null
@@ -1,29 +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.
--->
-<scact:sca-config targetNamespace="http://sample"
- xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <tuscany:binding.rmi name="Add" uri="rmi://localhost:8085/AddService"/>
- <tuscany:binding.rmi name="Divide" uri="rmi://localhost:8085/DivideService"/>
- <tuscany:binding.rmi name="Subtract" uri="rmi://localhost:8085/SubtractService"/>
- <tuscany:binding.rmi name="Multiply" uri="rmi://localhost:8085/MultiplyService"/>
-</scact:sca-config>
- \ No newline at end of file
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml
deleted file mode 100644
index 1472f5a976..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/README b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/README
deleted file mode 100644
index 77a4cbae9e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/README
+++ /dev/null
@@ -1,196 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Starting calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-4486-
-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-41f0
--b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47b3-
-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-444e-
-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator getB
-undle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic.operations
-
-osgi>
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-44
-4e-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:18:43 PM calculator.dosgi.operations.impl.OperationsActivator stop
-
-INFO: Stopping calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-44
-86-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-4
-1f0-b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47
-b3-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-
-osgi>
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator-operations/
- src/
- main/
- java/
- calculator/
- dosgi/
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- impl/
- OperationsActivator.java - OSGi bundle activator
- AddServiceImpl.java - Implementation for Add
- SubtractServiceImpl.java - Implementation for Subtract
- MultiplyServiceImpl.java - Implementation for Multiply
- DivideServiceImpl.java - Implementation for Divide
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- operations-config.xml - The SCA configuration file for OSGi remote services
- test/
- java/
- src/
- calculator/
- dosgi/
- operations/
- test/
- OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-dynamic-calculator-operations
-mvn
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/pom.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/pom.xml
deleted file mode 100644
index 926208b388..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/pom.xml
+++ /dev/null
@@ -1,148 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-dynamic-calculator-operations</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Dynamic Caculator Operations Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </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>${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>
-
- <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>${pom.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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
deleted file mode 100644
index 971500782f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
deleted file mode 100644
index 49b8a1c0bf..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
deleted file mode 100644
index f4e59d12ea..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
deleted file mode 100644
index bfb9b820f7..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
deleted file mode 100644
index 66b2977241..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
deleted file mode 100644
index a3c21b2b96..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
deleted file mode 100644
index 7922d2d392..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
deleted file mode 100644
index f75cc6444e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
+++ /dev/null
@@ -1,94 +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>();
- props.put("service.exported.configs", new String[] {"org.osgi.sca"});
- props.put("service.exported.interfaces", new String[] {"*"});
-
- logger.info("Registering " + AddService.class.getName());
- props.put("sca.service", "AddComponent#service-name(Add)");
- props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Add"});
- context.registerService(AddService.class.getName(), new AddServiceImpl(), props);
-
- logger.info("Registering " + SubtractService.class.getName());
- props.put("sca.service", "SubtractComponent#service-name(Subtract)");
- props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Subtract"});
- context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props);
-
- logger.info("Registering " + MultiplyService.class.getName());
- props.put("sca.service", "MultiplyComponent#service-name(Multiply)");
- props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Multiply"});
- context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props);
-
- logger.info("Registering " + DivideService.class.getName());
- props.put("sca.service", "DivideComponent#service-name(Divide)");
- props.put("org.osgi.sca.bindings", new String[] {"{http://sample}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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
deleted file mode 100644
index 4bbe83b14f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
deleted file mode 100644
index cd92989da1..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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$ $Date$
- */
-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
deleted file mode 100644
index 02007c385c..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
deleted file mode 100644
index eee64bf86f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-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.dynamic.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;
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/LICENSE b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/META-INF/MANIFEST.MF b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/META-INF/MANIFEST.MF
deleted file mode 100644
index 6ce24a4a32..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: calculator.dosgi;version="1.0.1",
- calculator.dosgi.operations;version="1.0.1"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi.dynamic
-Bundle-Activator: calculator.dosgi.impl.CalculatorActivator
-Bundle-ManifestVersion: 2
-Import-Package: org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin,
- org.osgi.util.tracker
-Bundle-SymbolicName: calculator.dosgi.dynamic
-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/calculator-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-SCA-Configuration: OSGI-INF/sca-config/calculator-config.xml
-Remote-Service: OSGI-INF/remote-service/*.xml
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/NOTICE b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/NOTICE
deleted file mode 100644
index 9ddba06a32..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2010 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml
deleted file mode 100644
index fd834e12ef..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml
+++ /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.
--->
-<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
-<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
- <property name="addService" ref="AddService" />
- <property name="subtractService" ref="SubtractService" />
- <property name="multiplyService" ref="MultiplyService" />
- <property name="divideService" ref="DivideService" />
- </component>
-
- <!-- We can derive the SCA services for the implementation.osgi -->
- <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
- </service>
-
- <!-- We can derive the SCA references for the implementation.osgi -->
- <reference id="AddService" interface="calculator.dosgi.operations.AddService">
- </reference>
- <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
- </reference>
- <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
- </reference>
- <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
- </reference>
-
-</components> \ No newline at end of file
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml
deleted file mode 100644
index 5daaa59aae..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml
+++ /dev/null
@@ -1,36 +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="CalculatorComponent"
- xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" />
- <service>
- <provide interface="calculator.dosgi.CalculatorService" />
- </service>
-
- <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
- policy="dynamic" />
- <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
- unbind="unsetSubtractService" policy="dynamic" />
- <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
- unbind="unsetMultiplyService" policy="dynamic" />
- <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
- unbind="unsetDivideService" policy="dynamic" />
-
-</scr:component>
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
deleted file mode 100644
index ded82797b5..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
+++ /dev/null
@@ -1,61 +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 consumer-side service description file for RFC 119 -->
-<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- Describe a remote OSGi service -->
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.AddService" />
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="sca.reference" value="addService"/>
- <property name="org.osgi.sca.bindings">
- <list>
- <value>{http://sample}Add</value>
- </list>
- </property>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.SubtractService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="subtractService"/>
- <property name="org.osgi.sca.bindings">
- <list>
- <value>{http://sample}Subtract</value>
- </list>
- </property>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.MultiplyService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="multiplyService"/>
- <property name="org.osgi.sca.bindings" value="{http://sample}Multiply"/>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.DivideService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="divideService"/>
- <property name="org.osgi.sca.bindings" value="{http://sample}Divide"/>
- </endpoint-description>
-</endpoint-descriptions> \ No newline at end of file
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml
deleted file mode 100644
index f10b577e87..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml
+++ /dev/null
@@ -1,32 +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.
--->
-<scact:sca-config targetNamespace="http://sample"
- xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <sca:binding.ws name="Calculator" uri="http://localhost:8086/CalculatorService"/>
-
- <!-- bindings for the remote services -->
- <tuscany:binding.rmi name="Add" uri="rmi://localhost:8085/AddService"/>
- <tuscany:binding.rmi name="Divide" uri="rmi://localhost:8085/DivideService"/>
- <tuscany:binding.rmi name="Subtract" uri="rmi://localhost:8085/SubtractService"/>
- <tuscany:binding.rmi name="Multiply" uri="rmi://localhost:8085/MultiplyService"/>
-</scact:sca-config>
- \ No newline at end of file
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/README b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/README
deleted file mode 100644
index e8d311298e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/README
+++ /dev/null
@@ -1,145 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
-INFO: Equinox-based service discoverer is now configured.
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Starting calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Registering calculator.dosgi.CalculatorService
-Nov 4, 2009 5:20:21 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869 domai
-n: tuscany.apache.org
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Nov 4, 2009 5:20:24 PM org.mortbay.log.Slf4jLog info
-INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
-bay.log.Slf4jLog
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: jetty-6.1.x
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: Started SelectChannelConnector@0.0.0.0:8086
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
-apping
-INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-42b3
--9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:20:25 PM calculator.dosgi.impl.CalculatorActivator getBundle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic
-
-You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
-the WSDL.
-
-You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-4
-2b3-9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
-etMapping
-INFO: Removed Servlet mapping: /CalculatorService
-Nov 4, 2009 5:21:16 PM calculator.dosgi.impl.CalculatorActivator stop
-INFO: Stopping calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator/
- src/
- main/
- java/
- calculator/
- dosgi/
- CalculatorService.java - The interface for Calculator service
- impl/
- CalculatorActivator.java - OSGi bundle activator for Calculator bundle
- CalculatorServiceDSImpl.java - OSGi declarative service based implementation
- CalculatorServiceImpl.java - Basic OSGi implementation
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- rmi/
- OperationsRemote.java - RMI remote interface for operations
- OperationsRMIServer_Stub.java - RMI stub
- OperationsRMIServer.java - RMI server implementation of the operations
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- calculator-config.xml - The SCA configuration file for OSGi remote services
- remote-service/
- calculator-service-descriptions.xml - The OSGi remote service endpoint descriptions
- test/
- java/
- src/
- calculator/
- dosgi/
- test/
- CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- dosig-calculator.png - a pictorial representation of the sample
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator
-mvn
-
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/dosgi-calculator.png b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/dosgi-calculator.png
deleted file mode 100644
index 805baa54d2..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/dosgi-calculator.png
+++ /dev/null
Binary files differ
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/pom.xml b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/pom.xml
deleted file mode 100644
index 0394373342..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/pom.xml
+++ /dev/null
@@ -1,153 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-dynamic-calculator</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Dynamic Caculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- <scope>runtime</scope>
- </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>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</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>
-
- </dependencies>
-
- <build>
- <finalName>${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>
-
- <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>${pom.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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java
deleted file mode 100644
index cc562b7c2f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java
+++ /dev/null
@@ -1,36 +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;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
deleted file mode 100644
index 6228afcd53..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
+++ /dev/null
@@ -1,78 +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.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.CalculatorService;
-import calculator.dosgi.operations.AddService;
-
-/**
- *
- */
-public class CalculatorActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(CalculatorActivator.class.getName());
-
- 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;
- }
-
- public void start(BundleContext context) throws Exception {
- logger.info("Starting " + context.getBundle());
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put("sca.service", "CalculatorComponent#service-name(Calculator)");
- props.put("calculator", "Calculator");
- props.put("service.exported.configs", new String[] {"org.osgi.sca"});
- props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Calculator"});
- props.put("service.exported.interfaces", new String[] {"*"});
- logger.info("Registering " + CalculatorService.class.getName());
- CalculatorService calculator = new CalculatorServiceImpl(context);
- context.registerService(CalculatorService.class.getName(), calculator, props);
-
- getBundle(context, AddService.class);
-
- }
-
- public void stop(BundleContext context) throws Exception {
- logger.info("Stopping " + context.getBundle());
- // Registered services will be automatically unregistered
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
deleted file mode 100644
index 5f9db16ca9..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
+++ /dev/null
@@ -1,114 +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.impl;
-
-import org.osgi.service.component.ComponentContext;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceDSImpl implements CalculatorService {
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- public CalculatorServiceDSImpl() {
- super();
- System.out.println("CalculatorServiceDSImpl()");
- }
-
- protected void activate(ComponentContext context) {
- System.out.println("Activating " + context);
- }
-
- protected void deactivate(ComponentContext context) {
- System.out.println("Deactivating " + context);
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void setAddService(AddService addService) {
- System.out.println("setAddService()");
- this.addService = addService;
- }
-
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void unsetAddService(AddService addService) {
- System.out.println("unsetAddService()");
- this.addService = null;
- }
-
- public void unsetSubtractService(SubtractService subtractService) {
- this.subtractService = null;
- }
-
- public void unsetDivideService(DivideService divideService) {
- this.divideService = null;
- }
-
- public void unsetMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = null;
- }
- private <T> T getService(Class<T> cls) {
- for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) {
- if (cls.isInstance(s)) {
- return cls.cast(s);
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
deleted file mode 100644
index aa09b27139..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,99 +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.impl;
-
-import static org.osgi.framework.Constants.OBJECTCLASS;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
- private Map<Class<?>, ServiceTracker> remoteServices = new HashMap<Class<?>, ServiceTracker>();
-
- public CalculatorServiceImpl() {
- super();
- }
-
- public CalculatorServiceImpl(BundleContext context) {
- super();
- for (Class<?> cls : new Class<?>[] {AddService.class, SubtractService.class, MultiplyService.class,
- DivideService.class}) {
- Filter remoteFilter = null;
- try {
- remoteFilter =
- context.createFilter("(&(" + OBJECTCLASS + "=" + cls.getName() + ") (service.imported=*))");
- } catch (InvalidSyntaxException e) {
- e.printStackTrace();
- }
- ServiceTracker tracker = new ServiceTracker(context, remoteFilter, null);
- this.remoteServices.put(cls, tracker);
- tracker.open();
- }
- }
-
- private <T> T getService(Class<T> cls) {
- ServiceTracker tracker = remoteServices.get(cls);
- try {
- // Wait for 10 seconds until the remote services are imported
- tracker.waitForService(10000);
- } catch (InterruptedException e) {
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
- Object[] remoteObjects = tracker.getServices();
- if (remoteObjects != null) {
- for (Object s : remoteObjects) {
- if (cls.isInstance(s)) {
- System.out.println("Remote service: " + s);
- return cls.cast(s);
- }
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java
deleted file mode 100644
index 971500782f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
deleted file mode 100644
index 49b8a1c0bf..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
deleted file mode 100644
index f4e59d12ea..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
deleted file mode 100644
index bfb9b820f7..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
deleted file mode 100644
index a4fc52694e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
+++ /dev/null
@@ -1,93 +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.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- *
- */
-public class OperationsRMIServer implements OperationsRemote, Serializable {
-
- private static final long serialVersionUID = 6081008315263103012L;
- private transient Registry registry;
-
- public OperationsRMIServer() throws RemoteException {
- super();
- }
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
- public void start() throws RemoteException {
- Thread thread = new Thread() {
- public void run() {
- try {
- System.out.println("Starting the RMI server for calculator operations...");
- Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this);
- registry = LocateRegistry.createRegistry(8085);
- registry.bind("AddService", stub);
- registry.bind("SubtractService", stub);
- registry.bind("MultiplyService", stub);
- registry.bind("DivideService", stub);
- System.out.println("RMI server for calculator operations is now started.");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- };
- thread.start();
- }
-
- public void stop() {
- if (registry != null) {
- try {
- registry.unbind("AddService");
- registry.unbind("SubtractService");
- registry.unbind("MultiplyService");
- registry.unbind("DivideService");
- UnicastRemoteObject.unexportObject(this, false);
- UnicastRemoteObject.unexportObject(registry, false);
- registry = null;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
deleted file mode 100644
index a813dfb6f3..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
+++ /dev/null
@@ -1,132 +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.
- */
-
-// Stub class generated by rmic, do not edit.
-// Contents subject to change without notice.
-package calculator.rmi;
-
-public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote {
- private static final long serialVersionUID = 2;
-
- private static java.lang.reflect.Method $method_add_0;
- private static java.lang.reflect.Method $method_divide_1;
- private static java.lang.reflect.Method $method_multiply_2;
- private static java.lang.reflect.Method $method_subtract_3;
-
- static {
- try {
- $method_add_0 =
- calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class});
- $method_divide_1 =
- calculator.rmi.OperationsRemote.class.getMethod("divide",
- new java.lang.Class[] {double.class, double.class});
- $method_multiply_2 =
- calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class,
- double.class});
- $method_subtract_3 =
- calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class,
- double.class});
- } catch (java.lang.NoSuchMethodException e) {
- throw new java.lang.NoSuchMethodError("stub class initialization failed");
- }
- }
-
- // constructors
- public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- // methods from remote interfaces
-
- // implementation of add(double, double)
- public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_add_0,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 864055858262779977L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of divide(double, double)
- public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_divide_1,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 8097593626497421928L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of multiply(double, double)
- public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_multiply_2,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -346155016949350695L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of subtract(double, double)
- public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_subtract_3,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -610707357620578750L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java
deleted file mode 100644
index 955e386ad8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.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.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * RMI Remote interface
- */
-public interface OperationsRemote extends Remote {
- double add(double n1, double n2) throws RemoteException;
-
- double subtract(double n1, double n2) throws RemoteException;
-
- double multiply(double n1, double n2) throws RemoteException;
-
- double divide(double n1, double n2) throws RemoteException;
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
deleted file mode 100644
index 565a314d85..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.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.test;
-
-import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
-
-/**
- *
- */
-public class CalculatorNode {
-
- /**
- * @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/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
deleted file mode 100644
index 4015c7bbc2..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
+++ /dev/null
@@ -1,144 +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.test;
-
-import static calculator.dosgi.test.OSGiTestUtils.bundleStatus;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-
-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 org.osgi.framework.ServiceReference;
-
-import calculator.dosgi.CalculatorService;
-import calculator.rmi.OperationsRMIServer;
-
-/**
- *
- */
-public class CalculatorOSGiNodeTestCase {
- private static EquinoxHost host;
- private static BundleContext context;
- private static Bundle calculatorBundle;
- private static OperationsRMIServer rmiServer;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- try {
- rmiServer = new OperationsRMIServer();
- rmiServer.start();
-
- host = new EquinoxHost();
- context = host.start();
-
- for (Bundle b : context.getBundles()) {
- System.out.println(b);
- 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.dynamic".equals(b.getSymbolicName())) {
- calculatorBundle = b;
- }
- }
-
- if (calculatorBundle != null) {
- calculatorBundle.start();
- System.out.println(bundleStatus(calculatorBundle, false));
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @Test
- public void testOSGi() {
- ServiceReference ref =
- calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName());
- Assert.assertNotNull(ref);
- Object service = context.getService(ref);
- Assert.assertNotNull(service);
- CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class);
- System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0));
- System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0));
- System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0));
- System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0));
- }
-
- @Test
- /**
- * Test the Web service exposed by the Calculator
- */
- public void testWS() throws Exception {
- URL url = new URL("http://localhost:8086/CalculatorService?wsdl");
- InputStream is = url.openStream();
- Reader reader = new InputStreamReader(is);
- char[] content = new char[10240]; // 10k
- int len = 0;
- while (true) {
- int size = reader.read(content, len, content.length - len);
- if (size < 0) {
- break;
- }
- len += size;
- }
- Assert.assertTrue(len > 0);
- String str = new String(content, 0, len);
- System.out.println(str);
- Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (host != null) {
- host.stop();
- rmiServer.stop();
- host = null;
- rmiServer = null;
- context = null;
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
deleted file mode 100644
index 99e0da9f97..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/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.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$ $Date$
- */
-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/sandbox/samples/temp/distributed-osgi/dynamic/pom.xml b/sandbox/samples/temp/distributed-osgi/dynamic/pom.xml
deleted file mode 100644
index c3021a3cc5..0000000000
--- a/sandbox/samples/temp/distributed-osgi/dynamic/pom.xml
+++ /dev/null
@@ -1,44 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-samples-distributed-osgi-dynamic</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Distributed OSGI Dynamically Configured Samples</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>dosgi-dynamic-calculator</module>
- <module>dosgi-dynamic-calculator-operations</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/LICENSE b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF
deleted file mode 100644
index 82a803e3a6..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/NOTICE b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/NOTICE
deleted file mode 100644
index 9ddba06a32..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2010 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml
deleted file mode 100644
index 99845257ff..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
deleted file mode 100644
index f6b5f4690e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml
deleted file mode 100644
index 322d4daf2f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
deleted file mode 100644
index b9ca777bd8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
deleted file mode 100644
index fced5b7840..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
deleted file mode 100644
index c7250912b0..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
deleted file mode 100644
index 1472f5a976..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/README b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/README
deleted file mode 100644
index 57126842a4..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/README
+++ /dev/null
@@ -1,185 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
-INFO: Equinox-based service discoverer is now configured.
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-calculator-operations.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Starting calculator.dosgi.operations_1.0.0 [198]
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.AddService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.SubtractService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.MultiplyService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.DivideService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator getB
-undle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.operations
-Nov 4, 2009 9:51:56 AM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: calculator.dosgi.operations domain: tuscany.apache.org
-Nov 4, 2009 9:51:56 AM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadCont
-ributions
-INFO: Loading contribution: bundleentry://198.fwk8152936/
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/AddService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@27845948)Endpoint: URI = OperationsComponent#service-bin
-ding(AddService/AddService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@10576215)Endpoint: URI = OperationsComponent#service-bin
-ding(SubtractService/SubtractService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@31713234)Endpoint: URI = OperationsComponent#service-bin
-ding(MultiplyService/MultiplyService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/DivideService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@10202447)Endpoint: URI = OperationsComponent#service-bin
-ding(DivideService/DivideService)
-
-osgi>
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: calculator.dosgi.operations
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@27845948)Endpoint: URI = OperationsComponent#service-
-binding(AddService/AddService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/AddService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@10576215)Endpoint: URI = OperationsComponent#service-
-binding(SubtractService/SubtractService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@31713234)Endpoint: URI = OperationsComponent#service-
-binding(MultiplyService/MultiplyService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@10202447)Endpoint: URI = OperationsComponent#service-
-binding(DivideService/DivideService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/DivideService
-Nov 4, 2009 9:53:19 AM calculator.dosgi.operations.impl.OperationsActivator stop
-
-INFO: Stopping calculator.dosgi.operations_1.0.0 [198]
-
-osgi>
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-calculator-operations)
-
-
-dosgi-calculator-operations/
- src/
- main/
- java/
- calculator/
- dosgi/
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- impl/
- OperationsActivator.java - OSGi bundle activator
- AddServiceImpl.java - Implementation for Add
- SubtractServiceImpl.java - Implementation for Subtract
- MultiplyServiceImpl.java - Implementation for Multiply
- DivideServiceImpl.java - Implementation for Divide
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca/
- bundle.componentType - The component type for implementation.osgi of this bundle
- bundle.composite - The composite file
- test/
- java/
- src/
- calculator/
- dosgi/
- operations/
- test/
- OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator-operations
-mvn
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/pom.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/pom.xml
deleted file mode 100644
index cf7faab1e8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/pom.xml
+++ /dev/null
@@ -1,148 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator-operations</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Caculator Operations Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </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>${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>
-
- <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>${pom.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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
deleted file mode 100644
index 971500782f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
deleted file mode 100644
index 49b8a1c0bf..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
deleted file mode 100644
index f4e59d12ea..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
deleted file mode 100644
index bfb9b820f7..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
deleted file mode 100644
index 66b2977241..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
deleted file mode 100644
index a3c21b2b96..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
deleted file mode 100644
index 7922d2d392..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
deleted file mode 100644
index da2ce9063a..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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<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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
deleted file mode 100644
index 4bbe83b14f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index d24999ab3e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
deleted file mode 100644
index cd92989da1..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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$ $Date$
- */
-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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
deleted file mode 100644
index 02007c385c..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
deleted file mode 100644
index 49c5aab041..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/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;
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/LICENSE b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/META-INF/MANIFEST.MF b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/META-INF/MANIFEST.MF
deleted file mode 100644
index 542b53b085..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: calculator.dosgi;version="1.0.0",
- calculator.dosgi.operations;version="1.0.0"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi
-Bundle-Activator: calculator.dosgi.impl.CalculatorActivator
-Bundle-ManifestVersion: 2
-Import-Package: org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin,
- org.osgi.util.tracker
-Bundle-SymbolicName: calculator.dosgi
-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/calculator-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/NOTICE b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/NOTICE
deleted file mode 100644
index 9ddba06a32..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2010 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
deleted file mode 100644
index fd834e12ef..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
+++ /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.
--->
-<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
-<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
- <property name="addService" ref="AddService" />
- <property name="subtractService" ref="SubtractService" />
- <property name="multiplyService" ref="MultiplyService" />
- <property name="divideService" ref="DivideService" />
- </component>
-
- <!-- We can derive the SCA services for the implementation.osgi -->
- <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
- </service>
-
- <!-- We can derive the SCA references for the implementation.osgi -->
- <reference id="AddService" interface="calculator.dosgi.operations.AddService">
- </reference>
- <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
- </reference>
- <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
- </reference>
- <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
- </reference>
-
-</components> \ No newline at end of file
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/calculator-component.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/calculator-component.xml
deleted file mode 100644
index 5daaa59aae..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/calculator-component.xml
+++ /dev/null
@@ -1,36 +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="CalculatorComponent"
- xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" />
- <service>
- <provide interface="calculator.dosgi.CalculatorService" />
- </service>
-
- <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
- policy="dynamic" />
- <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
- unbind="unsetSubtractService" policy="dynamic" />
- <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
- unbind="unsetMultiplyService" policy="dynamic" />
- <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
- unbind="unsetDivideService" policy="dynamic" />
-
-</scr:component>
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType
deleted file mode 100644
index 1dff21ab6b..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType
+++ /dev/null
@@ -1,64 +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 view of the OSGi service -->
- <service name="CalculatorService">
- <!-- The interface will be mapped into the OSGi service class -->
- <interface.java interface="calculator.dosgi.CalculatorService"/>
- <!-- The list of OSGi properties -->
- <extensions>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </extensions>
- </service>
-
- <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
- <reference 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>
- </reference>
- <reference 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>
- </reference>
- <reference 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>
- </reference>
- <reference 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>
- </reference>
-
-</componentType>
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite
deleted file mode 100644
index c64e999fc6..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite
+++ /dev/null
@@ -1,45 +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="CalculatorComposite">
-
- <component name="CalculatorComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
- <service name="CalculatorService">
- <binding.ws uri="http://localhost:8086/CalculatorService"/>
- </service>
- <reference name="addService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </reference>
- <reference name="subtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </reference>
- <reference name="multiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </reference>
- <reference name="divideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </reference>
- </component>
-
-</composite>
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/README b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/README
deleted file mode 100644
index e2cf7cd522..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/README
+++ /dev/null
@@ -1,143 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-calculator.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 9:40:00 AM calculator.dosgi.impl.CalculatorActivator start
-INFO: Starting calculator.dosgi_1.0.0 [198]
-Nov 4, 2009 9:40:01 AM calculator.dosgi.impl.CalculatorActivator start
-INFO: Registering calculator.dosgi.CalculatorService
-Nov 4, 2009 9:40:01 AM calculator.dosgi.impl.CalculatorActivator getBundle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi
-Nov 4, 2009 9:40:01 AM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: calculator.dosgi domain: tuscany.apache.org
-Nov 4, 2009 9:40:01 AM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadCont
-ributions
-INFO: Loading contribution: bundleentry://198.fwk15020296/
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Nov 4, 2009 9:40:47 AM org.mortbay.log.Slf4jLog info
-INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
-bay.log.Slf4jLog
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: jetty-6.1.x
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: Started SelectChannelConnector@0.0.0.0:8086
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
-apping
-INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@1277930)Endpoint: URI = CalculatorComponent#service-bind
-ing(CalculatorService/CalculatorService)
-osgi>
-
-You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
-the WSDL.
-
-You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: calculator.dosgi
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@1277930)Endpoint: URI = CalculatorComponent#service-b
-inding(CalculatorService/CalculatorService)
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
-etMapping
-INFO: Removed Servlet mapping: /CalculatorService
-Nov 4, 2009 9:41:22 AM calculator.dosgi.impl.CalculatorActivator stop
-INFO: Stopping calculator.dosgi_1.0.0 [198]
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-calculator-operations)
-
-
-dosgi-calculator/
- src/
- main/
- java/
- calculator/
- dosgi/
- CalculatorService.java - The interface for Calculator service
- impl/
- CalculatorActivator.java - OSGi bundle activator for Calculator bundle
- CalculatorServiceDSImpl.java - OSGi declarative service based implementation
- CalculatorServiceImpl.java - Basic OSGi implementation
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- rmi/
- OperationsRemote.java - RMI remote interface for operations
- OperationsRMIServer_Stub.java - RMI stub
- OperationsRMIServer.java - RMI server implementation of the operations
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca/
- bundle.componentType - The component type for implementation.osgi of this bundle
- bundle.composite - The composite file
- test/
- java/
- src/
- calculator/
- dosgi/
- test/
- CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- dosig-calculator.png - a pictorial representation of the sample
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator
-mvn
-
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/dosgi-calculator.png b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/dosgi-calculator.png
deleted file mode 100644
index 805baa54d2..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/dosgi-calculator.png
+++ /dev/null
Binary files differ
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/pom.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/pom.xml
deleted file mode 100644
index 2e06ff7e05..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/pom.xml
+++ /dev/null
@@ -1,153 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Calculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- <scope>runtime</scope>
- </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>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</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>
-
- </dependencies>
-
- <build>
- <finalName>${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>
-
- <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>${pom.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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
deleted file mode 100644
index cc562b7c2f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
+++ /dev/null
@@ -1,36 +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;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
deleted file mode 100644
index 6b42645f69..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
+++ /dev/null
@@ -1,76 +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.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.CalculatorService;
-import calculator.dosgi.operations.AddService;
-
-/**
- *
- */
-public class CalculatorActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(CalculatorActivator.class.getName());
-
- 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;
- }
-
- public void start(BundleContext context) throws Exception {
- logger.info("Starting " + context.getBundle());
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put("sca.service", "CalculatorComponent#service-name(Calculator)");
- props.put("calculator", "Calculator");
-
- logger.info("Registering " + CalculatorService.class.getName());
- CalculatorService calculator = new CalculatorServiceImpl(context);
- context.registerService(CalculatorService.class.getName(), calculator, props);
-
- getBundle(context, AddService.class);
-
- }
-
- public void stop(BundleContext context) throws Exception {
- logger.info("Stopping " + context.getBundle());
- // Registered services will be automatically unregistered
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
deleted file mode 100644
index 5f9db16ca9..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
+++ /dev/null
@@ -1,114 +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.impl;
-
-import org.osgi.service.component.ComponentContext;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceDSImpl implements CalculatorService {
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- public CalculatorServiceDSImpl() {
- super();
- System.out.println("CalculatorServiceDSImpl()");
- }
-
- protected void activate(ComponentContext context) {
- System.out.println("Activating " + context);
- }
-
- protected void deactivate(ComponentContext context) {
- System.out.println("Deactivating " + context);
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void setAddService(AddService addService) {
- System.out.println("setAddService()");
- this.addService = addService;
- }
-
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void unsetAddService(AddService addService) {
- System.out.println("unsetAddService()");
- this.addService = null;
- }
-
- public void unsetSubtractService(SubtractService subtractService) {
- this.subtractService = null;
- }
-
- public void unsetDivideService(DivideService divideService) {
- this.divideService = null;
- }
-
- public void unsetMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = null;
- }
- private <T> T getService(Class<T> cls) {
- for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) {
- if (cls.isInstance(s)) {
- return cls.cast(s);
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
deleted file mode 100644
index a9ea37585a..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.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.impl;
-
-import static org.osgi.framework.Constants.OBJECTCLASS;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
- private ServiceTracker remoteServices;
- private ServiceTracker localServices;
-
- public CalculatorServiceImpl() {
- super();
- }
-
- public CalculatorServiceImpl(BundleContext context) {
- super();
- Filter remoteFilter = null, localFilter = null;
- try {
- remoteFilter =
- context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))");
- localFilter =
- context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))");
- } catch (InvalidSyntaxException e) {
- e.printStackTrace();
- }
- this.remoteServices = new ServiceTracker(context, remoteFilter, null);
- remoteServices.open();
- this.localServices = new ServiceTracker(context, localFilter, null);
- localServices.open();
- }
-
- private <T> T getService(Class<T> cls) {
- try {
- // Wait for 10 seconds until the remote services are imported
- remoteServices.waitForService(10000);
- } catch (InterruptedException e) {
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
- Object[] remoteObjects = remoteServices.getServices();
- if (remoteObjects != null) {
- for (Object s : remoteObjects) {
- if (cls.isInstance(s)) {
- System.out.println("Remote service: " + s);
- return cls.cast(s);
- }
- }
- }
- Object[] localObjects = localServices.getServices();
- if (localObjects != null) {
- for (Object s : localObjects) {
- if (cls.isInstance(s)) {
- System.out.println("Local service: " + s);
- return cls.cast(s);
- }
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
deleted file mode 100644
index 971500782f..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
deleted file mode 100644
index 49b8a1c0bf..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
deleted file mode 100644
index f4e59d12ea..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
deleted file mode 100644
index bfb9b820f7..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
deleted file mode 100644
index a4fc52694e..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
+++ /dev/null
@@ -1,93 +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.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- *
- */
-public class OperationsRMIServer implements OperationsRemote, Serializable {
-
- private static final long serialVersionUID = 6081008315263103012L;
- private transient Registry registry;
-
- public OperationsRMIServer() throws RemoteException {
- super();
- }
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
- public void start() throws RemoteException {
- Thread thread = new Thread() {
- public void run() {
- try {
- System.out.println("Starting the RMI server for calculator operations...");
- Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this);
- registry = LocateRegistry.createRegistry(8085);
- registry.bind("AddService", stub);
- registry.bind("SubtractService", stub);
- registry.bind("MultiplyService", stub);
- registry.bind("DivideService", stub);
- System.out.println("RMI server for calculator operations is now started.");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- };
- thread.start();
- }
-
- public void stop() {
- if (registry != null) {
- try {
- registry.unbind("AddService");
- registry.unbind("SubtractService");
- registry.unbind("MultiplyService");
- registry.unbind("DivideService");
- UnicastRemoteObject.unexportObject(this, false);
- UnicastRemoteObject.unexportObject(registry, false);
- registry = null;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
deleted file mode 100644
index a813dfb6f3..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
+++ /dev/null
@@ -1,132 +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.
- */
-
-// Stub class generated by rmic, do not edit.
-// Contents subject to change without notice.
-package calculator.rmi;
-
-public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote {
- private static final long serialVersionUID = 2;
-
- private static java.lang.reflect.Method $method_add_0;
- private static java.lang.reflect.Method $method_divide_1;
- private static java.lang.reflect.Method $method_multiply_2;
- private static java.lang.reflect.Method $method_subtract_3;
-
- static {
- try {
- $method_add_0 =
- calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class});
- $method_divide_1 =
- calculator.rmi.OperationsRemote.class.getMethod("divide",
- new java.lang.Class[] {double.class, double.class});
- $method_multiply_2 =
- calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class,
- double.class});
- $method_subtract_3 =
- calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class,
- double.class});
- } catch (java.lang.NoSuchMethodException e) {
- throw new java.lang.NoSuchMethodError("stub class initialization failed");
- }
- }
-
- // constructors
- public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- // methods from remote interfaces
-
- // implementation of add(double, double)
- public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_add_0,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 864055858262779977L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of divide(double, double)
- public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_divide_1,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 8097593626497421928L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of multiply(double, double)
- public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_multiply_2,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -346155016949350695L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of subtract(double, double)
- public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_subtract_3,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -610707357620578750L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
deleted file mode 100644
index 955e386ad8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.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.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * RMI Remote interface
- */
-public interface OperationsRemote extends Remote {
- double add(double n1, double n2) throws RemoteException;
-
- double subtract(double n1, double n2) throws RemoteException;
-
- double multiply(double n1, double n2) throws RemoteException;
-
- double divide(double n1, double n2) throws RemoteException;
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index b48c048000..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,24 +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:CalculatorComposite" />
-</contribution>
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
deleted file mode 100644
index 565a314d85..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.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.test;
-
-import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
-
-/**
- *
- */
-public class CalculatorNode {
-
- /**
- * @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/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
deleted file mode 100644
index 2f37da0707..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
+++ /dev/null
@@ -1,152 +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.test;
-
-import static calculator.dosgi.test.OSGiTestUtils.bundleStatus;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-
-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 org.osgi.framework.ServiceReference;
-
-import calculator.dosgi.CalculatorService;
-import calculator.rmi.OperationsRMIServer;
-
-/**
- *
- */
-public class CalculatorOSGiNodeTestCase {
- private static EquinoxHost host;
- private static BundleContext context;
- private static Bundle calculatorBundle;
- private static OperationsRMIServer rmiServer;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- try {
- rmiServer = new OperationsRMIServer();
- rmiServer.start();
-
- host = new EquinoxHost();
- context = host.start();
-
- for (Bundle b : context.getBundles()) {
- System.out.println(b);
- // debug to print out exported packages
- // handy if you want to find aplit packages
- //Object exports = b.getHeaders().get(Constants.EXPORT_PACKAGE);
- //if (exports != null){
- // System.out.println(exports.toString());
- //}
- 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));
- } else {
- System.out.println(bundleStatus(b, false));
- }
- if ("calculator.dosgi".equals(b.getSymbolicName())) {
- calculatorBundle = b;
- }
- }
-
- if (calculatorBundle != null) {
- calculatorBundle.start();
- System.out.println(bundleStatus(calculatorBundle, false));
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @Test
- public void testOSGi() {
- ServiceReference ref =
- calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName());
- Assert.assertNotNull(ref);
- Object service = context.getService(ref);
- Assert.assertNotNull(service);
- CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class);
- System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0));
- System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0));
- System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0));
- System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0));
- }
-
- @Test
- /**
- * Test the Web service exposed by the Calculator
- */
- public void testWS() throws Exception {
- URL url = new URL("http://localhost:8086/CalculatorService?wsdl");
- InputStream is = url.openStream();
- Reader reader = new InputStreamReader(is);
- char[] content = new char[10240]; // 10k
- int len = 0;
- while (true) {
- int size = reader.read(content, len, content.length - len);
- if (size < 0) {
- break;
- }
- len += size;
- }
- Assert.assertTrue(len > 0);
- String str = new String(content, 0, len);
- System.out.println(str);
- Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (host != null) {
- host.stop();
- rmiServer.stop();
- host = null;
- rmiServer = null;
- context = null;
- }
- }
-
-}
diff --git a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
deleted file mode 100644
index 99e0da9f97..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/dosgi-calculator/src/test/java/calculator/dosgi/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.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$ $Date$
- */
-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/sandbox/samples/temp/distributed-osgi/implementation.osgi/pom.xml b/sandbox/samples/temp/distributed-osgi/implementation.osgi/pom.xml
deleted file mode 100644
index 56d975dea8..0000000000
--- a/sandbox/samples/temp/distributed-osgi/implementation.osgi/pom.xml
+++ /dev/null
@@ -1,44 +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</groupId>
- <artifactId>tuscany-samples</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>dosgi-calculator</module>
- <module>dosgi-calculator-operations</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/sandbox/samples/temp/distributed-osgi/pom.xml b/sandbox/samples/temp/distributed-osgi/pom.xml
deleted file mode 100644
index 52fc787d75..0000000000
--- a/sandbox/samples/temp/distributed-osgi/pom.xml
+++ /dev/null
@@ -1,44 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-samples-distributed-osgi</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Distributed OSGI Samples</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>implementation.osgi</module>
- <module>dynamic</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/README b/sandbox/samples/temp/helloworld-ws-sdo/README
deleted file mode 100644
index be947b1923..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/README
+++ /dev/null
@@ -1,214 +0,0 @@
-Hello World Web Service References using SDO Sample
-===================================================
-This sample demonstrates an SCA reference that uses a web service binding which works with SDO.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-To run this sample
-------------------
-This sample is dependent on helloworld-ws-service. Open a command prompt to start
-the service. If you are running ant do the following:
-
-cd helloworld-ws-service
-ant run
-
-if you don't have ant, issue one of the following commands for windows or *nix:
-
-java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-helloworld-ws-service.jar helloworld.HelloWorldServer
-
-and on *nix do
-
-java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-helloworld-ws-service.jar helloworld.HelloWorldServer
-
-You should see the following output:
-
-Buildfile: build.xml
-
-run-server:
- [java] log4j:WARN No appenders could be found for logger (org.apache.axiom.
-om.util.StAXUtils).
- [java] log4j:WARN Please initialize the log4j system properly.
- [java] Aug 24, 2007 11:17:33 AM org.apache.catalina.core.StandardEngine sta
-rt
- [java] INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.ContextConfig d
-efaultWebConfig
- [java] INFO: No default web.xml
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory
- register
- [java] WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.
-xsd
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory
- register
- [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt
-aglibrary_1_1.dtd
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory
- register
- [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt
-aglibrary_1_2.dtd
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory
- register
- [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt
-aglibrary_2_0.xsd
- [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory
- register
- [java] WARNING: Could not get url for /javax/servlet/resources/j2ee_web_ser
-vices_1_1.xsd
- [java] Aug 24, 2007 11:17:34 AM org.apache.coyote.http11.Http11Protocol ini
-t
- [java] INFO: Initializing Coyote HTTP/1.1 on http-8085
- [java] Aug 24, 2007 11:17:34 AM org.apache.coyote.http11.Http11Protocol sta
-rt
- [java] INFO: Starting Coyote HTTP/1.1 on http-8085
- [java] Aug 24, 2007 11:17:34 AM org.apache.tuscany.sca.http.tomcat.TomcatSe
-rver addServletMapping
- [java] INFO: Added Servlet mapping: http://localhost:8085/HelloWorldService
-
- [java] HelloWorld server started (press enter to shutdown)
-
-The server is now ready.
-
-
-Now, open another command window to run the client.
-
-cd helloworld-ws-sdo
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-helloworld-ws-sdo.jar helloworld.HelloWorldClient
-
-and on *nix do
-
-java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-helloworld-ws-sdo.jar helloworl.HelloWorldClient
-
-You should be able to see the following result:
-
-Buildfile: build.xml
-
-run:
- [java] log4j:WARN No appenders could be found for logger (org.apache.axiom.
-om.util.StAXUtils).
- [java] log4j:WARN Please initialize the log4j system properly.
- [java] Injected helloWorldService
- [java] Called getGreetings
- [java] Hello David Haney
-
-BUILD SUCCESSFUL
-Total time: 9 seconds
-
-
-Sample Overview
----------------
-The sample provides a single component that is wired to a reference with a
-web service binding. The binding refers to WSDL that identifies the service
-exposed by the helloworld-ws-service sample.
-
-helloworld-ws-sdo/
- src/
- main/
- java/
- helloworld/
- HelloWorldService.java - interface description for
- HelloWorldServiceComponent
- HelloWorldServiceComponent.java - component implementation
- HelloWorldClient.java - starts the SCA Runtime and
- deploys the helloworldwsclient
- .composite. It then calls the
- HelloWorldServiceComponent
- resources/
- wsdl
- helloworld.wsdl - the service description that the
- SCA reference uses to bind to service.
-
- test/
- java/
- helloworld/
- HelloWorldClientTestCase.java - JUnit test case
- helloworld-ws-sdo.png - a pictorial representation of the
- sample .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-You can build and run the sample with the binary distribution using Ant.
-Make sure that you have started helloworld-ws-service which this sample is dependent on
-in a separate command window. You can either follow the instruction at the begining of this
-sample file or if you want to build and run the service, follow the README under helloworld-ws-service.
-
-Now, let's build and run helloworld-ws-sdo sample:
-
-cd helloworld-ws-sdo
-ant
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] log4j:WARN No appenders could be found for logger (org.apache.axiom.
-om.util.StAXUtils).
- [java] log4j:WARN Please initialize the log4j system properly.
- [java] Injected helloWorldService
- [java] Called getGreetings
- [java] Hello World
-
-Building And Running The Sample Using Maven
--------------------------------------------
-You can build and run the sample with either the binary or source distributions using Maven. Please note that you do not need to start helloworld-ws-service in this case since Maven does this for you.
-
-cd helloworld-ws-sdo
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running helloworld.HelloWorldClientTestCase
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Aug 23, 2007 2:27:32 PM org.apache.catalina.core.StandardEngine start
-INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.ContextConfig defaultWebConf
-ig
-INFO: No default web.xml
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register
-WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.xsd
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register
-WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_
-1.dtd
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register
-WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_
-2.dtd
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register
-WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_
-0.xsd
-Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register
-WARNING: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xs
-d
-Aug 23, 2007 2:27:32 PM org.apache.coyote.http11.Http11Protocol init
-INFO: Initializing Coyote HTTP/1.1 on http-8085
-Aug 23, 2007 2:27:32 PM org.apache.coyote.http11.Http11Protocol start
-INFO: Starting Coyote HTTP/1.1 on http-8085
-Aug 23, 2007 2:27:32 PM org.apache.tuscany.sca.http.tomcat.TomcatServer addServl
-etMapping
-INFO: Added Servlet mapping: http://localhost:8085/HelloWorldService
-Injected helloWorldService
-Called getGreetings
-Aug 23, 2007 2:27:34 PM org.apache.coyote.http11.Http11Protocol destroy
-INFO: Stopping Coyote HTTP/1.1 on http-8085
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.502 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-
-This shows that the Junit test cases have run successfully.
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/build.xml b/sandbox/samples/temp/helloworld-ws-sdo/build.xml
deleted file mode 100644
index 401315d424..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/build.xml
+++ /dev/null
@@ -1,101 +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.
--->
-<project name="helloworld-ws-sdo" default="compile" basedir=".">
- <property file="${user.home}/tuscany/build.properties" />
- <property file="${user.home}/build.properties" />
-
- <property name="server.class" value="helloworld.HelloWorldServer" />
- <property name="client.class" value="helloworld.HelloWorldClient" />
- <property name="test.jar" value="sample-helloworld-ws-sdo.jar" />
-
- <property name="tuscany.sca.manifest.location" value="../../lib/tuscany-sca-manifest.jar"/>
-
- <target name="init">
- <mkdir dir="target/classes"/>
- <mkdir dir="target/sdo-source"/>
- </target>
-
- <path id="project.classpath">
- <pathelement path="target/classes"/>
- <pathelement path="target/sdo-source"/>
- <pathelement location="${tuscany.sca.manifest.location}"/>
- </path>
-
- <target name="generate-sdo" depends="init">
- <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
- <arg value="-targetDirectory"/>
- <arg value="target/sdo-source"/>
- <arg value="-javaPackage"/>
- <arg value="helloworld"/>
- <arg value="-prefix"/>
- <arg value="Helloworld"/>
- <arg value="-noNotification"/>
- <arg value="-noContainment"/>
- <arg value="-noUnsettable"/>
- <arg value="src/main/resources/wsdl/helloworld.wsdl"/>
-
- <classpath refid="project.classpath"/>
- </java>
- </target>
-
- <target name="compile" depends="init, generate-sdo">
- <javac destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5">
- <src location="src/main/java"/>
- <src location="target/sdo-source"/>
- <classpath refid="project.classpath"/>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- <fileset dir="target/sdo-source"/>
- </copy>
- <jar destfile="target/${test.jar}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${test.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run-classes">
- <java classname="${client.class}" fork="true">
- <classpath refid="project.classpath"/> </java>
- </target>
-
- <target name="run-server">
- <java classname="${server.class}" fork="true">
- <classpath path="target/${test.jar}"/>
- <classpath refid="project.classpath"/>
- </java>
- </target>
-
- <target name="run">
- <java classname="${client.class}" fork="true">
- <classpath path="target/${test.jar}"/>
- <classpath refid="project.classpath"/>
- </java>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/helloworld-ws-sdo.png b/sandbox/samples/temp/helloworld-ws-sdo/helloworld-ws-sdo.png
deleted file mode 100644
index bd2bba41db..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/helloworld-ws-sdo.png
+++ /dev/null
Binary files differ
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/maven-eclipse.xml b/sandbox/samples/temp/helloworld-ws-sdo/maven-eclipse.xml
deleted file mode 100644
index 3adfca89f4..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/maven-eclipse.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<project default="copy-resources">
- <target name="init"/>
- <target name="copy-resources" depends="init">
- <copy todir="target/classes/META-INF" filtering="true">
- <fileset dir="." includes="LICENSE|NOTICE" excludes="**/*.java"/>
- </copy>
- </target>
-</project> \ No newline at end of file
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/pom.xml b/sandbox/samples/temp/helloworld-ws-sdo/pom.xml
deleted file mode 100644
index c5bf5ff186..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/pom.xml
+++ /dev/null
@@ -1,180 +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</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>sample-helloworld-ws-sdo</artifactId>
- <name>Apache Tuscany SCA Sample HelloWorld Web Service SDO</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-lib</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
-
- <plugins>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/sdo-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>generate-helloworld-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/wsdl/helloworld.wsdl</schemaFile>
- <javaPackage>helloworld</javaPackage>
- <prefix>Helloworld</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-helloworld-sdo1</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/test.xsd</schemaFile>
- <javaPackage>model.sdo</javaPackage>
- <prefix>Entity</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java
deleted file mode 100644
index ebc270811f..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java
+++ /dev/null
@@ -1,51 +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 helloworld;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * This client program shows how to create an SCA runtime, start it, locate the
- * HelloWorld service and invoke it.
- */
-public class HelloWorldClient {
-
- public final static void main(String[] args) throws Exception {
-
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldClient.class);
- Node node =
- factory.createNode("helloworldwsclient.composite", new Contribution("helloworld", contribution)).start();
-
- HelloWorldService helloWorldService = node.getService(HelloWorldService.class, "HelloWorldServiceComponent");
-
- Name name = HelloworldFactory.INSTANCE.createName();
-
- name.setFirst("David");
- name.setLast("Haney");
-
- String value = helloWorldService.getGreetings(name);
- System.out.println(value);
-
- node.stop();
- }
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java
deleted file mode 100644
index c42a4d59c3..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java
+++ /dev/null
@@ -1,33 +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 helloworld;
-
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements the HelloWorld service.
- */
-@Service(HelloWorldService.class)
-public class HelloWorldImpl implements HelloWorldService {
-
- public String getGreetings(Name name) {
- return "Hello " + name.getFirst() + " " + name.getLast();
- }
-
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java
deleted file mode 100644
index ff5cb4ceda..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java
+++ /dev/null
@@ -1,51 +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 helloworld;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * This server program shows how to create an SCA runtime, and start it which
- * activates the helloworld Web service endpoint.
- */
-public class HelloWorldServer {
-
- public static void main(String[] args) {
-
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldServer.class);
- Node node = factory.createNode("helloworldws.composite", new Contribution("helloworld", contribution)).start();
-
- try {
- System.out.println("HelloWorld server started (press enter to shutdown)");
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- node.stop();
- System.out.println("HelloWorld server stopped");
- }
-
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java
deleted file mode 100644
index fa257a0605..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java
+++ /dev/null
@@ -1,34 +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 helloworld;
-
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the helloworld service
- */
-@Remotable
-public interface HelloWorldService {
- @RequestWrapper(className="helloworld.getGreetings")
- @ResponseWrapper(className="helloworld.getGreetingsResponse")
- public String getGreetings(Name name);
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java
deleted file mode 100644
index 711eef63b5..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java
+++ /dev/null
@@ -1,42 +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 helloworld;
-
-/**
- * The HelloWorld service implementation
- */
-public class HelloWorldServiceComponent implements HelloWorldService {
-
- HelloWorldService helloWorldService;
-
- public String getGreetings(Name name) {
- System.out.println("Called getGreetings");
- return helloWorldService.getGreetings(name);
- }
-
- public HelloWorldService getHelloWorldService() {
- System.out.println("Got Injected helloWorldService");
- return helloWorldService;
- }
-
- public void setHelloWorldService(HelloWorldService helloWorldService) {
- System.out.println("Injected helloWorldService");
- this.helloWorldService = helloWorldService;
- }
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java
deleted file mode 100644
index d222d77b3b..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java
+++ /dev/null
@@ -1,59 +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 services.bcircle;
-
-import model.sdo.EntityFactory;
-import model.sdo.Laboratory;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public class BioTestCase {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- BiochemicalCircle biochemicalCircl = new BiochemicalCircleImpl();
- Laboratory lab2 = biochemicalCircl.getLaboratory("Lab2"); //This invocation without use SCA works ok.
-
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(BioTestCase.class);
- Node node =
- factory.createNode("resources/clinicalLaboratory.composite", new Contribution("clinical", contribution))
- .start();
-
- BiochemicalCircle biochemicalCircle = node.getService(BiochemicalCircle.class, "BiochemicalCircleComponent");
-
- Laboratory lab = EntityFactory.INSTANCE.createLaboratory();
- lab.setName("lab2");
- biochemicalCircle.setLaboratory(lab); // this invocation works ok too
-
- lab = biochemicalCircle.getLaboratory("Lab2"); // here I have an exception posted below.
-
- //here I wait a moment before close scaDomain
- System.out.println(lab.getName());
-
- node.stop();
-
- }
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java
deleted file mode 100644
index a988a4156c..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java
+++ /dev/null
@@ -1,29 +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 services.bcircle;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface BiochemicalCircle {
- void setLaboratory(model.sdo.Laboratory lab);
-
- model.sdo.Laboratory getLaboratory(String name);
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java b/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java
deleted file mode 100644
index b609f58373..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java
+++ /dev/null
@@ -1,40 +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 services.bcircle;
-import model.sdo.EntityFactory;
-import model.sdo.Laboratory;
-
-import org.oasisopen.sca.annotation.Service;
-
-
-@Service(BiochemicalCircle.class)
-public class BiochemicalCircleImpl implements BiochemicalCircle{
- public Laboratory getLaboratory(String name) {
-
- Laboratory lab = EntityFactory.INSTANCE.createLaboratory();
- lab.setName("Main Laboratory");
- return lab;
- }
-
- public void setLaboratory(Laboratory lab) {
- //sad method
- System.out.println(lab.getName());
- }
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index f8b2a60f6a..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,28 +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:hw="http://helloworld"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <deployable composite="hw:helloworldws"/>
-
- <tuscany:sdo.types namespace="http://helloworld" location="wsdl/helloworld.wsdl"/>
-
-</contribution>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldws.composite b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldws.composite
deleted file mode 100644
index 46c819d08c..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldws.composite
+++ /dev/null
@@ -1,31 +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" targetNamespace="http://helloworld"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/1.1" xmlns:hw="http://helloworld"
- name="helloworldws">
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="helloworld.HelloWorldImpl" />
- <service name="HelloWorldService">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService" />
- </service>
- </component>
-</composite>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite
deleted file mode 100644
index 65b0e294a8..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite
+++ /dev/null
@@ -1,34 +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" targetNamespace="http://helloworld"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/1.1" xmlns:hw="http://helloworld"
- name="helloworldwsclient">
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="helloworld.HelloWorldServiceComponent" />
- <reference name="helloWorldService">
- <interface.java interface="helloworld.HelloWorldService" />
- <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </reference>
- </component>
-
-
-
-</composite>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/logging.properties b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/logging.properties
deleted file mode 100644
index 3dca310cdb..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/logging.properties
+++ /dev/null
@@ -1,30 +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.
-#
-# $Rev$ $Date$
-#
-
-# Custom logging configuration for Tuscany samples
-# By default, only INFO level logging is enabled and ALL messages get sent to the console
-# For more messages from the runtime, uncomment specific settings at the end of this file
-handlers = java.util.logging.ConsoleHandler
-java.util.logging.ConsoleHandler.level = ALL
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-.level=INFO
-
-# Uncomment the next setting to get all Tuscany messages (this will be a lot)
-#org.apache.tuscany.level=FINEST
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite
deleted file mode 100644
index 0451cee24c..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite
+++ /dev/null
@@ -1,34 +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.
--->
-<sca:composite xmlns:federation="http://eclipse.org/SCAExample1/src/resources/federation"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="clinicalLaboratory"
- targetNamespace="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory">
-
- <sca:component name="BiochemicalCircleComponent">
- <sca:implementation.java class="services.bcircle.BiochemicalCircleImpl" />
- <sca:service name="BiochemicalCircle">
- <sca:interface.java interface="services.bcircle.BiochemicalCircle" />
- <sca:binding.ws uri="http://localhost:8080/SCA1/MyServiceComponent" />
- </sca:service>
- </sca:component>
- <!--
- <sca:service name="BiochemicalCircle" promote="BiochemicalCircleComponent/BiochemicalCircle" />
- -->
-</sca:composite>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/test.xsd b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/test.xsd
deleted file mode 100644
index 7fd9aa0013..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/test.xsd
+++ /dev/null
@@ -1,35 +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.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"
- xmlns:tns="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"
- elementFormDefault="qualified">
- <complexType name="Practice">
- <sequence>
- <element name="name" type="string" />
- </sequence>
- </complexType>
- <complexType name="Laboratory">
- <sequence>
- <element name="name" type="string" />
- <element name="practices" type="tns:Practice" maxOccurs="unbounded" />
- </sequence>
- </complexType>
-</schema>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl b/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl
deleted file mode 100644
index 882819110f..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl
+++ /dev/null
@@ -1,88 +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.
--->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="tns:Name" />
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="xsd:string" />
- </sequence>
- </complexType>
- </element>
-
- <complexType name="Name">
- <sequence>
- <element name="first" type="xsd:string" />
- <element name="last" type="xsd:string" />
- </sequence>
- </complexType>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address location="http://localhost:8085/HelloWorldService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java b/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java
deleted file mode 100644
index 3918f9a4a5..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java
+++ /dev/null
@@ -1,85 +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 helloworld;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test case for helloworld web service client
- */
-public class HelloWorldClientTestCase {
-
- private HelloWorldService helloWorldService;
- private static Node node;
-
- private TestCaseRunner server;
-
- @Before
- public void startClient() throws Exception {
- try {
-
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldClient.class);
- node =
- factory.createNode("helloworldwsclient.composite", new Contribution("helloworld", contribution))
- .start();
-
- helloWorldService = node.getService(HelloWorldService.class, "HelloWorldServiceComponent");
-
- server = new TestCaseRunner(HelloWorldTestServer.class);
- server.before();
-
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testWSClient() throws Exception {
- Name name = HelloworldFactory.INSTANCE.createName();
- name.setFirst("John");
- name.setLast("Smith");
- String msg = helloWorldService.getGreetings(name);
- Assert.assertEquals("Hello John Smith", msg);
- }
-
- @After
- public void stopClient() throws Exception {
- server.after();
- node.stop();
- }
-
- public static void main(String[] args) throws Exception {
- HelloWorldClientTestCase test = new HelloWorldClientTestCase();
- test.startClient();
- test.testWSClient();
-
- System.in.read();
- }
-
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java b/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java
deleted file mode 100644
index 98487ad88b..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java
+++ /dev/null
@@ -1,67 +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 helloworld;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Starts up the SCA runtime which starts listening for service requests
- */
-public class HelloWorldTestServer {
-
- private Node node;
-
- @Before
- public void startServer() throws Exception {
- try {
-
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldService.class);
- node = factory.createNode("helloworldws.composite", new Contribution("helloworld", contribution)).start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testPing() throws IOException {
- new Socket("127.0.0.1", 8085);
- }
-
- @After
- public void stopServer() throws Exception {
- node.stop();
- }
-
- public static void main(String[] args) throws Exception {
-
- HelloWorldTestServer test = new HelloWorldTestServer();
- test.startServer();
- }
-
-}
diff --git a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java b/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java
deleted file mode 100644
index b6b4ed2254..0000000000
--- a/sandbox/samples/temp/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java
+++ /dev/null
@@ -1,329 +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 helloworld;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader.
- *
- * @version $Rev$ $Date$
- */
-public class TestCaseRunner {
-
- private ClassLoader classLoader;
- private Class<?> testSuiteClass;
- private Object testSuite;
- private Class<?> testResultClass;
- private Class<?> testCaseClass;
- private Object testCase;
-
- private Class<?> beforeAnnotation;
- private Class<?> beforeClassAnnotation;
- private Class<?> afterAnnotation;
- private Class<?> afterClassAnnotation;
- private Class<?> junit4AdapterClass;
- private Class<?> junit3TestCaseClass;
-
- /**
- * Constructs a new TestCase runner.
- *
- * @param testClass
- */
- public TestCaseRunner(Class<?> testClass, String... isolatedClasses) {
- try {
- ClassLoader tccl = setupClassLoader(testClass, isolatedClasses);
-
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- testCaseClass = Class.forName(testClass.getName(), true, classLoader);
- testCase = testCaseClass.newInstance();
- ClassLoader testClassLoader = testCaseClass.getClassLoader();
-
- junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader);
-
- testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader);
- Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class);
- testSuite = testSuiteConstructor.newInstance(testCaseClass);
-
- testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader);
-
- try {
- beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader);
- afterAnnotation = Class.forName("org.junit.After", true, testClassLoader);
- beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader);
- afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader);
- junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader);
- } catch (Exception e) {
- // Unexpected
- throw new AssertionError(e);
- }
- } catch (Throwable e) {
- e.printStackTrace();
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private ClassLoader setupClassLoader(Class<?> testClass, String... isolatedClasses) {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- classLoader = testClass.getClassLoader();
- if (classLoader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader)classLoader).getURLs();
- classLoader = new ClassLoaderImpl(urls, classLoader, isolatedClasses);
- } else if (classLoader == tccl || classLoader.getParent() == tccl) {
- classLoader = new URLClassLoader(new URL[0], classLoader);
- } else {
- classLoader = tccl;
- }
- return tccl;
- }
-
- /**
- * Run the test case
- */
- public void run() {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) {
- Object testResult = testResultClass.newInstance();
- Method runMethod = testSuiteClass.getMethod("run", testResultClass);
- runMethod.invoke(testSuite, testResult);
- } else {
- Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass);
- Object testResult = testResultClass.newInstance();
- Method runMethod = junit4AdapterClass.getMethod("run", testResultClass);
- runMethod.invoke(junit4Adapter, testResult);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
- /**
- * Invoke the setUp method
- */
- public void setUp() {
- execute("setUp");
- }
-
- /**
- * Invoke the before methods
- */
- public void before() {
- execute(beforeAnnotation);
- }
-
- /**
- * Invoke the beforeClass methods
- */
- public void beforeClass() {
- execute(beforeClassAnnotation);
- }
-
- /**
- * Invoke the tearDown method
- */
- public void tearDown() {
- execute("tearDown");
- }
-
- /**
- * Invoke the after methods
- */
- public void after() {
- execute(afterAnnotation);
- }
-
- /**
- * Invoke the afterClass methods
- */
- public void afterClass() {
- execute(afterClassAnnotation);
- }
-
- /**
- * Invoke the specified test method.
- */
- public void run(String methodName) {
- execute(methodName);
- }
-
- /**
- * Invoke the methods annotated with the specified annotation.
- */
- private void execute(Class<?> annotationClass) {
- if (annotationClass == null) {
- throw new RuntimeException(new NoSuchMethodException());
- }
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- for (Method method : testCaseClass.getDeclaredMethods()) {
- for (Annotation annotation : method.getAnnotations()) {
- if (annotation.annotationType() == annotationClass) {
- method.invoke(testCase);
- }
- }
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
- /**
- * Invoke the specified method
- */
- private void execute(String methodName) {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
- Method setUpMethod = testCaseClass.getDeclaredMethod(methodName);
- setUpMethod.setAccessible(true);
- setUpMethod.invoke(testCase);
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
- public static class ClassLoaderImpl extends URLClassLoader {
- private Set<String> isolatedClasses = new HashSet<String>();
-
- /**
- * @param urls
- * @param parent
- */
- public ClassLoaderImpl(URL[] urls, ClassLoader parent, String... sharedClasses) {
- super(urls, parent);
- this.isolatedClasses.addAll(Arrays.asList(sharedClasses));
- }
-
- @Override
- protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
- if (!isolatedClasses.contains(name)) {
- return super.loadClass(name, resolve);
- } else {
- Class<?> cls = findLoadedClass(name);
- if (cls == null) {
- cls = findClass(name);
- }
- if (resolve) {
- resolveClass(cls);
- }
- return cls;
- }
- }
-
- }
-
-}