You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/07/28 10:11:50 UTC
svn commit: r979980 - in /tuscany/sca-java-2.x/trunk/samples: ./
implementation-script/ implementation-script/contribution-calculator/
implementation-script/contribution-calculator/src/
implementation-script/contribution-calculator/src/main/ implementa...
Author: slaws
Date: Wed Jul 28 08:11:49 2010
New Revision: 979980
URL: http://svn.apache.org/viewvc?rev=979980&view=rev
Log:
Catching up with ML conversation re. dynamic interfaces so thought I'd add a script sample so I can play with what we do to date.
Added:
tuscany/sca-java-2.x/trunk/samples/implementation-script/
tuscany/sca-java-2.x/trunk/samples/implementation-script/README
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/ (with props)
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/README
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/build.xml
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/pom.xml
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/AddService.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorClient.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorService.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/DivideService.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/MultiplyService.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/SubtractService.java
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/Calculator.composite
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/CalculatorClient.composite
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.componentType
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.js
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.componentType
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.groovy
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.componentType
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.py
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.componentType
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.rb
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/test/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/test/java/
tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/test/java/calculator/
tuscany/sca-java-2.x/trunk/samples/implementation-script/pom.xml
tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java
Modified:
tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/pom.xml
tuscany/sca-java-2.x/trunk/samples/pom.xml
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/README
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/README?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/README (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/README Wed Jul 28 08:11:49 2010
@@ -0,0 +1 @@
+Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions.
Propchange: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jul 28 08:11:49 2010
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/README
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/README?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/README (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/README Wed Jul 28 08:11:49 2010
@@ -0,0 +1,26 @@
+Calculator Sample Contribution
+==============================
+
+This sample contribution implements a simple calculator using SCA components.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive) Take a look there for instructions on how to launch
+this sample contribution.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+Amongst the other output created by the launcher/contribution combination, you should see the following output ...
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/build.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/build.xml?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/build.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/build.xml Wed Jul 28 08:11:49 2010
@@ -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.
+-->
+
+<project name="calculator" default="compile">
+ <property name="tuscany.home" value="../../.."/>
+ <property name="jar.name" value="sample-contribution-implementation-script-calculator.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
+
+
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/pom.xml?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/pom.xml Wed Jul 28 08:11:49 2010
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-contribution-implementation-script-calculator</artifactId>
+ <name>Apache Tuscany SCA Sample Contribution implementation-script Calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/AddService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/AddService.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/AddService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/AddService.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+/**
+ * The Add service interface
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorClient.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorClient.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorClient.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorClient.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE")
+@EagerInit
+public class CalculatorClient {
+
+ private CalculatorService calculatorService;
+
+ @Reference
+ public void setCalculatorService(CalculatorService calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+ // Calculate
+ System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+ }
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorService.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorService.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java Wed Jul 28 08:11:49 2010
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/DivideService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/DivideService.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/DivideService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/DivideService.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/MultiplyService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/MultiplyService.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/MultiplyService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/MultiplyService.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/SubtractService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/SubtractService.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/SubtractService.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/java/calculator/SubtractService.java Wed Jul 28 08:11:49 2010
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/Calculator.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/Calculator.composite?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/Calculator.composite (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/Calculator.composite Wed Jul 28 08:11:49 2010
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <tuscany:implementation.script script="calculator/AddServiceImpl.js"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <tuscany:implementation.script script="calculator/SubtractServiceImpl.rb"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <tuscany:implementation.script script="calculator/MultiplyServiceImpl.py"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <tuscany:implementation.script script="calculator/DivideServiceImpl.groovy"/>
+ </component>
+
+</composite>
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/CalculatorClient.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/CalculatorClient.composite?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/CalculatorClient.composite (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/CalculatorClient.composite Wed Jul 28 08:11:49 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="CalculatorClient">
+
+ <component name="CalculatorClient">
+ <implementation.java class="calculator.CalculatorClient"/>
+ <reference name="calculatorService" target="CalculatorServiceComponent" />
+ </component>
+
+</composite>
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml Wed Jul 28 08:11:49 2010
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
+ <deployable composite="sample:CalculatorClient"/>
+</contribution>
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.componentType?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.componentType (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.componentType Wed Jul 28 08:11:49 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="AddService">
+ <interface.java interface="calculator.AddService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.js
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.js?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.js (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/AddServiceImpl.js Wed Jul 28 08:11:49 2010
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+function add(n1, n2) {
+ return n1 + n2;
+}
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.componentType?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.componentType (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.componentType Wed Jul 28 08:11:49 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="DivideService">
+ <interface.java interface="calculator.DivideService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.groovy
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.groovy?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.groovy (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/DivideServiceImpl.groovy Wed Jul 28 08:11:49 2010
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+def divide(n1, n2) {
+ return n1 / n2
+}
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.componentType?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.componentType (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.componentType Wed Jul 28 08:11:49 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="MultiplyService">
+ <interface.java interface="calculator.MultiplyService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.py
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.py?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.py (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/MultiplyServiceImpl.py Wed Jul 28 08:11:49 2010
@@ -0,0 +1,20 @@
+# 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.
+#
+
+def multiply(n1, n2):
+ return n1 * n2
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.componentType?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.componentType (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.componentType Wed Jul 28 08:11:49 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="SubtractService">
+ <interface.java interface="calculator.SubtractService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.rb
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.rb?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.rb (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/contribution-calculator/src/main/resources/calculator/SubtractServiceImpl.rb Wed Jul 28 08:11:49 2010
@@ -0,0 +1,21 @@
+# 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.
+#
+
+def subtract(n1, n2)
+ return n1 - n2
+end
\ No newline at end of file
Added: tuscany/sca-java-2.x/trunk/samples/implementation-script/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/implementation-script/pom.xml?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/implementation-script/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/implementation-script/pom.xml Wed Jul 28 08:11:49 2010
@@ -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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-implementation-script</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample implementation.script</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>contribution-calculator</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
Modified: tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/pom.xml?rev=979980&r1=979979&r2=979980&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/pom.xml Wed Jul 28 08:11:49 2010
@@ -56,6 +56,12 @@
<type>pom</type>
<version>2.0-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
Added: tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java?rev=979980&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java Wed Jul 28 08:11:49 2010
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherImplementationScriptCalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherImplementationScriptCalculator launcher = new JSELauncherImplementationScriptCalculator();
+ launcher.launchImplementationScriptCalculator();
+ }
+
+ /*
+ * Using the Tuscany Node API to load a contribution.
+ * Using the Tuscany Node API to get a local service proxy
+ */
+ public void launchImplementationScriptCalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../implementation-script/contribution-calculator/target/sample-contribution-implementation-script-calculator.jar"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node.stop();
+ }
+
+}
Modified: tuscany/sca-java-2.x/trunk/samples/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/pom.xml?rev=979980&r1=979979&r2=979980&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/samples/pom.xml Wed Jul 28 08:11:49 2010
@@ -67,6 +67,7 @@
<module>binding-sca</module>
<module>contribution-binding-ws-calculator</module>
<module>contribution-implementation-java-calculator</module>
+ <module>implementation-script</module>
<!-- contributions - Tuscany samples -->