You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2006/09/08 23:40:23 UTC
svn commit: r441663 - in
/incubator/tuscany/java/samples/sca/echo.databinding: ./ src/ src/main/
src/main/java/ src/main/java/echo/ src/main/resources/
src/main/resources/META-INF/ src/main/resources/META-INF/sca/ src/test/
src/test/java/ src/test/java...
Author: rfeng
Date: Fri Sep 8 14:40:22 2006
New Revision: 441663
URL: http://svn.apache.org/viewvc?view=rev&rev=441663
Log:
Add the databinding sample based on the EchoBinding
Added:
incubator/tuscany/java/samples/sca/echo.databinding/
incubator/tuscany/java/samples/sca/echo.databinding/.ruleset
incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt (with props)
incubator/tuscany/java/samples/sca/echo.databinding/pom.xml (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/
incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/echo.system.scdl
incubator/tuscany/java/samples/sca/echo.databinding/src/test/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java (with props)
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding-axiom.scdl
incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding.scdl
Added: incubator/tuscany/java/samples/sca/echo.databinding/.ruleset
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/.ruleset?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/.ruleset (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/.ruleset Fri Sep 8 14:40:22 2006
@@ -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>
Added: incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt Fri Sep 8 14:40:22 2006
@@ -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/).
+
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/NOTICE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/samples/sca/echo.databinding/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/pom.xml?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/pom.xml (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/pom.xml Fri Sep 8 14:40:22 2006
@@ -0,0 +1,86 @@
+<?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>
+
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>tuscany-samples-sca</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-echo-databinding</artifactId>
+ <name>Echo DataBinding</name>
+ <description>A Sample for DataBinding</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-spi</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>test</artifactId>
+ <version>${sca.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.databinding</groupId>
+ <artifactId>databinding-framework</artifactId>
+ <version>${pom.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.databinding</groupId>
+ <artifactId>databinding-axiom</artifactId>
+ <version>${pom.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ws-commons</groupId>
+ <artifactId>axiom-impl</artifactId>
+ <version>SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,28 @@
+/*
+ * 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 echo;
+
+import org.apache.tuscany.spi.model.Binding;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBinding extends Binding {
+
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBinding.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,56 @@
+/*
+ * 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 echo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import static org.osoa.sca.Version.XML_NAMESPACE_1_0;
+import org.osoa.sca.annotations.Constructor;
+
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.LoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBindingLoader extends LoaderExtension<EchoBinding> {
+
+ public static final QName BINDING_ECHO = new QName(XML_NAMESPACE_1_0, "binding.echo");
+
+ @Constructor
+ public EchoBindingLoader(@Autowire LoaderRegistry registry) {
+ super(registry);
+ }
+
+ public QName getXMLType() {
+ return BINDING_ECHO;
+ }
+
+ public EchoBinding load(CompositeComponent parent,
+ XMLStreamReader reader,
+ DeploymentContext context) throws XMLStreamException, LoaderException {
+ return new EchoBinding();
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBindingLoader.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,52 @@
+/*
+ * 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 echo;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.Reference;
+import org.apache.tuscany.spi.component.Service;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.BindingBuilderExtension;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBuilder extends BindingBuilderExtension<EchoBinding> {
+
+ public Reference<?> build(CompositeComponent parent,
+ BoundReferenceDefinition<EchoBinding> definition,
+ DeploymentContext context) {
+ Class<?> interfaze = definition.getServiceContract().getInterfaceClass();
+ String name = definition.getName();
+ return new EchoReference(name, interfaze, parent, wireService);
+ }
+
+ public Service<?> build(CompositeComponent parent,
+ BoundServiceDefinition<EchoBinding> definition,
+ DeploymentContext context) {
+ Class<?> interfaze = definition.getServiceContract().getInterfaceClass();
+ return new EchoService(definition.getName(), interfaze, parent, wireService);
+ }
+
+ protected Class<EchoBinding> getBindingType() {
+ return EchoBinding.class;
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,66 @@
+/*
+ * 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 echo;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.spi.wire.InvocationRuntimeException;
+import org.apache.tuscany.spi.wire.Message;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoInvoker implements TargetInvoker {
+
+ private boolean cacheable;
+
+ public boolean isCacheable() {
+ return cacheable;
+ }
+
+ public void setCacheable(boolean cacheable) {
+ this.cacheable = cacheable;
+ }
+
+ public boolean isOptimizable() {
+ return isCacheable();
+ }
+
+ public Object invokeTarget(final Object payload) throws InvocationTargetException {
+ // echo back the result, a real binding would invoke some API for flowing the request
+ return ((Object[])payload)[0];
+ }
+
+ public Message invoke(Message msg) throws InvocationRuntimeException {
+ try {
+ Object resp = invokeTarget(msg.getBody());
+ msg.setBody(resp);
+ } catch (InvocationTargetException e) {
+ msg.setBody(e.getCause());
+ } catch (Throwable e) {
+ msg.setBody(e);
+ }
+ return msg;
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoInvoker.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,40 @@
+/*
+ * 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 echo;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ReferenceExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoReference<T> extends ReferenceExtension<T> {
+
+ public EchoReference(String name, Class<T> interfaze, CompositeComponent parent, WireService wireService) {
+ super(name, interfaze, parent, wireService);
+ }
+
+ public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
+ return new EchoInvoker();
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoReference.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java Fri Sep 8 14:40:22 2006
@@ -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 echo;
+
+import org.apache.tuscany.spi.extension.ServiceExtension;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.wire.WireService;
+import org.apache.tuscany.spi.CoreRuntimeException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoService<T> extends ServiceExtension<T> {
+ public EchoService(String name,
+ Class<T> interfaze,
+ CompositeComponent parent,
+ WireService wireService) throws CoreRuntimeException {
+ super(name, interfaze, parent, wireService);
+ // do nothing, but this could register with the host environment
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/main/java/echo/EchoService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/echo.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/echo.system.scdl?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/echo.system.scdl (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/main/resources/META-INF/sca/echo.system.scdl Fri Sep 8 14:40:22 2006
@@ -0,0 +1,36 @@
+<?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.
+-->
+<!--
+ JavaScript configuration for the launcher environment.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+
+ name="org.apache.tuscany.launcher.JavaScriptImplementation">
+
+ <component name="BindingLoader">
+ <system:implementation.system class="echo.EchoBindingLoader"/>
+ </component>
+
+ <component name="BindingBuilder">
+ <system:implementation.system class="echo.EchoBuilder"/>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,55 @@
+/*
+ * 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 echo;
+
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentAImpl implements Interface1 {
+
+ private Interface1 componentBReference;
+
+ @Constructor
+ public ComponentAImpl(@Reference(name = "componentBReference", required = true)
+ Interface1 componentBReference) {
+ this.componentBReference = componentBReference;
+ }
+
+ public Object call(Object msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentA --> Received message: " + request);
+ Object ret = componentBReference.call(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentA --> Returned message: " + response);
+ return ret;
+ }
+
+ public Object call1(Object msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentA --> Received message: " + request);
+ Object ret = componentBReference.call1(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentA --> Returned message: " + response);
+ return ret;
+ }
+
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentAImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,57 @@
+/*
+ * 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 echo;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Reference;
+import org.w3c.dom.Node;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentBImpl implements Interface2 {
+
+ private Echo echoReference;
+
+ @Constructor
+ public ComponentBImpl(@Reference(name = "echoReference", required = true)
+ Echo echoReference) {
+ this.echoReference = echoReference;
+ }
+
+ public Node call(Node msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentB --> Received message: " + request);
+ Node ret = (Node) echoReference.invoke(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentB --> Returned message: " + response);
+ return ret;
+ }
+
+ public XMLStreamReader call1(XMLStreamReader msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentB --> Received message: " + request);
+ XMLStreamReader ret = (XMLStreamReader) echoReference.invoke(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentB --> Returned message: " + response);
+ return ret;
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/ComponentBImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,45 @@
+/*
+ * 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 echo;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import org.apache.tuscany.test.SCATestCase;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DataBindingIntegrationTestCase extends SCATestCase {
+
+ private Interface1 componentA;
+
+ public void testTransform() {
+ componentA.call("<foo>123</foo>");
+ componentA.call1("<foo>123</foo>");
+ }
+
+ protected void setUp() throws Exception {
+ addExtension("echo.binding", getClass().getClassLoader().getResource("META-INF/sca/echo.system.scdl"));
+ addExtension("databinding", getClass().getClassLoader().getResource("META-INF/tuscany/test-databinding.scdl"));
+ super.setUp();
+ CompositeContext context = CurrentCompositeContext.getContext();
+ componentA = context.locateService(Interface1.class, "ComponentA");
+ }
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java Fri Sep 8 14:40:22 2006
@@ -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 echo;
+
+import org.apache.tuscany.api.annotation.DataType;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@DataType(name="javax.xml.stream.XMLStreamReader")
+public interface Echo {
+ Object invoke(Object msg);
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Echo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java Fri Sep 8 14:40:22 2006
@@ -0,0 +1,32 @@
+/*
+ * 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 echo;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@DataType(name="java.lang.String")
+@Remotable
+public interface Interface1 {
+ Object call(Object msg);
+ Object call1(Object msg);
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface1.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java Fri Sep 8 14:40:22 2006
@@ -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 echo;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+import org.w3c.dom.Node;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@DataType(name="org.w3c.dom.Node")
+@Remotable
+public interface Interface2 {
+ Node call(Node msg);
+ @DataType(name="javax.xml.stream.XMLStreamReader")
+ XMLStreamReader call1(XMLStreamReader msg);
+}
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/samples/sca/echo.databinding/src/test/java/echo/Interface2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl Fri Sep 8 14:40:22 2006
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="echo.sample">
+
+ <service name="ClientService">
+ <interface.java class="echo.Interface1"/>
+ <binding.echo/>
+ <reference>ComponentB</reference>
+ </service>
+
+ <component name="ComponentA">
+ <implementation.java class="echo.ComponentAImpl"/>
+ <reference name="componentBReference">ComponentB</reference>
+ </component>
+
+ <component name="ComponentB">
+ <implementation.java class="echo.ComponentBImpl"/>
+ <reference name="echoReference">EchoReference</reference>
+ </component>
+
+ <reference name="EchoReference">
+ <interface.java interface="echo.Echo"/>
+ <binding.echo/>
+ </reference>
+
+</composite>
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding-axiom.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding-axiom.scdl?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding-axiom.scdl (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding-axiom.scdl Fri Sep 8 14:40:22 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+ name="org.apache.tuscany.databinding.Axiom">
+
+ <component name="databinding.axiom">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.AxiomDataBinding" />
+ </component>
+
+ <!-- Transformers -->
+ <component name="transformer.ObjectArray2OM">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.ObjectArray2OM" />
+ </component>
+
+ <component name="transformer.XMLStreamReader2OMElement">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.XMLStreamReader2OMElement" />
+ </component>
+
+ <component name="transformer.OMElement2XMLStreamReader">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2XMLStreamReader" />
+ </component>
+
+ <component name="transformer.String2OMElement">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.String2OMElement" />
+ </component>
+
+ <component name="transformer.OMElement2String">
+ <system:implementation.system class="org.apache.tuscany.databinding.axiom.OMElement2String" />
+ </component>
+</composite>
\ No newline at end of file
Added: incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding.scdl?view=auto&rev=441663
==============================================================================
--- incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding.scdl (added)
+++ incubator/tuscany/java/samples/sca/echo.databinding/src/test/resources/META-INF/tuscany/test-databinding.scdl Fri Sep 8 14:40:22 2006
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+ name="org.apache.tuscany.databinding.Framework">
+
+ <include name="org.apache.tuscany.databinding.Axiom" scdlLocation="test-databinding-axiom.scdl"/>
+
+ <component name="databinding.wirePostProcessor">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.DataBindingWirePostProcessor"/>
+ </component>
+
+ <component name="databinding.javaInterfaceProcessor">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.DataBindingJavaInterfaceProcessor"/>
+ </component>
+
+ <!-- DataBinding registry -->
+ <component name="databinding.registry" initLevel="40">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.DataBindingRegistryImpl" />
+ </component>
+
+ <!-- DataBinding registry -->
+ <component name="databinding.mediator" initLevel="40">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.MediatorImpl" />
+ </component>
+
+ <!-- Transformer registry -->
+ <component name="databinding.transformerRegistry" initLevel="40">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.TransformerRegistryImpl" />
+ </component>
+
+ <component name="dataType.loader">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.DataTypeLoader" />
+ </component>
+
+ <!-- Simple databindings -->
+ <component name="databinding.dom">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.SimpleDataBinding" />
+ <property name="className">org.w3c.dom.Node</property>
+ </component>
+
+ <!-- Transformers -->
+ <component name="transformer.Node2String">
+ <system:implementation.system class="org.apache.tuscany.databinding.xml.Node2String" />
+ </component>
+
+ <component name="transformer.String2Node">
+ <system:implementation.system class="org.apache.tuscany.databinding.xml.String2Node" />
+ </component>
+
+ <component name="transformer.JavaParametersTransformer">
+ <system:implementation.system class="org.apache.tuscany.databinding.impl.JavaParametersTransformer" />
+ </component>
+
+</composite>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org