diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi')
31 files changed, 2132 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/.ruleset b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/.ruleset new file mode 100644 index 0000000000..3886f07f2d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/.ruleset @@ -0,0 +1,190 @@ +<?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. +--> +<ruleset name="pmd-eclipse"> + <description>PMD Plugin preferences rule set</description> + + + <rule ref="rulesets/basic.xml/BooleanInstantiation"/> + <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/> + <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/> +<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>--> +<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>--> +<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>--> + <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/> +<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>--> +<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>--> +<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>--> +<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>--> +<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>--> + <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/> + <rule ref="rulesets/basic.xml/JumbledIncrementer"/> +<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>--> + <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/> + <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/> + <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/> + <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/> + <rule ref="rulesets/basic.xml/UnnecessaryReturn"/> +<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>--> + +<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>--> +<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>--> +<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>--> +<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>--> + +<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>--> +<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>--> +<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>--> + +<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>--> +<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>--> +<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>--> +<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>--> +<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>--> +<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>--> + +<rule ref="rulesets/controversial.xml/AssignmentInOperand"/> +<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>--> +<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>--> +<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>--> +<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>--> +<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>--> +<!--<rule ref="rulesets/controversial.xml/SingularField"/>--> +<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>--> +<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>--> +<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/> +<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>--> + +<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>--> +<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>--> +<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>--> + +<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>--> +<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>--> +<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>--> +<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>--> +<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>--> +<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/> +<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>--> +<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>--> +<!--<rule ref="rulesets/design.xml/BadComparison"/>--> +<!--<rule ref="rulesets/design.xml/CloseConnection"/>--> +<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>--> +<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>--> +<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/> +<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>--> +<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>--> +<rule ref="rulesets/design.xml/IdempotentOperations"/> +<!--<rule ref="rulesets/design.xml/ImmutableField"/>--> +<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>--> +<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>--> +<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>--> +<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>--> +<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>--> +<rule ref="rulesets/design.xml/OptimizableToArrayCall"/> +<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/> +<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/> +<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/> +<rule ref="rulesets/design.xml/SimplifyConditional"/> +<!--<rule ref="rulesets/design.xml/SwitchDensity"/>--> +<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>--> +<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/> +<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>--> +<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>--> +<!--<rule ref="rulesets/design.xml/UseSingleton"/>--> + +<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>--> +<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>--> +<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>--> +<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>--> +<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>--> +<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>--> + +<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>--> +<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>--> +<!--<rule ref="rulesets/imports.xml/UnusedImports"/>--> +<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>--> + +<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>--> +<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>--> + +<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>--> +<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>--> +<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>--> +<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>--> +<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>--> +<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>--> +<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>--> +<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>--> + + <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>--> + <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>--> + <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>--> + <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>--> + <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>--> + <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>--> + <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>--> + <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>--> + + <!--<rule ref="rulesets/naming.xml/ShortVariable"/>--> + <!--<rule ref="rulesets/naming.xml/LongVariable"/>--> + <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>--> + <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>--> + <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>--> + <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>--> + <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>--> + <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>--> + <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>--> + <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>--> + <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>--> + <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>--> + <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>--> + <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>--> + <!--<rule ref="rulesets/naming.xml/NoPackage"/>--> + <!--<rule ref="rulesets/naming.xml/PackageCase"/>--> + + <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>--> + <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>--> + <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>--> + <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>--> + <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>--> + <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>--> + + <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>--> + <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>--> + <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>--> + <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>--> + <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>--> + <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>--> + + <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>--> + <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>--> + <!--<rule ref="rulesets/strings.xml/StringToString"/>--> + <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>--> + <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>--> + + <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>--> + <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>--> + + <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/> + <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>--> + +</ruleset> diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER new file mode 100644 index 0000000000..d68a410903 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER @@ -0,0 +1,8 @@ +Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/LICENSE b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/LICENSE new file mode 100644 index 0000000000..8aa906c321 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/LICENSE @@ -0,0 +1,205 @@ + + 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/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/NOTICE b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/NOTICE new file mode 100644 index 0000000000..94481d6cfa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/NOTICE @@ -0,0 +1,6 @@ +${pom.name} +Copyright (c) 2005 - 2007 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/pom.xml b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/pom.xml new file mode 100755 index 0000000000..3953552b03 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/pom.xml @@ -0,0 +1,82 @@ +<?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-modules</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>tuscany-binding-rmi</artifactId> + <name>Apache Tuscany Java RMI Binding</name> + + <dependencies> + <!-- FIXME: The MessageFactoryImpl is in tuscany-core --> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-core</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-assembly-xml</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-interface-java</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-core-spi</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-rmi</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>0.90-incubating-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java new file mode 100644 index 0000000000..bc92dba962 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java @@ -0,0 +1,36 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+
+/**
+ * A factory for the WSDL model.
+ *
+ * @version $Rev: 526508 $ $Date: 2007-04-08 07:42:42 +0530 (Sun, 08 Apr 2007) $
+ */
+public class DefaultRMIBindingFactory implements RMIBindingFactory {
+
+ public DefaultRMIBindingFactory() {
+ }
+
+ public RMIBinding createRMIBinding() {
+ return new RMIBindingImpl();
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java new file mode 100644 index 0000000000..874a2ca066 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java @@ -0,0 +1,40 @@ +/** + * + * Copyright 2006 The Apache Software Foundation + * + * 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. + */ +package org.apache.tuscany.sca.binding.rmi; + +/** + * @version $Rev$ $Date$ + */ +public class NoRemoteMethodException extends RuntimeException { + + private static final long serialVersionUID = -4706646034473965972L; + + public NoRemoteMethodException() { + } + + public NoRemoteMethodException(String message) { + super(message); + } + + public NoRemoteMethodException(String message, Throwable cause) { + super(message, cause); + } + + public NoRemoteMethodException(Throwable cause) { + super(cause); + } +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java new file mode 100644 index 0000000000..81b51c7e53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java @@ -0,0 +1,38 @@ +/** + * + * Copyright 2006 The Apache Software Foundation + * + * 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. + */ +package org.apache.tuscany.sca.binding.rmi; + +/** + */ +public class NoRemoteServiceException extends RMIRuntimeException { + private static final long serialVersionUID = 4940083022809126473L; + + public NoRemoteServiceException() { + } + + public NoRemoteServiceException(String message) { + super(message); + } + + public NoRemoteServiceException(String message, Throwable cause) { + super(message, cause); + } + + public NoRemoteServiceException(Throwable cause) { + super(cause); + } +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java new file mode 100644 index 0000000000..d01c26f368 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java @@ -0,0 +1,55 @@ +/** + * + * Copyright 2006 The Apache Software Foundation + * + * 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. + */ +package org.apache.tuscany.sca.binding.rmi; + +import org.apache.tuscany.sca.assembly.Binding; + +/** + * Represents a binding to an RMI service. + */ +public interface RMIBinding extends Binding { + /** + * @return the host name of the RMI Service + */ + String getRmiHostName(); + + /** + * @param rmiHostName the hostname of the RMI Service + */ + void setRmiHostName(String rmiHostName); + + /** + * @return the port number for the RMI Service + */ + String getRmiPort(); + + /** + * @param rmiPort the port number for the RMI Service + */ + void setRmiPort(String rmiPort); + + /** + * @return returns the RMI Service Name + */ + String getRmiServiceName(); + + /** + * Sets the service name for the RMI Server + * @param rmiServiceName the name of the RMI service + */ + void setRmiServiceName(String rmiServiceName); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java new file mode 100644 index 0000000000..e350386ca0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java @@ -0,0 +1,36 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+
+public interface RMIBindingConstants {
+
+ String BINDING_RMI = "binding.rmi";
+ QName BINDING_RMI_QNAME = new QName(Constants.SCA10_NS, BINDING_RMI);
+ String RMI_HOST = "host";
+ String RMI_PORT = "port";
+ String RMI_SERVICE = "serviceName";
+
+ String COLON = ":";
+ String FWD_SLASH = "/";
+ String LOCAL_HOST = "localhost";
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java new file mode 100644 index 0000000000..199b4053e3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java @@ -0,0 +1,33 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+/**
+ * Factory for the RMI binding model.
+ */
+public interface RMIBindingFactory {
+
+ /**
+ * Creates a new RMI binding.
+ *
+ * @return a new RMI binding
+ */
+ RMIBinding createRMIBinding();
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java new file mode 100644 index 0000000000..144bc3623a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java @@ -0,0 +1,129 @@ +/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * 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.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+
+/**
+ * Represents a binding to an RMI service.
+ *
+ * @version $Rev: 490475 $ $Date: 2006-12-27 15:53:42 +0530 (Wed, 27 Dec 2006) $
+ */
+public class RMIBindingImpl implements RMIBinding, RMIBindingConstants {
+ private String name;
+ private List<PolicySet> policySets = new ArrayList<PolicySet>();
+ private List<Intent> requiredIntents = new ArrayList<Intent>();
+ private String host;
+ private String port;
+ private String serviceName;
+ private List<Object> extensions = new ArrayList<Object>();
+
+ protected RMIBindingImpl() {
+ }
+
+ public String getURI() {
+ return host + COLON + port + serviceName;
+ }
+
+ public String getRmiHostName() {
+ if (host == null) {
+ extractFromUri();
+ }
+ return host;
+ }
+
+ public void setRmiHostName(String host) {
+ this.host = host;
+ }
+
+ public String getRmiPort() {
+ if (port == null) {
+ extractFromUri();
+ }
+ return port;
+ }
+
+ public void setRmiPort(String port) {
+ this.port = port;
+ }
+
+ public String getRmiServiceName() {
+ if (serviceName == null) {
+ extractFromUri();
+ }
+ return serviceName;
+ }
+
+ public void setRmiServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setURI(String uri) {
+ }
+
+ public List<Intent> getRequiredIntents() {
+ return requiredIntents;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ return policySets;
+ }
+
+ public List<Object> getExtensions() {
+ return extensions;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+
+ private void extractFromUri() {
+ if (getURI() != null && getURI().length() > 0) {
+ int colonIndex = getURI().indexOf(COLON);
+ if (colonIndex != -1) {
+ setRmiHostName(getURI().substring(0, colonIndex));
+ setRmiPort(getURI().substring(colonIndex + 1));
+ }
+
+ int slashIndex = getURI().indexOf(FWD_SLASH);
+ if (slashIndex != -1) {
+ if (colonIndex == -1) {
+ setRmiHostName(getURI().substring(0, slashIndex));
+ }
+ setRmiServiceName(getURI().substring(slashIndex + 1));
+ } else {
+ setRmiServiceName(getURI());
+ }
+ }
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java new file mode 100644 index 0000000000..50ff9233ef --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java @@ -0,0 +1,83 @@ +/** + * * Copyright 2006 The Apache Software Foundation + * + * 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. + */ +package org.apache.tuscany.sca.binding.rmi; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.rmi.Remote; + +import org.apache.tuscany.sca.invocation.Invoker; +import org.apache.tuscany.sca.invocation.Message; +import org.apache.tuscany.sca.rmi.RMIHost; +import org.apache.tuscany.sca.rmi.RMIHostException; + +public class RMIBindingInvoker implements Invoker { + private RMIHost rmiHost; + private String host; + private String port; + private String svcName; + private Method remoteMethod; + private Remote proxy; + + public RMIBindingInvoker(RMIHost rmiHost, String host, String port, String svcName, Method remoteMethod) { + this.rmiHost = rmiHost; + this.remoteMethod = remoteMethod; + this.host = host; + this.port = port; + this.svcName = svcName; + } + + public Message invoke(Message msg) { + try { + Object[] args = msg.getBody(); + Object resp = invokeTarget(args); + msg.setBody(resp); + } catch (InvocationTargetException e) { + msg.setFaultBody(e.getCause()); + } catch (Throwable e) { + msg.setFaultBody(e); + } + return msg; + } + + + public Object invokeTarget(final Object payload) throws InvocationTargetException { + try { + if (proxy == null) { + proxy = rmiHost.findService(host, port, svcName); + // proxy = Naming.lookup(serviceURI); + } + remoteMethod = proxy.getClass().getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes()); + + if (payload != null && !payload.getClass().isArray()) { + return remoteMethod.invoke(proxy, payload); + } else { + return remoteMethod.invoke(proxy, (Object[])payload); + + } + } catch (RMIHostException e) { + // the method we are passed must be accessible + throw new AssertionError(e); + } catch (IllegalAccessException e) { + // the method we are passed must be accessible + throw new AssertionError(e); + } catch (NoSuchMethodException e) { + throw new AssertionError(e); + } + + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java new file mode 100644 index 0000000000..b22ddd936a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java @@ -0,0 +1,244 @@ +/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.rmi;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.rmi.Remote;
+import java.rmi.server.UnicastRemoteObject;
+
+import net.sf.cglib.asm.ClassWriter;
+import net.sf.cglib.asm.Constants;
+import net.sf.cglib.asm.Type;
+import net.sf.cglib.proxy.Enhancer;
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.MethodProxy;
+
+import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.invocation.MessageFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.rmi.RMIHost;
+import org.apache.tuscany.sca.rmi.RMIHostException;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * RMIBindingProvider
+ */
+public class RMIBindingProvider implements ReferenceBindingProvider, ServiceBindingProvider, MethodInterceptor {
+
+ private RuntimeComponent component;
+ private RuntimeComponentService service;
+ private RuntimeComponentReference reference;
+ private RMIBinding binding;
+ private MessageFactory messageFactory;
+ private RMIHost rmiHost;
+
+ // need this member to morph the service interface to extend from Remote if
+ // it does not
+ // the base class's member variable interfaze is to be maintained to enable
+ // the connection
+ // of the service outbound to the component's inbound wire which requires
+ // that the service
+ // and the component match in their service contracts.
+ private Interface serviceInterface;
+
+ public RMIBindingProvider(RuntimeComponent component,
+ RuntimeComponentService service,
+ RMIBinding binding,
+ MessageFactory messageFactory,
+ RMIHost rmiHost) {
+ this.component = component;
+ this.service = service;
+ this.binding = binding;
+ this.rmiHost = rmiHost;
+ this.messageFactory = messageFactory;
+ }
+
+ public RMIBindingProvider(RuntimeComponent component,
+ RuntimeComponentReference reference,
+ RMIBinding binding,
+ RMIHost rmiHost) {
+ this.component = component;
+ this.reference = reference;
+ this.binding = binding;
+ this.rmiHost = rmiHost;
+ }
+
+ public InterfaceContract getBindingInterfaceContract() {
+ if (service != null)
+ return service.getInterfaceContract();
+ else
+ return reference.getInterfaceContract();
+ }
+
+ public void start() {
+ if (service != null) {
+ URI uri = URI.create(component.getURI() + "/" + binding.getName());
+ binding.setURI(uri.toString());
+
+ this.serviceInterface = service.getInterfaceContract().getInterface();
+
+ Remote rmiProxy = createRmiService();
+
+ try {
+ rmiHost.registerService(binding.getRmiServiceName(), getPort(binding.getRmiPort()), rmiProxy);
+ } catch (RMIHostException e) {
+ throw new NoRemoteServiceException(e);
+ }
+ }
+ }
+
+ public void stop() {
+ if (service != null) {
+ try {
+ rmiHost.unregisterService(binding.getRmiServiceName(), getPort(binding.getRmiPort()));
+ } catch (RMIHostException e) {
+ throw new NoRemoteServiceException(e.getMessage());
+ }
+ }
+ }
+
+ public Invoker createInvoker(Operation operation, boolean isCallback) {
+ try {
+ Method remoteMethod = JavaInterfaceUtil.findMethod(((JavaInterface)reference.getInterfaceContract()
+ .getInterface()).getJavaClass(), operation);
+ return new RMIBindingInvoker(rmiHost, binding.getRmiHostName(), binding.getRmiPort(), binding
+ .getRmiServiceName(), remoteMethod);
+ } catch (NoSuchMethodException e) {
+ throw new NoRemoteMethodException(operation.toString(), e);
+ }
+ }
+
+ protected Remote createRmiService() {
+ Enhancer enhancer = new Enhancer();
+ enhancer.setSuperclass(UnicastRemoteObject.class);
+ enhancer.setCallback(this);
+ Class targetJavaInterface = getTargetJavaClass(serviceInterface);
+ if (!Remote.class.isAssignableFrom(targetJavaInterface)) {
+ RMIServiceClassLoader classloader = new RMIServiceClassLoader(getClass().getClassLoader());
+ final byte[] byteCode = generateRemoteInterface(targetJavaInterface);
+ targetJavaInterface = classloader.defineClass(byteCode);
+ enhancer.setClassLoader(classloader);
+ }
+ enhancer.setInterfaces(new Class[] {targetJavaInterface});
+ return (Remote)enhancer.create();
+ }
+
+ // if the interface of the component whose serviceBindings must be exposed
+ // as RMI Service, does not
+ // implement java.rmi.Remote, then generate such an interface. This method
+ // will stop with
+ // just generating the bytecode. Defining the class from the byte code must
+ // tbe the responsibility
+ // of the caller of this method, since it requires a classloader to be
+ // created to define and load
+ // this interface.
+ protected byte[] generateRemoteInterface(Class serviceInterface) {
+ String interfazeName = serviceInterface.getCanonicalName();
+ ClassWriter cw = new ClassWriter(false);
+
+ String simpleName = serviceInterface.getSimpleName();
+ cw.visit(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT + Constants.ACC_INTERFACE, interfazeName
+ .replace('.', '/'), "java/lang/Object", new String[] {"java/rmi/Remote"}, simpleName + ".java");
+
+ StringBuffer argsAndReturn = null;
+ Method[] methods = serviceInterface.getMethods();
+ for (Method method : methods) {
+ argsAndReturn = new StringBuffer("(");
+ Class[] paramTypes = method.getParameterTypes();
+ Class returnType = method.getReturnType();
+
+ for (Class paramType : paramTypes) {
+ argsAndReturn.append(Type.getType(paramType));
+ }
+ argsAndReturn.append(")");
+ argsAndReturn.append(Type.getType(returnType));
+
+ cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT,
+ method.getName(),
+ argsAndReturn.toString(),
+ new String[] {"java/rmi/RemoteException"},
+ null);
+ }
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ public Object intercept(Object object, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
+ // since incoming method signatures have 'remotemethod invocation' it
+ // will not match with the
+ // wired component's method signatures. Hence need to pull in the
+ // corresponding method from the
+ // component's service contract interface to make this invocation.
+
+ return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
+ }
+
+ public Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException {
+
+ Message requestMsg = messageFactory.createMessage();
+ ThreadMessageContext.setMessageContext(requestMsg);
+ requestMsg.setBody(args);
+
+ Message responseMsg = service.getInvoker(binding, op).invoke(requestMsg);
+
+ if (responseMsg.isFault()) {
+ throw new InvocationTargetException((Throwable)responseMsg.getBody());
+ }
+ return responseMsg.getBody();
+ }
+
+ protected int getPort(String port) {
+ int portNumber = RMIHost.RMI_DEFAULT_PORT;
+ if (port != null && port.length() > 0) {
+ portNumber = Integer.decode(port);
+ }
+
+ return portNumber;
+ }
+
+ private Class<?> getTargetJavaClass(Interface targetInterface) {
+ // TODO: right now assume that the target is always a Java
+ // Implementation. Need to figure out
+ // how to generate Java Interface in cases where the target is not a
+ // Java Implementation
+ return ((JavaInterface)targetInterface).getJavaClass();
+ }
+
+ private class RMIServiceClassLoader extends ClassLoader {
+ public RMIServiceClassLoader(ClassLoader parent) {
+ super(parent);
+ }
+
+ public Class defineClass(byte[] byteArray) {
+ return defineClass(null, byteArray, 0, byteArray.length);
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java new file mode 100644 index 0000000000..604eae3ab0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java @@ -0,0 +1,57 @@ +/** + * + * Copyright 2006 The Apache Software Foundation + * + * 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. + */ + +package org.apache.tuscany.sca.binding.rmi; + +import org.apache.tuscany.sca.invocation.MessageFactory; +import org.apache.tuscany.sca.provider.BindingProviderFactory; +import org.apache.tuscany.sca.provider.ReferenceBindingProvider; +import org.apache.tuscany.sca.provider.ServiceBindingProvider; +import org.apache.tuscany.sca.rmi.RMIHost; +import org.apache.tuscany.sca.runtime.RuntimeComponent; +import org.apache.tuscany.sca.runtime.RuntimeComponentReference; +import org.apache.tuscany.sca.runtime.RuntimeComponentService; + + +/** + * + * RMIBindingProvider + * + * @version $Rev$ $Date$ + */ +public class RMIBindingProviderFactory implements BindingProviderFactory<RMIBinding> { + + private RMIHost rmiHost; + private MessageFactory messageFactory; + + public RMIBindingProviderFactory(MessageFactory messageFactory, RMIHost rmiHost) { + this.rmiHost = rmiHost; + this.messageFactory = messageFactory; + } + + public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, RMIBinding binding) { + return new RMIBindingProvider(component, reference, binding, rmiHost); + } + + public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, RMIBinding binding) { + return new RMIBindingProvider(component, service, binding, messageFactory, rmiHost); + } + + public Class<RMIBinding> getModelType() { + return RMIBinding.class; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java new file mode 100644 index 0000000000..aaf77bbf66 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java @@ -0,0 +1,60 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.rmi;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.binding.rmi.xml.RMIBindingProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ModuleActivator;
+import org.apache.tuscany.sca.invocation.MessageFactory;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
+import org.apache.tuscany.sca.rmi.RMIHost;
+
+public class RMIModuleActivator implements ModuleActivator {
+
+ public void start(ExtensionPointRegistry registry) {
+
+ ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
+ AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
+ PolicyFactory policyFactory = factories.getFactory(PolicyFactory.class);
+ MessageFactory messageFactory = factories.getFactory(MessageFactory.class);
+
+ StAXArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+
+ RMIHost rmiHost = registry.getExtensionPoint(RMIHost.class);
+ RMIBindingFactory rmiFactory = new DefaultRMIBindingFactory();
+ processors.addArtifactProcessor(new RMIBindingProcessor(assemblyFactory, policyFactory, rmiFactory));
+
+ ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
+ providerFactories.addProviderFactory(new RMIBindingProviderFactory(messageFactory, rmiHost));
+ }
+
+ public void stop(ExtensionPointRegistry registry) {
+ }
+
+ public Object[] getExtensionPoints() {
+ return null;
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java new file mode 100644 index 0000000000..79382c75c6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java @@ -0,0 +1,37 @@ +/** + * + * Copyright 2006 The Apache Software Foundation + * + * 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. + */ +package org.apache.tuscany.sca.binding.rmi; + + +/** + */ +public abstract class RMIRuntimeException extends RuntimeException { + protected RMIRuntimeException() { + } + + protected RMIRuntimeException(String message) { + super(message); + } + + protected RMIRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + protected RMIRuntimeException(Throwable cause) { + super(cause); + } +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java new file mode 100644 index 0000000000..0a33e00548 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java @@ -0,0 +1,169 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.rmi.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.binding.rmi.RMIBindingConstants;
+import org.apache.tuscany.sca.binding.rmi.RMIBindingFactory;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+
+public class RMIBindingProcessor implements
+ StAXArtifactProcessor<RMIBinding>, RMIBindingConstants {
+
+ private RMIBindingFactory rmiBindingFactory;
+ private PolicyFactory policyFactory;
+
+ public RMIBindingProcessor(AssemblyFactory assemblyFactory,
+ PolicyFactory policyFactory,
+ RMIBindingFactory rmiBindingFactory) {
+ this.policyFactory = policyFactory;
+ this.rmiBindingFactory = rmiBindingFactory;
+ }
+
+ public RMIBinding read(XMLStreamReader reader) throws ContributionReadException {
+ try {
+ RMIBinding rmiBinding = rmiBindingFactory.createRMIBinding();
+
+ //Read policies
+ readPolicies(rmiBinding, reader);
+
+ //Read host, port and service name
+ rmiBinding.setRmiHostName(reader.getAttributeValue(null, RMI_HOST));
+ rmiBinding.setRmiPort(reader.getAttributeValue(null, RMI_PORT));
+ rmiBinding.setRmiServiceName(reader.getAttributeValue(null, RMI_SERVICE));
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && BINDING_RMI_QNAME.equals(reader.getName())) {
+ break;
+ }
+ }
+ return rmiBinding;
+
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+ public void write(RMIBinding rmiBinding, XMLStreamWriter writer) throws ContributionWriteException {
+ try {
+ // Write a <binding.ws>
+ writer.writeStartElement(Constants.SCA10_NS, BINDING_RMI);
+
+ if (rmiBinding.getRmiHostName() != null) {
+ writer.writeAttribute(RMIBindingConstants.RMI_HOST, rmiBinding.getRmiHostName());
+ }
+
+ if (rmiBinding.getRmiPort() != null) {
+ writer.writeAttribute(RMIBindingConstants.RMI_PORT, rmiBinding.getRmiPort());
+ }
+
+ if (rmiBinding.getRmiServiceName() != null) {
+ writer.writeAttribute(RMIBindingConstants.RMI_SERVICE, rmiBinding.getRmiServiceName());
+ }
+ writer.writeEndElement();
+
+ } catch (XMLStreamException e) {
+ throw new ContributionWriteException(e);
+ }
+ }
+
+ public void resolve(RMIBinding model, ModelResolver resolver) throws ContributionResolveException {
+ }
+
+ public QName getArtifactType() {
+ return RMIBindingConstants.BINDING_RMI_QNAME;
+ }
+
+ public Class<RMIBinding> getModelType() {
+ return RMIBinding.class;
+ }
+
+ /**
+ * Reads policy intents and policy sets.
+ * @param attachPoint
+ * @param reader
+ */
+ private void readPolicies(PolicySetAttachPoint attachPoint, XMLStreamReader reader) {
+ String value = reader.getAttributeValue(null, Constants.REQUIRES);
+ if (value != null) {
+ List<Intent> requiredIntents = attachPoint.getRequiredIntents();
+ for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
+ QName qname = getQNameValue(reader, tokens.nextToken());
+ Intent intent = policyFactory.createIntent();
+ intent.setName(qname);
+ requiredIntents.add(intent);
+ }
+ }
+
+ value = reader.getAttributeValue(null, Constants.POLICY_SETS);
+ if (value != null) {
+ List<PolicySet> policySets = attachPoint.getPolicySets();
+ for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
+ QName qname = getQNameValue(reader, tokens.nextToken());
+ PolicySet policySet = policyFactory.createPolicySet();
+ policySet.setName(qname);
+ policySets.add(policySet);
+ }
+ }
+ }
+
+ /**
+ * Returns a qname from a string.
+ * @param reader
+ * @param value
+ * @return
+ */
+ private QName getQNameValue(XMLStreamReader reader, String value) {
+ if (value != null) {
+ int index = value.indexOf(':');
+ String prefix = index == -1 ? "" : value.substring(0, index);
+ String localName = index == -1 ? value : value.substring(index + 1);
+ String ns = reader.getNamespaceContext().getNamespaceURI(prefix);
+ if (ns == null) {
+ ns = "";
+ }
+ return new QName(ns, localName, prefix);
+ } else {
+ return null;
+ }
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator new file mode 100644 index 0000000000..9cc4a2ed7f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator @@ -0,0 +1,18 @@ +# 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.
+# Implementation class for the ExtensionActivator
+org.apache.tuscany.sca.binding.rmi.RMIModuleActivator
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..acb81a00f6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package helloworld; + +import org.osoa.sca.annotations.Service; + + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public String sayHello(String name) { + return "Hello from the RMI Service to - " + name; + } + + public String sayHi(String name, String greeter) { + return "Hi from " + greeter + " in RMI Service to - " + name; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java new file mode 100644 index 0000000000..73aedc3b6c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java @@ -0,0 +1,48 @@ +/* + * 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.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldRmiService.class) +public class HelloWorldRmiImpl implements HelloWorldRmiService { + private HelloWorldService extService; + + public HelloWorldService getExtService() { + return extService; + } + + @Reference + public void setExtService(HelloWorldService extService) { + this.extService = extService; + } + + public String sayRmiHello(String name) { + return extService.sayHello(name) + " thro the RMI Reference"; + } + + public String sayRmiHi(String name, String greeter) { + return extService.sayHi(name, greeter) + " thro the RMI Reference"; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java new file mode 100644 index 0000000000..f636c8f7d8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java @@ -0,0 +1,29 @@ +/* + * 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; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +public interface HelloWorldRmiService { + + String sayRmiHello(String name); + String sayRmiHi(String name, String greeter); + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..d5dc509f3e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java @@ -0,0 +1,29 @@ +/* + * 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; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +public interface HelloWorldService { + + String sayHello(String name); + String sayHi(String name, String greeter); + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java new file mode 100644 index 0000000000..e9991185a8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.binding.rmi; + +import helloworld.HelloWorldRmiService; +import junit.framework.Assert; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class BindingTestCase { + private static HelloWorldRmiService helloWorldRmiService; + private static SCADomain domain; + + @Test + public void testRmiService() { + System.out.println(helloWorldRmiService.sayRmiHello("Tuscany World!")); + Assert.assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference", + helloWorldRmiService.sayRmiHello("Tuscany World!")); + + System.out.println(helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World")); + + Assert.assertEquals("Hi from Apache World in RMI Service to - Tuscany World! thro the RMI Reference", + helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World")); + } + + + + @BeforeClass + public static void init() throws Exception { + domain = SCADomain.newInstance("RMIBindingTest.composite"); + helloWorldRmiService = + domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent"); + } + + @AfterClass + public static void destroy() throws Exception { + domain.close(); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java new file mode 100644 index 0000000000..3f9aa9950f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java @@ -0,0 +1,47 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+import junit.framework.TestCase;
+
+public class NoRemoteMethodExceptionTestCase extends TestCase {
+
+ public void testNoArgs() {
+ assertNotNull(new NoRemoteMethodException());
+ }
+
+ public void testMsgArg() {
+ NoRemoteMethodException e = new NoRemoteMethodException("foo");
+ assertEquals("foo", e.getMessage());
+ }
+
+ public void test2Args() {
+ Exception cause = new Exception();
+ NoRemoteMethodException e = new NoRemoteMethodException("foo", cause);
+ assertEquals("foo", e.getMessage());
+ assertEquals(cause, e.getCause());
+ }
+
+ public void testCauseArgs() {
+ Exception cause = new Exception();
+ NoRemoteMethodException e = new NoRemoteMethodException(cause);
+ assertEquals(cause, e.getCause());
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java new file mode 100644 index 0000000000..d4de9996de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java @@ -0,0 +1,47 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.rmi;
+
+import junit.framework.TestCase;
+
+public class NoRemoteServiceExceptionTestCase extends TestCase {
+
+ public void testNoArgs() {
+ assertNotNull(new NoRemoteServiceException());
+ }
+
+ public void testMsgArg() {
+ NoRemoteServiceException e = new NoRemoteServiceException("foo");
+ assertEquals("foo", e.getMessage());
+ }
+
+ public void test2Args() {
+ Exception cause = new Exception();
+ NoRemoteServiceException e = new NoRemoteServiceException("foo", cause);
+ assertEquals("foo", e.getMessage());
+ assertEquals(cause, e.getCause());
+ }
+
+ public void testCauseArgs() {
+ Exception cause = new Exception();
+ NoRemoteServiceException e = new NoRemoteServiceException(cause);
+ assertEquals(cause, e.getCause());
+ }
+
+}
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType new file mode 100644 index 0000000000..224a68f88d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType @@ -0,0 +1,23 @@ +<!-- + * 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://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <service name="HelloWorldService"> + <interface.java interface="helloworld.HelloWorldService"/> + </service> +</componentType> diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType new file mode 100644 index 0000000000..a83e7e6d1d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType @@ -0,0 +1,27 @@ +<!-- + * 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://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <service name="HelloWorldRmiService"> + <interface.java interface="helloworld.HelloWorldRmiService"/> + </service> + <reference name="extService"> + <interface.java interface="helloworld.HelloWorldService"/> + </reference> +</componentType> diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000000..0084319535 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt @@ -0,0 +1,202 @@ + + 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, serviceDefinition 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/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE new file mode 100644 index 0000000000..d83ebbe236 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE @@ -0,0 +1,14 @@ +${pom.name} +Copyright (c) 2005 - 2006 The Apache Software Foundation + +Apache Tuscany is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite new file mode 100644 index 0000000000..9f7b2548bf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + --> +<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" + xmlns:rmi="http://tuscany.apache.org/xmlns/binding/rmi/1.0-SNAPSHOT" + name="HelloWorldRmiComposite"> + + <service name="HelloWorldRmiService" promote="HelloWorldServiceComponent"> + <interface.java interface="helloworld.HelloWorldService"/> + <binding.rmi host="localhost" port="8099" serviceName="HelloWorldRemoteService" /> + <reference target="HelloWorldServiceComponent">HelloWorldServiceComponent</reference> + </service> + + <component name="HelloWorldServiceComponent"> + <implementation.java class="helloworld.HelloWorldImpl"/> + </component> + + <component name="HelloWorldRmiServiceComponent"> + <implementation.java class="helloworld.HelloWorldRmiImpl"/> + <reference name="extService"></reference> + </component> + + <reference name="HelloWorldRmiReference" promote="HelloWorldRmiServiceComponent/extService"> + <interface.java interface="helloworld.HelloWorldService"/> + <binding.rmi host="localhost" port="8099" serviceName="HelloWorldRemoteService" /> + </reference> + +</composite> |