diff options
Diffstat (limited to 'java/sca/samples')
363 files changed, 0 insertions, 21781 deletions
diff --git a/java/sca/samples/README b/java/sca/samples/README deleted file mode 100644 index 4ccefa3695..0000000000 --- a/java/sca/samples/README +++ /dev/null @@ -1,232 +0,0 @@ -The Apache Tuscany SCA Samples -============================== -The Apache Tuscany SCA samples are built as part of the main Maven build and -run, using the provided JUnit test cases, as tests in the Maven build. - -In the binary distribution of Apache Tuscany most samples can also -be run using the provided Ant build.xml files. These show the samples running -from a simple main() method without the need for a JUnit test case. - -In these notes text that appears in angled brackets like this <example> means -that you need to make a choice and provide your own text at that point. - -These simple samples have been created with the intention of illustrating the -usage of the SCA API and annotations and certainly not to levels of SCA component -abstraction. In real life situations you should use SCA to assemble real and -usually bigger components, and when you do that you'll get all the benefits of -SCA, bindings, policies, integration in an SOA environment etc.. - -Sample Overview ---------------- -The samples generally show off different features of the SCA runtime -and the extensions that come packaged with it. - -binding-ws-calculator - Calculator running inside a web app also - showing webservices binding - -calculator - Calculator built with java components and - local wires. - -calculator-equinox - Calculator running inside a Equinox OSGi runtime - -calculator-osgi - Calculator running inside a OSGi runtime - -calculator-rmi-reference - The calculator configured to talk RMI to - the calculator-rmi-service sample -calculator-rmi-service - The calculator configured to accept RMI - requests from calculator-rmi-reference - -implementation-java-calculator - - -Sample Layout -------------- -All sample directories are organized in the same way based on the default -project template provided by Maven. For example, take a look at the calculator -sample; - -calculator/ - src/ - Holds all of the source files for the sample - main/ - Groups together the files that implement the sample - java/ - Java source files - resources/ - Non java resource files such as composte files - test/ - Groups together files that provide sample tests - java - Java test sources files. Usually JUnit test cases - target/ - Holds the files generated when the sample is built - classes/ - For example, Java class files - test-classes/ - classes from src/test and other test files - -Getting Ready To Build ----------------------- -You will need to install the following software before you start. - -J2SE Development Kit (JDK) 5.0 -Apache Ant 1.7.1 - if you are going to use Ant -Apache Maven 2.0.9 - if you are going to use Maven - -Java and Ant and/or Maven binary directories must be present in your PATH so -that their executable programs are available in your environment. You may -find it useful to use a script to set up your environment, for example; - -For UNIX: - JAVA_HOME=/<installation_directory> - ANT_HOME=/<installation_directory>/apache-ant-1.7.0 - MAVEN_HOME=/<installation_directory>/maven-2.0.6 - export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH - -For Windows: - set JAVA_HOME=C:\<installation_directory> - set ANT_HOME=C:\<installation_directory>\apache-ant-1.7.0 - set MAVEN_HOME=C:\<installation_directory>\maven-2.0.6 - set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%MAVEN_HOME%\bin;%PATH% - - -Building And Running The SCA Samples Using Ant ----------------------------------------------- -The build.xml files provided with the Apache Tuscany SCA samples are designed -to work with the binary distribution. They rely on the tuscany-sca-manifest.jar -to describe the class path and this jar is only provided as part of the -binary distribution. - -The binary distribution of SCA also includes precompiled versions of each sample. -If you look in the target directory of each sample you will see this jar file. To -run a sample based on all of the precompiled artifacts all you have to do is: - -cd <sampledir> -ant run - -Check each <sampledir>/README file as some samples require that two progams are -run to get the desired result, for example, the two samples that show how -to build extensions are run from their associated application samples. - -If you want to rebuild a sample, for example, if you have changed it, do the -following: - -cd <sampledir> -ant compile - -Once the sample is built you have the option of running the sample in whatever -way best suits you. Two alternatives are provided in the ant build files. - -The compile target builds the class files and then builds the jar so you can use -the same command as before: - -ant run - -This will use the generated jar to run the samples. The command line version of -this is: - -on Windows - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\<sample jar file> <sample runnable class> - -for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient - -on *nix - -java -cp ../../features/tuscany-sca-manifest.jar:target/<sample jar file> <sample runnable class> - -for example : java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient - - -You can use the compiled classes directly using - -ant run-classes - -The command line version of this is: - -on Windows - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes <sample runnable class> - -for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes calculator.CalculatorClient - -on *nix - -java -cp ../../features/tuscany-sca-manifest.jar:target/classes <sample runnable class> - -for example : java -cp ../../features/tuscany-sca-manifest.jar:target/classes calculator.CalculatorClient - -The class specified on the command of course depends on which sample you want to -run. In the examples we have used we are running the CalculatorClient from the calculator sample. - - -Building And Running The SCA Samples Using Maven ------------------------------------------------- - -The Maven build process will work from both source and binary distributions. -To build and test all of the Apache Tuscany SCA sources, including the samples, -do the following. - -cd sca -mvn - -This will take a little while to complete. Experience with Maven tells us that -sometimes there are problems downloading the dependencies that Apache Tuscany -SCA requires. If Maven reports that it cannot download required dependencies -try running the Maven build again. - -Once you have all of the source built you can build and run each sample -independently if required. - -cd <sampledir> -mvn - -When using Maven the samples are run within JUnit test cases and so you will -sometimes not see any test output. You will always see an indication of test -success or failure. - -Using The Samples In An IDE ---------------------------------------------- -The easiest way to use the samples in an IDE is to use Maven to generate all -of the IDE project files for you automatically. This works best if you -generate IDE projects for all of the Apache Tuscany modules. You can then -include the ones you are interested in working with in you IDE. - -To build IDE project files for all of the modules in Apache Tuscany SCA; - -cd sca - -If you are an Eclipse user do the following - -mvn -Peclipse - -If you are an IDEA user do the following - -mvn idea:idea - -These commands generate project files for each module in Apache Tuscany SCA. -The modules you are interested in can now be included in your IDE, for example, -in Eclipse, if you create a new Java project and use the option to "create a -new project from existing source" you can specify an SCA module directory, -which includes the generated project files, and Eclipse will treat it like any -other Java project. - -Using The Samples In An IDE Without Maven ------------------------------------------ -We don't provide any IDE project files with our distributions so you will have to -import the sample files into your IDE manually. Here's an example of how it can be -done using Eclipse. - -In a new or existing workspace - Create a new java project to represent the sample you want to work on, e.g. - calculator - Import all of the sample code and resources into this project, e.g. - File, Import and then select tuscany-sca-1.0-incubating\samples\calculator from the filesystem - Configure the source path to include - src/main/java - src/main/resources - Configure the output folder to be - calculator/target - Configure the build path to include the manifest jar tuscany-sca-manifiest.jar provided in - features - If you select calculator.CalculatorClient.java and run as "Java Application" you should see - 3 + 2=5.0 - 3 - 2=1.0 - 3 * 2=6.0 - 3 / 2=1.5 - -The details of how to do this for other development environments will -vary but the process will be similar. - - diff --git a/java/sca/samples/binding-ws-calculator/README b/java/sca/samples/binding-ws-calculator/README deleted file mode 100644 index fb5afcc7ec..0000000000 --- a/java/sca/samples/binding-ws-calculator/README +++ /dev/null @@ -1,97 +0,0 @@ -Calculator Sample -================= -This sample implements a simple calculator using SCA components. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-binding-ws-calculator.jar sample.SampleClientImpl - -and on *nix do - -java -cp ../../features/tuscany-sca-manifest.jar:target/sample-binding-ws-calculator.jar sample.SampleClientImpl - -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. - -calculator/ - src/ - main/ - java/ - calculator/ - CalculatorService.java - the first component, calls +-/* as - appropriate - CalculatorServiceImpl.java - AddService.java - adds two numbers - AddServiceImpl.java - SubtractService.java - subtracts one number from another - SubtractServiceImpl.java - MultiplyService.java - multiplies two numbers - MultiplyServiceImpl.java - DivideService.java - divides one number by another - DivideServiceImpl.java - CalculatorClient.java - starts the SCA Runtime and - deploys the Calculator.composite. - It then calls the deployed Calculator - Components services - resources/ - Calculator.composite - the SCA assembly for this sample - test/ - java/ - calculator/ - CalculatorTestCase.java - JUnit test case - calculator.png - a pictorial representation of the sample - .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant as -follows - -cd calculator -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd calculator -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running calculator.CalculatorTestCase -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/java/sca/samples/binding-ws-calculator/build.xml b/java/sca/samples/binding-ws-calculator/build.xml deleted file mode 100644 index e13ec494b0..0000000000 --- a/java/sca/samples/binding-ws-calculator/build.xml +++ /dev/null @@ -1,67 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project name="binding-ws-calculator" default="run"> - - <property name="jar.name" value="sample-binding-ws-calculator.jar" /> - <property name="main.class" value="sample.SampleClientImpl" /> - - <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="../../modules"> - <include name="tuscany-sca-api-*.jar" /> - <include name="tuscany-node-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> - - <target name="run" depends="compile"> - <java classname="org.apache.tuscany.sca.launcher.LauncherMain" - fork="true" - failonerror="true"> - <classpath> - <pathelement location="../../bin/launcher.jar"/> - </classpath> - <arg value="unmanaged"/> - <arg value="target/${jar.name}"/> - </java> - </target> - -</project> diff --git a/java/sca/samples/binding-ws-calculator/calculator.png b/java/sca/samples/binding-ws-calculator/calculator.png Binary files differdeleted file mode 100644 index 995a57b1fd..0000000000 --- a/java/sca/samples/binding-ws-calculator/calculator.png +++ /dev/null diff --git a/java/sca/samples/binding-ws-calculator/calculator.svg b/java/sca/samples/binding-ws-calculator/calculator.svg deleted file mode 100644 index af34f07e04..0000000000 --- a/java/sca/samples/binding-ws-calculator/calculator.svg +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * 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.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/java/sca/samples/binding-ws-calculator/pom.xml b/java/sca/samples/binding-ws-calculator/pom.xml deleted file mode 100644 index 4cc8073925..0000000000 --- a/java/sca/samples/binding-ws-calculator/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-binding-ws-calculator</artifactId> - <name>Apache Tuscany SCA Sample Binding WS Calculator</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-api</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-core</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-webservice</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-ejava</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddService.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddService.java deleted file mode 100644 index dd7ecb827d..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Add service interface - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java deleted file mode 100644 index 7e5ff160f0..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -import sample.SampleClient; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -public class CalculatorClientImpl implements SampleClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - /** - * This code used to be in an @Init method which removed the need for a JSE client - * to prod the compoite. However OASIS is debating whether to allow references to be used - * inside @Init methods and it can cause deadlocks in our runtime. So rather than make - * changes in the runtime we are falling backon the JSE drive mechanism until we know - * which way the specs are going - */ - public void runSample() { - System.out.println("SCA API ClassLoader: " + print(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)); - } - - private static String print(ClassLoader cl) { - StringBuffer buf = new StringBuffer(); - for (; cl != null;) { - buf.append(cl.toString()); - buf.append(' '); - cl = cl.getParent(); - } - return buf.toString(); - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 031fa8b912..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 17fad7de6b..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - - -/** - * An implementation of the Calculator service. - */ -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); - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java b/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java deleted file mode 100644 index 6620f6a5e7..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -/** - * The sample service interface. - */ -public interface SampleClient { - void runSample(); -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java b/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java deleted file mode 100644 index 000c108934..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class SampleClientImpl { - public static void main(String[] args) throws Exception { - String location = ContributionLocationHelper.getContributionLocation(SampleClient.class); - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", location)); - - node.start(); - - SampleClient sampleClient = node.getService(SampleClient.class, "SampleClient"); - sampleClient.runSample(); - - node.stop(); - - } - -} diff --git a/java/sca/samples/binding-ws-calculator/src/main/resources/Calculator.composite b/java/sca/samples/binding-ws-calculator/src/main/resources/Calculator.composite deleted file mode 100644 index 29dd7e3b6f..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/resources/Calculator.composite +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - targetNamespace="http://sample" - xmlns:sample="http://sample" - name="Calculator"> - - <component name="SampleClient"> - <implementation.java class="calculator.CalculatorClientImpl"/> - <reference name="calculatorService" target="CalculatorServiceComponent" /> - </component> - - <component name="CalculatorServiceComponent"> - <implementation.java class="calculator.CalculatorServiceImpl"/> - <reference name="addService" > - <binding.ws uri="http://localhost:8085/AddServiceComponent"/> - </reference> - <reference name="subtractService" target="SubtractServiceComponent" /> - <reference name="multiplyService" target="MultiplyServiceComponent" /> - <reference name="divideService" target="DivideServiceComponent" /> - </component> - - <component name="AddServiceComponent"> - <implementation.java class="calculator.AddServiceImpl"/> - <service name="AddService"> - <binding.ws uri="http://localhost:8085/AddServiceComponent"/> - </service> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 27a1ee74e4..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:sample="http://sample"> - <deployable composite="sample:Calculator"/> -</contribution>
\ No newline at end of file diff --git a/java/sca/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 8f6b5e4845..0000000000 --- a/java/sca/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.junit.Test; - -import sample.SampleClientImpl; - -/** - * Test the Calculator composition. - */ -public class CalculatorTestCase { - - @Test - public void testSample() throws Exception { - SampleClientImpl.main(null); - } -} diff --git a/java/sca/samples/build-common.xml b/java/sca/samples/build-common.xml deleted file mode 100644 index 2354dd1ce4..0000000000 --- a/java/sca/samples/build-common.xml +++ /dev/null @@ -1,102 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<project name="common"> - <!-- Set the distro path based on the existence of the pom.xml --> - <condition property="distro.path" value="../../distribution/all/target" else="../.."> - <available file="../../distribution/pom.xml"/> - </condition> - - <!-- Convert the path to an absolute location --> - <property name="distro.root" location="${distro.path}"/> - <echo>Distribution: ${distro.root}</echo> - - <!-- @file is relative to the enclosing file --> - <import file="${distro.root}/features/build-path.xml"/> - - <target name="common-init"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - <mkdir dir="${sample.root}/target/classes"/> - </target> - - <target name="common-jar-compile" depends="common-init"> - <javac srcdir="${sample.root}/src/main/java" - destdir="${sample.root}/target/classes" - debug="on" - source="1.5" - target="1.5"> - <classpath refid="tuscany.path"/> - </javac> - <copy todir="${sample.root}/target/classes"> - <fileset dir="${sample.root}/src/main/resources"/> - </copy> - <jar destfile="${sample.jar}" basedir="${sample.root}/target/classes"> - </jar> - </target> - - <target name="common-war-compile" depends="common-init"> - <javac srcdir="${sample.root}/src/main/java" - destdir="${sample.root}/target/classes" - debug="on" - source="1.5" - target="1.5"> - <classpath refid="tuscany.path"/> - </javac> - <copy todir="${sample.root}/target/classes"> - <fileset dir="${sample.root}/src/main/resources"/> - </copy> - <war destfile="${sample.war}" webxml="${sample.root}/src/main/webapp/WEB-INF/web.xml"> - <fileset dir="${sample.root}/src/main/webapp"/> - <lib refid="tuscany.path"/> - <classes dir="${sample.root}/target/classes"/> - </war> - </target> - - <target name="common-run-jse" depends="compile"> - <java jar="${distro.root}/modules/tuscany-node-launcher-2.0-SNAPSHOT.jar" - fork="true" - inputstring="q"> - <jvmarg value="-Djava.util.logging.config.file=${sample.root}/../../logging.properties"/> - <arg value="${sample.composite}"/> - <!-- would be good to have the node launcher run the first deployable - composite if this is not specified so I don't have to put it here --> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="common-run-equinox" depends="compile"> - <java jar="${distro.root}/modules/tuscany-node-launcher-equinox-2.0-SNAPSHOT.jar" - fork="true" - inputstring="q"> - <jvmarg value="-Djava.util.logging.config.file=${sample.root}/../../logging.properties"/> - <arg value="${sample.composite}"/> - <!-- would be good to have the node launcher run the first deplyable - composite if this is not specified so I don't have to put it here --> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="common-clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> -</project> diff --git a/java/sca/samples/calculator-equinox/README b/java/sca/samples/calculator-equinox/README deleted file mode 100644 index 7f76542622..0000000000 --- a/java/sca/samples/calculator-equinox/README +++ /dev/null @@ -1,97 +0,0 @@ -Calculator Sample
-=================
-This sample implements a simple calculator using SCA components.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-equinox.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-equinox.jar calculator.CalculatorClient
-
-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.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/java/sca/samples/calculator-equinox/build.xml b/java/sca/samples/calculator-equinox/build.xml deleted file mode 100644 index 75c4839cfa..0000000000 --- a/java/sca/samples/calculator-equinox/build.xml +++ /dev/null @@ -1,78 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project name="calculator-equinox" default="run"> - <property name="sample.name" value="${ant.project.name}"/> - <property name="sample.jar" value="./target/sample-${sample.name}.jar" /> - - <target name="init"> - <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"> - <classpath> - <fileset dir="../../features"> - <include name="tuscany-sca-manifest.jar" /> - </fileset> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="${sample.jar}" basedir="target/classes"> - </jar> - </target> - - <target name="run" depends="compile"> - <java jar="../../features/tuscany-sca-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <!-- optional to set the deployable composite --> - <arg value="-composite"/> - <arg value="Calculator.composite"/> - <!-- stop the node after the application runs --> - <arg value="-ttl"/> - <arg value="0"/> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="run-equinox" depends="compile"> - <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <arg value="-composite"/> - <arg value="Calculator.composite"/> - <arg value="-config"/> - <arg value="../../features/configuration"/> - <arg value="-ttl"/> - <arg value="0"/> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> -</project> - diff --git a/java/sca/samples/calculator-equinox/calculator.png b/java/sca/samples/calculator-equinox/calculator.png Binary files differdeleted file mode 100644 index 995a57b1fd..0000000000 --- a/java/sca/samples/calculator-equinox/calculator.png +++ /dev/null diff --git a/java/sca/samples/calculator-equinox/calculator.svg b/java/sca/samples/calculator-equinox/calculator.svg deleted file mode 100644 index af34f07e04..0000000000 --- a/java/sca/samples/calculator-equinox/calculator.svg +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * 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.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/java/sca/samples/calculator-equinox/pom.xml b/java/sca/samples/calculator-equinox/pom.xml deleted file mode 100644 index 20ff4dc20e..0000000000 --- a/java/sca/samples/calculator-equinox/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator-equinox</artifactId> - <name>Apache Tuscany SCA Sample Calculator Equinox</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> -</project> diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 84c98d7f70..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -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: " + print(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)); - } - - private static String print(ClassLoader cl) { - StringBuffer buf = new StringBuffer(); - for (; cl != null;) { - buf.append(cl.toString()); - buf.append(' '); - cl = cl.getParent(); - } - return buf.toString(); - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 031fa8b912..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 17fad7de6b..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - - -/** - * An implementation of the Calculator service. - */ -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); - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/calculator-equinox/src/main/resources/Calculator.composite b/java/sca/samples/calculator-equinox/src/main/resources/Calculator.composite deleted file mode 100644 index 9450558145..0000000000 --- a/java/sca/samples/calculator-equinox/src/main/resources/Calculator.composite +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - 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"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - - <component name="CalculatorClient"> - <implementation.java class="calculator.CalculatorClient"/> - <reference name="calculatorService" target="CalculatorServiceComponent" /> - </component> - -</composite> diff --git a/java/sca/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index b49e1da130..0000000000 --- a/java/sca/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - - private static NodeLauncher launcher; - private static Node node; - - public static void main(String[] args) throws Exception { - setUpBeforeClass(); - tearDownAfterClass(); - } - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - launcher = NodeLauncher.newInstance(); - String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - node = launcher.createNode("Calculator.composite", new Contribution("test", location)); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - node.start(); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node.destroy(); - } - if (launcher != null) { - launcher.destroy(); - } - } - - @Test - public void testDummy() throws Exception { - } -} diff --git a/java/sca/samples/calculator-osgi/META-INF/MANIFEST.MF b/java/sca/samples/calculator-osgi/META-INF/MANIFEST.MF deleted file mode 100644 index 1ebd35b30a..0000000000 --- a/java/sca/samples/calculator-osgi/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0
-Private-Package: calculator;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Calculator OSGi Sample
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Eclipse-LazyStart: false
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1223949424781
-Bundle-Activator: calculator.CalculatorActivator
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Calculator OSGi Sample
-Import-Package: org.apache.tuscany.sca.node;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework;version="1.4"
-Bundle-SymbolicName: sample-calculator-osgi
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/java/sca/samples/calculator-osgi/README b/java/sca/samples/calculator-osgi/README deleted file mode 100644 index 332526d43a..0000000000 --- a/java/sca/samples/calculator-osgi/README +++ /dev/null @@ -1,97 +0,0 @@ -Calculator Sample
-=================
-This sample implements a simple calculator using SCA components and run it in a OSGi environment.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -jar ..\..\features\tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ..\..\features\configuration\ -ttl 0 target\sample-calculator-osgi.jar
-
-and on *nix do
-
-java -jar ../../features/tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ../../features/configuration/ -ttl 0 target/sample-calculator-osgi.jar
-
-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.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/java/sca/samples/calculator-osgi/build.xml b/java/sca/samples/calculator-osgi/build.xml deleted file mode 100644 index 46522211f9..0000000000 --- a/java/sca/samples/calculator-osgi/build.xml +++ /dev/null @@ -1,78 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project name="calculator-osgi" default="run"> - <property name="sample.name" value="${ant.project.name}"/> - <property name="sample.jar" value="./target/sample-${sample.name}.jar" /> - - <target name="init"> - <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"> - <classpath> - <fileset dir="../../features"> - <include name="tuscany-sca-manifest.jar" /> - </fileset> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="${sample.jar}" basedir="target/classes"> - </jar> - </target> - - <target name="run" depends="compile"> - <java jar="../../features/tuscany-sca-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <!-- optional to set the deployable composite --> - <arg value="-composite"/> - <arg value="Calculator.composite"/> - <!-- stop the node after the application runs --> - <arg value="-ttl"/> - <arg value="0"/> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="run-equinox" depends="compile"> - <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <arg value="-composite"/> - <arg value="Calculator.composite"/> - <arg value="-config"/> - <arg value="../../features/configuration"/> - <arg value="-ttl"/> - <arg value="0"/> - <arg value="${sample.jar}"/> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> -</project> - diff --git a/java/sca/samples/calculator-osgi/pom.xml b/java/sca/samples/calculator-osgi/pom.xml deleted file mode 100644 index 8ce52c70ca..0000000000 --- a/java/sca/samples/calculator-osgi/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator-osgi</artifactId> - <name>Apache Tuscany SCA Sample Calculator OSGi</name> - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository - </url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-api</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-core</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <buildcommands> - <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> - <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> - </buildcommands> - <projectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.eclipse.pde.PluginNature</projectnature> - </projectnatures> - <classpathContainers> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java deleted file mode 100644 index 4408568629..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Bundle Activator for Calculator - * - */ -public class CalculatorActivator implements BundleActivator { - private Node node; - - public void start(BundleContext context) throws Exception { - try { - NodeFactory factory = NodeFactory.newInstance(); - String url = ContributionLocationHelper.getContributionLocation(getClass()); - Contribution contrib = new Contribution("c1", url); - node = factory.createNode("Calculator.composite", contrib); - node.start(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - - public void stop(BundleContext context) throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index afd5ea48fc..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -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)); - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index c89043276e..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 39f55ca31f..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -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); - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/calculator-osgi/src/main/resources/Calculator.composite b/java/sca/samples/calculator-osgi/src/main/resources/Calculator.composite deleted file mode 100644 index 9450558145..0000000000 --- a/java/sca/samples/calculator-osgi/src/main/resources/Calculator.composite +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - 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"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - - <component name="CalculatorClient"> - <implementation.java class="calculator.CalculatorClient"/> - <reference name="calculatorService" target="CalculatorServiceComponent" /> - </component> - -</composite> diff --git a/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 9d9b0a9ffb..0000000000 --- a/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - - private static Node node; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("test", location)); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - node.start(); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node.destroy(); - } - } - - @Test - public void testDummy() throws Exception { - } -} diff --git a/java/sca/samples/calculator-rmi-reference/README b/java/sca/samples/calculator-rmi-reference/README deleted file mode 100644 index 07b6dd9713..0000000000 --- a/java/sca/samples/calculator-rmi-reference/README +++ /dev/null @@ -1,138 +0,0 @@ -Calculator RMI Reference Sample -=============================== - -This sample illustrates the use of Tuscany RMI Binding to call reference -services that are hosted as Java RMI services. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, first -navigate to the calculator-rmi-service sample and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-service.jar calculator.CalculatorServer - -and on *nix do - -java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-service.jar calculator.CalculatorServer - -Now you have the server running you need to open another command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-reference.jar calculator.CalculatorClient - -and on *nix do - -java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-reference.jar calculator.CalculatorClient - -Sample Overview ---------------- -This sample extends the calculator sample by replacing the local wired -connections with RMI bindings. Instead of local add, subtract, multiply and -divide components, an RMI service implementation now provides the -add, subtract, multiply and divide interfaces and is hosted as an RMI server. -References specified in the .composite file include an RMI binding which targets -this RMI server. - -This sample adds a number of classes to the basic calculator sample: - -calculator-rmi-reference/ - src/ - main/ - java/ - calculator/ - CalculatorService.java - as calculator sample - AddService.java - as calculator sample - SubtractService.java - as calculator sample - MultipleService.java - as calculator sample - DivideService.java - as calculator sample - CalculatorClient.java - as calculator sample - CalculatorServiceImpl.java - calls the RMI service - that provides the target for the - RMI bindings in the composite - resources/ - CalculatorRMIReference.composite - the SCA assembly for this sample - test/ - java/ - calculator/ - CalculatorRMIReferenceTestCase.java - JUnit test case - CalculatorRMIServiceImpl.java - test RMI service to call - calculator-rmi-reference.png - a pictorial representation of the - .composite file - build.xml - the Ant build file for the client - pom.xml - the Maven build file - -Note. As this test creates and uses local network connections you may need to -configure your firewall, if you are running one, to allow the test to run -successfully. - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant. - -The server provides an RMI server that the acts as a target for the SCA RMI -bindings. Start a new console and use the following commands. - -cd calculator-rmi-service -ant compile -ant run - -This will run up the server and display the following. - -run: - [java] Starting of the SCA Calculator Application exposed as RMI Services... - [java] ...Press Enter to Exit... - -The client is very similar to the calculator sample. It starts the SCA runtime -and calls each of the calculator operations. In doing this the RMI bindings -make calls out to the RMI server you started in the previous step. Start -a new console and use the following commands. - -cd calculator-rmi-reference -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 - -If you now return to the console window running the server and press enter the -server should stop. - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd calculator-rmi-reference -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running calculator.CalculatorRMIReferenceTestCase -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.308 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. - - - diff --git a/java/sca/samples/calculator-rmi-reference/build.xml b/java/sca/samples/calculator-rmi-reference/build.xml deleted file mode 100644 index e95ad1610b..0000000000 --- a/java/sca/samples/calculator-rmi-reference/build.xml +++ /dev/null @@ -1,84 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<project name="binding-rmi-calculator-reference" default="run"> - - <property name="jar.name" value="sample-calculator-rmi-reference.jar" /> - <property name="main.class" value="calculator.CalculatorClient" /> - - <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="../../modules"> - <include name="tuscany-sca-api-*.jar" /> - <include name="tuscany-node-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> - - <target name="run" depends="compile"> - <java classname="org.apache.tuscany.sca.launcher.LauncherMain" - fork="true" - failonerror="true"> - <classpath> - <pathelement location="../../bin/launcher.jar"/> - </classpath> - <arg value="unmanaged"/> - <arg value="target/${jar.name}"/> - </java> - </target> - - <!-- We need to add a client component to trigger the calculation --> - <target name="run-equinox" depends="compile"> - <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <arg value="-composite"/> - <arg value="CalculatorRMIReference.composite"/> - <arg value="-config"/> - <arg value="../../features/configuration"/> - <arg value="-ttl"/> - <arg value="0"/> - <arg value="target/${jar.name}"/> - </java> - </target> - -</project> - - diff --git a/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.png b/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.png Binary files differdeleted file mode 100644 index 8c76b77a9f..0000000000 --- a/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.png +++ /dev/null diff --git a/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.svg b/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.svg deleted file mode 100644 index ba802e6717..0000000000 --- a/java/sca/samples/calculator-rmi-reference/calculator-rmi-reference.svg +++ /dev/null @@ -1,412 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.44" - sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-reference" - sodipodi:docname="calculator-rmi-reference.svg" - version="1.0" - inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-reference\calculator-rmi-reference.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="553.58838" - inkscape:cy="368.42498" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1134" - inkscape:window-height="721" - inkscape:window-x="1" - inkscape:window-y="105" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997" - transform="matrix(0.679966,0,0,1.144214,82.34853,-27.53557)"> - <rect - rx="15.307091" - ry="12.692303" - y="192.00233" - x="258.31146" - height="299.99988" - width="495.71429" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.2674253;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="matrix(1.365843,0,0,1,-103.2086,0)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2960">Calculator</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="191.57716" - x="339.91632" - y="262.1673" - rx="6.9961648" - ry="15.892869" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(79.61125,62.65764)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Calculator</flowPara><flowPara - id="flowPara1895">Service</flowPara><flowPara - id="flowPara1897">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z " - id="path3019" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z " - id="path1883" /> - <flowRoot - xml:space="preserve" - id="flowRoot1885" - transform="translate(-46.16225,128.7269)" - style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion - id="flowRegion1887"><rect - id="rect1889" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara - id="flowPara1891">Calculator</flowPara><flowPara - id="flowPara1893">Service</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1899" - width="115.66247" - height="70.148659" - x="773.32635" - y="331.87738" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1901" - transform="translate(498.7355,125.2248)"><flowRegion - id="flowRegion1903"><rect - id="rect1905" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1907">Calculator</flowPara><flowPara - id="flowPara1909">Service</flowPara><flowPara - id="flowPara1911">RMI</flowPara><flowPara - id="flowPara2004">Impl</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 567.77069,220.86752 L 630.65876,220.86752 L 642.09292,246.48812 L 628.75306,270.13795 L 567.77069,270.13795 L 582.06342,246.48812 L 567.77069,220.86752 z " - id="path1913" /> - <flowRoot - xml:space="preserve" - id="flowRoot1965" - transform="translate(161.0221,114.967)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1967"><rect - id="rect1969" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1973">add</flowPara><flowPara - id="flowPara1977">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z " - id="path1979" /> - <flowRoot - xml:space="preserve" - id="flowRoot1981" - transform="translate(160.6632,150.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1983"><rect - id="rect1985" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1987">subtract</flowPara><flowPara - id="flowPara1989">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z " - id="path1991" /> - <flowRoot - xml:space="preserve" - id="flowRoot1993" - transform="translate(161.3775,184.2583)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1995"><rect - id="rect1997" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1999">multiply</flowPara><flowPara - id="flowPara2001">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z " - id="path2003" /> - <flowRoot - xml:space="preserve" - id="flowRoot2005" - transform="translate(159.9489,215.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2007"><rect - id="rect2009" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2011">divide</flowPara><flowPara - id="flowPara2013">Service</flowPara></flowRoot> <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305" - id="path2015" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877" - id="path2017" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591" - id="path2019" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734" - id="path2021" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 292.85714,355.52305 L 330,354.80877" - id="path2023" /> - <flowRoot - xml:space="preserve" - id="flowRoot1950" - transform="translate(301.0221,17.10977)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1952"><rect - id="rect1954" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1958">Add</flowPara><flowPara - id="flowPara1962">Reference</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 567.83889,304.45927 L 630.72696,304.45927 L 642.16112,330.07987 L 628.82126,353.7297 L 567.83889,353.7297 L 582.13162,330.07987 L 567.83889,304.45927 z " - id="path1964" /> - <flowRoot - xml:space="preserve" - id="flowRoot1966" - transform="translate(301.0903,100.7015)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1968"><rect - id="rect1970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1972">Subtract</flowPara><flowPara - id="flowPara1974">Reference</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 567.1246,382.31641 L 630.01267,382.31641 L 641.44683,407.93701 L 628.10697,431.58684 L 567.1246,431.58684 L 581.41733,407.93701 L 567.1246,382.31641 z " - id="path1976" /> - <flowRoot - xml:space="preserve" - id="flowRoot1978" - transform="translate(300.376,178.5587)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1980"><rect - id="rect1982" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1984">Multiply</flowPara><flowPara - id="flowPara1986">Reference</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 569.98175,459.45927 L 632.86982,459.45927 L 644.30398,485.07987 L 630.96412,508.7297 L 569.98175,508.7297 L 584.27448,485.07987 L 569.98175,459.45927 z " - id="path1988" /> - <flowRoot - xml:space="preserve" - id="flowRoot1990" - transform="translate(303.2332,255.7015)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1992"><rect - id="rect1994" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1996">Divide</flowPara><flowPara - id="flowPara1998">Reference</flowPara></flowRoot> <path - sodipodi:type="arc" - style="opacity:1;fill:#f19a9a;fill-opacity:1;stroke:#2e2424;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path2000" - sodipodi:cx="736.78571" - sodipodi:cy="361.95163" - sodipodi:rx="39.642857" - sodipodi:ry="38.57143" - d="M 758.87546,329.92324 A 39.642857,38.57143 0 1 1 757.94075,329.33134" - sodipodi:start="5.3034219" - sodipodi:end="11.558474" - sodipodi:open="true" - transform="translate(-22.42857,4.142857)" /> - <flowRoot - xml:space="preserve" - id="flowRoot2006" - transform="translate(411.7392,139.0467)"><flowRegion - id="flowRegion2008"><rect - id="rect2010" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2016">RMI</flowPara><flowPara - id="flowPara2018">Registry</flowPara></flowRoot> <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 642.14286,246.23734 L 692.85714,333.3802" - id="path2027" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 640.71429,330.52305 L 677.14286,350.52305" - id="path2029" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 640.71429,408.3802 L 677.85714,382.66591" - id="path2031" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 645,484.80877 L 693.57143,400.52305" - id="path2033" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 753.57143,366.95163 L 773.57143,366.95163" - id="path2035" /> - <flowRoot - xml:space="preserve" - id="flowRoot2037" - transform="translate(385.3078,69.25256)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2039"><rect - id="rect2041" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2045">RMI</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot2059" - transform="translate(371.9396,116.0363)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2061"><rect - id="rect2063" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2065">RMI</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot2067" - transform="translate(366.9396,168.8935)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2069"><rect - id="rect2071" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2073">RMI</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot2075" - transform="translate(376.9396,209.6077)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2077"><rect - id="rect2079" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2081">RMI</flowPara></flowRoot> </g> -</svg> diff --git a/java/sca/samples/calculator-rmi-reference/pom.xml b/java/sca/samples/calculator-rmi-reference/pom.xml deleted file mode 100644 index 3c95474ebc..0000000000 --- a/java/sca/samples/calculator-rmi-reference/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator-rmi-reference</artifactId> - <name>Apache Tuscany SCA Sample Calculator RMI Reference</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-rmi-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.2</version> - <configuration> - <archive> - <manifest> - <mainClass>calculator.CalculatorClient</mainClass> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java deleted file mode 100644 index a235e648c7..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the add service - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index e14cc3dd13..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIReference.composite"); - Contribution contribution = new Contribution("c1", uri); - Node node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution); - node.start(); - CalculatorService calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // Calculate - 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)); - - node.stop(); - - } - -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 0f7dec116f..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService extends Remote { - - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index bcfd8871b6..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -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); - } -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java deleted file mode 100644 index 497dafd4fd..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the divide service - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 376b3e5bb9..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the subtract service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite b/java/sca/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite deleted file mode 100644 index a5510954e0..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- 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"> - <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/> - </reference>
- <reference name="subtractService"> - <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/> - </reference>
- <reference name="multiplyService"> - <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/> - </reference>
- <reference name="divideService"> - <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/> - </reference>
- </component>
-
-</composite>
diff --git a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java b/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java deleted file mode 100644 index 39d4b2fd28..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorRMIReferenceTestCase { - - private static Node node; - private static CalculatorService calculatorService; - - @BeforeClass - public static void setUp() throws Exception { - CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl(); - Registry rmiRegistry = LocateRegistry.createRegistry(8099); - rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl); - - String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class); - Contribution contribution = new Contribution("c1", uri); - node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution); - node.start(); - calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - LocateRegistry.getRegistry(8099).unbind("CalculatorRMIService"); - } - - @Test - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0, 0.0); - assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0); - assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0); - assertEquals(calculatorService.divide(3, 2), 1.5, 0.0); - } -} diff --git a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java b/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java deleted file mode 100644 index d8ded42cb2..0000000000 --- a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.rmi.RemoteException; -import java.rmi.server.UnicastRemoteObject; - - - -/** - * An implementation of the Calculator service. - */ -public class CalculatorRMIServiceImpl extends UnicastRemoteObject implements CalculatorService { - - private static final long serialVersionUID = -1543948944662001428L; - - public CalculatorRMIServiceImpl() throws RemoteException { - super(); - } - - public double add(double n1, double n2) throws RemoteException { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } -} diff --git a/java/sca/samples/calculator-rmi-service/README b/java/sca/samples/calculator-rmi-service/README deleted file mode 100644 index 144881134b..0000000000 --- a/java/sca/samples/calculator-rmi-service/README +++ /dev/null @@ -1,147 +0,0 @@ -Calculator RMI Service Sample -============================= - -This sample illustrates the use of Tuscany RMI Binding to expose component -services as Java RMI Services. It also demonstrates how a simple Java RMI -Client application invokes the SCA Application's services exposed as RMI -Services. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-service.jar calculator.CalculatorServer - -and on *nix do - -java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-service.jar calculator.CalculatorServer - -Now you have the server running you need to open another command prompt, navigate -to the calculator-rmi-reference sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-rmi-reference.jar calculator.CalculatorClient - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-rmi-reference.jar calculator.CalculatorClient - - -Sample Overview ---------------- -This sample extends the calculator sample by replacing the local service -binding with an RMI binding. SO a java client can call the service exposed -by the SCA application using an RMI client. - -This sample adds a number of classes to the basic calculator sample: - -calculator-rmi-service/ - src/ - main/ - java/ - calculator/ - CalculatorService.java - as calculator sample - CalculatorServiceImpl.java - AddService.java - as calculator sample - AddServiceImpl.java - SubtractService.java - as calculator sample - SubtractServiceImpl.java - MultiplyService.java - as calculator sample - MultiplyServiceImpl.java - DivideService.java - as calculator sample - DivideServiceImpl.java - CalculatorClient.java - (Not currently used) Uses the - java naming service to - look up the Calculator RMI service. - It then calls add, subtract, multiple - and divide methods on the service - CalculatorServer.java - starts the SCA Runtime and deploys - the CalculatorRMIServer.composite. - In doing this the SCA RMI binding - acts to expose the CalculatorService - over RMI. - resources/ - CalculatorRMIServer.composite - the SCA assembly for this sample - test/ - java/ - calculator/ - CalculatorRMIServerTestCase.java - JUnit test case - calculator-rmi-service.png - a pictorial representation of the - .composite file - build.xml - the Ant build file for the server - pom.xml - the Maven build file - -Note. As this test creates and uses local network connections you may need to -configure your firewall, if you are running one, to allow the test to run -successfully. - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant. Two -build files are used to support client and server functions. - -The server starts the SCA runtime and loads the SCA calculator application -which exposes an RMI service. Start a new console and use the following -commands. - -cd calculator-rmi-service -ant compile -ant run - -This will run up the server and display the following. - -run: - [java] Starting of the SCA Calculator Application exposed as RMI Services... - [java] ...Press Enter to Exit... - -The client is very similar to the calculator sample - -It locates the RMI service that the SCA runtime is exposing and calls each of -the calculator operations. Start a new console and use the following commands. - -cd calculator-rmi-reference -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 - -If you now return to the console window running the server and press enter the -server should stop. - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd calculator-rmi-service -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running calculator.CalculatorRMIServerTestCase -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.819 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/java/sca/samples/calculator-rmi-service/build.xml b/java/sca/samples/calculator-rmi-service/build.xml deleted file mode 100644 index a0889ccc8a..0000000000 --- a/java/sca/samples/calculator-rmi-service/build.xml +++ /dev/null @@ -1,76 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<project name="binding-rmi-calculator-service" default="run"> - - <property name="jar.name" value="sample-calculator-rmi-service.jar" /> - <property name="main.class" value="calculator.CalculatorClient" /> - - <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="../../modules"> - <include name="tuscany-sca-api-*.jar" /> - <include name="tuscany-node-api-*.jar" /> - </fileset> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${jar.name}" basedir="target/classes"> - </jar> - </target> - - <target name="run" depends="compile"> - <java classname="org.apache.tuscany.sca.launcher.LauncherMain" - fork="true" - failonerror="true"> - <classpath> - <pathelement location="../../bin/launcher.jar"/> - </classpath> - <arg value="target/${jar.name}"/> - </java> - </target> - - <target name="run-equinox" depends="compile"> - <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true"> - <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/> - <arg value="-config"/> - <arg value="../../features/configuration"/> - <arg value="target/${jar.name}"/> - </java> - </target> - - -</project> - - diff --git a/java/sca/samples/calculator-rmi-service/calculator-rmi-service.png b/java/sca/samples/calculator-rmi-service/calculator-rmi-service.png Binary files differdeleted file mode 100644 index 574f5eb14b..0000000000 --- a/java/sca/samples/calculator-rmi-service/calculator-rmi-service.png +++ /dev/null diff --git a/java/sca/samples/calculator-rmi-service/calculator-rmi-service.svg b/java/sca/samples/calculator-rmi-service/calculator-rmi-service.svg deleted file mode 100644 index 9253110f98..0000000000 --- a/java/sca/samples/calculator-rmi-service/calculator-rmi-service.svg +++ /dev/null @@ -1,330 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.44" - sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-service" - sodipodi:docname="calculator-rmi-service.svg" - version="1.0" - inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-service\calculator-rmi-service.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="471.80491" - inkscape:cy="378.84265" - inkscape:document-units="px" - inkscape:current-layer="layer1" - inkscape:window-width="1054" - inkscape:window-height="721" - inkscape:window-x="186" - inkscape:window-y="165" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997" - transform="matrix(1,0,0,1.144214,0,-27.53557)"> - <rect - rx="15.307091" - ry="12.692303" - y="192.00233" - x="258.31146" - height="299.99988" - width="495.71429" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2960">Calculator</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="191.57716" - x="339.91632" - y="262.1673" - rx="6.9961648" - ry="15.892869" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(79.61125,62.65764)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Calculator</flowPara><flowPara - id="flowPara1895">Service</flowPara><flowPara - id="flowPara1897">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z " - id="path3019" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z " - id="path1883" /> - <flowRoot - xml:space="preserve" - id="flowRoot1885" - transform="translate(-46.16225,128.7269)" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1887"><rect - id="rect1889" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1891">Calculator</flowPara><flowPara - id="flowPara1893">Service</flowPara><flowPara - id="flowPara1950">(RMI)</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1899" - width="115.66247" - height="70.148659" - x="594.75488" - y="209.73451" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1901" - transform="translate(334.4498,10.22481)"><flowRegion - id="flowRegion1903"><rect - id="rect1905" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1907">Add</flowPara><flowPara - id="flowPara1909">Service</flowPara><flowPara - id="flowPara1911">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z " - id="path1913" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1917" - width="115.66247" - height="70.148659" - x="594.06543" - y="292.59158" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1919" - transform="translate(333.7604,93.08188)"><flowRegion - id="flowRegion1921"><rect - id="rect1923" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1925">Subtract</flowPara><flowPara - id="flowPara1927">Service</flowPara><flowPara - id="flowPara1929">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z " - id="path1931" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1933" - width="115.66247" - height="70.148659" - x="594.77979" - y="371.87729" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1935" - transform="translate(334.4747,172.3676)"><flowRegion - id="flowRegion1937"><rect - id="rect1939" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1941">Multiply</flowPara><flowPara - id="flowPara1943">Service</flowPara><flowPara - id="flowPara1945">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z " - id="path1947" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1949" - width="115.66247" - height="70.148659" - x="596.20831" - y="452.59158" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1951" - transform="translate(335.9032,253.0819)"><flowRegion - id="flowRegion1953"><rect - id="rect1955" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1957">Divide</flowPara><flowPara - id="flowPara1959">Service</flowPara><flowPara - id="flowPara1961">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z " - id="path1963" /> - <flowRoot - xml:space="preserve" - id="flowRoot1965" - transform="translate(161.0221,114.967)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1967"><rect - id="rect1969" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1973">add</flowPara><flowPara - id="flowPara1977">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z " - id="path1979" /> - <flowRoot - xml:space="preserve" - id="flowRoot1981" - transform="translate(160.6632,150.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1983"><rect - id="rect1985" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1987">subtract</flowPara><flowPara - id="flowPara1989">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z " - id="path1991" /> - <flowRoot - xml:space="preserve" - id="flowRoot1993" - transform="translate(161.3775,184.2583)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1995"><rect - id="rect1997" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1999">multiply</flowPara><flowPara - id="flowPara2001">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z " - id="path2003" /> - <flowRoot - xml:space="preserve" - id="flowRoot2005" - transform="translate(159.9489,215.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2007"><rect - id="rect2009" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2011">divide</flowPara><flowPara - id="flowPara2013">Service</flowPara></flowRoot> <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305" - id="path2015" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877" - id="path2017" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591" - id="path2019" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734" - id="path2021" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 292.85714,355.52305 L 330,354.80877" - id="path2023" /> - </g> -</svg> diff --git a/java/sca/samples/calculator-rmi-service/pom.xml b/java/sca/samples/calculator-rmi-service/pom.xml deleted file mode 100644 index 0c96583b98..0000000000 --- a/java/sca/samples/calculator-rmi-service/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator-rmi-service</artifactId> - <name>Apache Tuscany SCA Sample Calculator RMI Service</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-rmi-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java deleted file mode 100644 index a235e648c7..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the add service - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 8b6fe066a6..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - return n1 + n2; - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 2b99485b68..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import java.rmi.Naming; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - CalculatorService calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService"); - - // Calculate - 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)); - - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java deleted file mode 100644 index b77015bcae..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * A claculator service server. Starts up the SCA runtime which - * will start listening for RMI service requests. - */ -public class CalculatorServer { - public static void main(String[] args) throws Exception { - System.out.println("Starting of the SCA Calculator Application exposed as RMI Services..."); - String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIServer.composite"); - Contribution contribution = new Contribution("c1", uri); - Node node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution); - node.start(); - System.out.println("... Press Enter to Exit..."); - System.in.read(); - node.stop(); - System.out.println("Exited..."); - System.exit(0); - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 3c0375924f..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index bcfd8871b6..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -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); - } -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java deleted file mode 100644 index 497dafd4fd..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the divide service - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index f7ac0b7287..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - return n1 / n2; - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index b7dca792b2..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - return n1 * n2; - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 376b3e5bb9..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the subtract service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 77b128ab8d..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - return n1 - n2; - } - -} diff --git a/java/sca/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite b/java/sca/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite deleted file mode 100644 index 02614ad6e1..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- 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"/> - <service name="CalculatorService"> - <interface.java interface="calculator.CalculatorService"/> - <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/> - </service> - <reference name="addService" target="AddServiceComponent"></reference>
- <reference name="subtractService" target="SubtractServiceComponent"></reference>
- <reference name="multiplyService" target="MultiplyServiceComponent"></reference>
- <reference name="divideService" target="DivideServiceComponent"></reference>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-</composite>
diff --git a/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 27a1ee74e4..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:sample="http://sample"> - <deployable composite="sample:Calculator"/> -</contribution>
\ No newline at end of file diff --git a/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java b/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java deleted file mode 100644 index 0e352db9bb..0000000000 --- a/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import java.rmi.Naming; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorRMIServerTestCase { - - private static Node node; - private static CalculatorService calculatorService; - - @BeforeClass - public static void setUp() throws Exception { - String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class); - Contribution contribution = new Contribution("c1", uri); - node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution); - node.start(); - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testCalculator() throws Exception { - // Calculate - calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService"); - assertEquals(calculatorService.add(3, 2), 5.0, 0.0); - assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0); - assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0); - assertEquals(calculatorService.divide(3, 2), 1.5, 0.0); - } -} diff --git a/java/sca/samples/calculator/README b/java/sca/samples/calculator/README deleted file mode 100644 index 56c22d9c89..0000000000 --- a/java/sca/samples/calculator/README +++ /dev/null @@ -1,97 +0,0 @@ -Calculator Sample -================= -This sample implements a simple calculator using SCA components. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient - -and on *nix do - -java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient - -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. - -calculator/ - src/ - main/ - java/ - calculator/ - CalculatorService.java - the first component, calls +-/* as - appropriate - CalculatorServiceImpl.java - AddService.java - adds two numbers - AddServiceImpl.java - SubtractService.java - subtracts one number from another - SubtractServiceImpl.java - MultiplyService.java - multiplies two numbers - MultiplyServiceImpl.java - DivideService.java - divides one number by another - DivideServiceImpl.java - CalculatorClient.java - starts the SCA Runtime and - deploys the Calculator.composite. - It then calls the deployed Calculator - Components services - resources/ - Calculator.composite - the SCA assembly for this sample - test/ - java/ - calculator/ - CalculatorTestCase.java - JUnit test case - calculator.png - a pictorial representation of the sample - .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant as -follows - -cd calculator -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd calculator -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running calculator.CalculatorTestCase -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/java/sca/samples/calculator/build.xml b/java/sca/samples/calculator/build.xml deleted file mode 100644 index 4411cae659..0000000000 --- a/java/sca/samples/calculator/build.xml +++ /dev/null @@ -1,65 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<project name="calculator" default="run"> - - <property name="jar.name" value="sample-calculator.jar" /> - <property name="main.class" value="calculator.CalculatorClient" /> - - <target name="compile" depends="init"> - <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5"> - <classpath> - <fileset dir="../../modules"> - <include name="tuscany-sca-api-*.jar" /> - <include name="tuscany-node-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> - - <target name="init"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - <mkdir dir="target/classes"/> - </target> - - <target name="run" depends="compile"> - <java classname="org.apache.tuscany.sca.launcher.LauncherMain" - fork="true" - failonerror="true"> - <classpath> - <pathelement location="../../bin/launcher.jar"/> - </classpath> - <arg value="unmanaged"/> - <arg value="target/${jar.name}"/> - </java> - </target> - -</project> - - diff --git a/java/sca/samples/calculator/calculator.png b/java/sca/samples/calculator/calculator.png Binary files differdeleted file mode 100644 index 995a57b1fd..0000000000 --- a/java/sca/samples/calculator/calculator.png +++ /dev/null diff --git a/java/sca/samples/calculator/calculator.svg b/java/sca/samples/calculator/calculator.svg deleted file mode 100644 index 0615925c50..0000000000 --- a/java/sca/samples/calculator/calculator.svg +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.44" - sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator" - sodipodi:docname="calculator.svg" - version="1.0" - inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="471.80491" - inkscape:cy="378.84265" - inkscape:document-units="px" - inkscape:current-layer="layer1" - inkscape:window-width="1054" - inkscape:window-height="721" - inkscape:window-x="59" - inkscape:window-y="79" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997" - transform="matrix(1,0,0,1.144214,0,-27.53557)"> - <rect - rx="15.307091" - ry="12.692303" - y="192.00233" - x="258.31146" - height="299.99988" - width="495.71429" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2960">Calculator</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="191.57716" - x="339.91632" - y="262.1673" - rx="6.9961648" - ry="15.892869" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(79.61125,62.65764)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Calculator</flowPara><flowPara - id="flowPara1895">Service</flowPara><flowPara - id="flowPara1897">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z " - id="path3019" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z " - id="path1883" /> - <flowRoot - xml:space="preserve" - id="flowRoot1885" - transform="translate(-46.16225,128.7269)" - style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion - id="flowRegion1887"><rect - id="rect1889" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara - id="flowPara1891">Calculator</flowPara><flowPara - id="flowPara1893">Service</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1899" - width="115.66247" - height="70.148659" - x="594.75488" - y="209.73451" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1901" - transform="translate(334.4498,10.22481)"><flowRegion - id="flowRegion1903"><rect - id="rect1905" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1907">Add</flowPara><flowPara - id="flowPara1909">Service</flowPara><flowPara - id="flowPara1911">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z " - id="path1913" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1917" - width="115.66247" - height="70.148659" - x="594.06543" - y="292.59158" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1919" - transform="translate(333.7604,93.08188)"><flowRegion - id="flowRegion1921"><rect - id="rect1923" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1925">Subtract</flowPara><flowPara - id="flowPara1927">Service</flowPara><flowPara - id="flowPara1929">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z " - id="path1931" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1933" - width="115.66247" - height="70.148659" - x="594.77979" - y="371.87729" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1935" - transform="translate(334.4747,172.3676)"><flowRegion - id="flowRegion1937"><rect - id="rect1939" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1941">Multiply</flowPara><flowPara - id="flowPara1943">Service</flowPara><flowPara - id="flowPara1945">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z " - id="path1947" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect1949" - width="115.66247" - height="70.148659" - x="596.20831" - y="452.59158" - rx="6.9961648" - ry="5.8193965" /> - <flowRoot - xml:space="preserve" - id="flowRoot1951" - transform="translate(335.9032,253.0819)"><flowRegion - id="flowRegion1953"><rect - id="rect1955" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara1957">Divide</flowPara><flowPara - id="flowPara1959">Service</flowPara><flowPara - id="flowPara1961">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z " - id="path1963" /> - <flowRoot - xml:space="preserve" - id="flowRoot1965" - transform="translate(161.0221,114.967)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1967"><rect - id="rect1969" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1973">add</flowPara><flowPara - id="flowPara1977">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z " - id="path1979" /> - <flowRoot - xml:space="preserve" - id="flowRoot1981" - transform="translate(160.6632,150.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1983"><rect - id="rect1985" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1987">subtract</flowPara><flowPara - id="flowPara1989">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z " - id="path1991" /> - <flowRoot - xml:space="preserve" - id="flowRoot1993" - transform="translate(161.3775,184.2583)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1995"><rect - id="rect1997" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1999">multiply</flowPara><flowPara - id="flowPara2001">Service</flowPara></flowRoot> <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z " - id="path2003" /> - <flowRoot - xml:space="preserve" - id="flowRoot2005" - transform="translate(159.9489,215.6868)" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion2007"><rect - id="rect2009" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara2011">divide</flowPara><flowPara - id="flowPara2013">Service</flowPara></flowRoot> <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305" - id="path2015" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877" - id="path2017" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591" - id="path2019" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734" - id="path2021" /> - <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 292.85714,355.52305 L 330,354.80877" - id="path2023" /> - </g> -</svg> diff --git a/java/sca/samples/calculator/pom.xml b/java/sca/samples/calculator/pom.xml deleted file mode 100644 index 3d218bd27b..0000000000 --- a/java/sca/samples/calculator/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator</artifactId> - <name>Apache Tuscany SCA Sample Calculator</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.2</version> - <configuration> - <archive> - <manifest> - <mainClass>calculator.CalculatorClient</mainClass> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/java/sca/samples/calculator/src/main/java/calculator/AddService.java b/java/sca/samples/calculator/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/calculator/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index bb75bb2337..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Add service - */ -@Service(AddService.class) -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index b1855c45e2..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.apache.tuscany.sca.node.Client; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - - String contribution = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - Node node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("calculator", contribution)); - - node.start(); - - CalculatorService calculatorService = ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent"); - - // Calculate - 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)); - - node.stop(); - } - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 031fa8b912..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index fc53393d23..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -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); - } - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/calculator/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index b1250ed9f2..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Divide service. - */ -@Service(DivideService.class) -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 11f68c66e3..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Multiply service. - */ -@Service(MultiplyService.class) -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 30e59bf668..0000000000 --- a/java/sca/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the subtract service. - */ -@Service(SubtractService.class) -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/calculator/src/main/resources/Calculator.composite b/java/sca/samples/calculator/src/main/resources/Calculator.composite deleted file mode 100644 index f67b212d99..0000000000 --- a/java/sca/samples/calculator/src/main/resources/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - 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"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 27a1ee74e4..0000000000 --- a/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:sample="http://sample"> - <deployable composite="sample:Calculator"/> -</contribution>
\ No newline at end of file diff --git a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 73c7d872b9..0000000000 --- a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.node.Client; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorTestCase{ - private static Node node; - private static CalculatorService calculatorService; - - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - node = factory.createNode("Calculator.composite", new Contribution("calculator", contribution)).start(); - // node = factory.createNode().start(); - - calculatorService = ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent"); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - node.stop(); - } - - @Test - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0, 0); - assertEquals(calculatorService.subtract(3, 2), 1.0, 0); - assertEquals(calculatorService.multiply(3, 2), 6.0, 0); - assertEquals(calculatorService.divide(3, 2), 1.5, 0); - } -} diff --git a/java/sca/samples/dosgi-calculator-operations/LICENSE b/java/sca/samples/dosgi-calculator-operations/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/java/sca/samples/dosgi-calculator-operations/META-INF/MANIFEST.MF b/java/sca/samples/dosgi-calculator-operations/META-INF/MANIFEST.MF deleted file mode 100644 index 82a803e3a6..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0
-Export-Package: calculator.dosgi.operations;version="1.0.0"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi.operations
-Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator
-Bundle-ManifestVersion: 2
-Import-Package: calculator.dosgi.operations;version="[1.0.0,1.0.0]",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin
-Bundle-SymbolicName: calculator.dosgi.operations
-Bundle-Vendor: The Apache Software Foundation
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Service-Component-Disabled: OSGI-INF/add-component.xml,
- OSGI-INF/subtract-component.xml,
- OSGI-INF/multiply-component.xml,
- OSGI-INF/divide-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/java/sca/samples/dosgi-calculator-operations/NOTICE b/java/sca/samples/dosgi-calculator-operations/NOTICE deleted file mode 100644 index 51042eab05..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml deleted file mode 100644 index 99845257ff..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.AddServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.AddService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml deleted file mode 100644 index f6b5f4690e..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) --> -<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <component id="AddComponent" class="calculator.dosgi.operations.impl.AddServiceImpl"> - </component> - <component id="SubtractComponent" class="calculator.dosgi.operations.impl.SubtractServiceImpl"> - </component> - <component id="MultiplyComponent" class="calculator.dosgi.operations.impl.MultiplyServiceImpl"> - </component> - <component id="DivideComponent" class="calculator.dosgi.operations.impl.DivideServiceImpl"> - </component> - - <!-- We can derive the SCA services for the implementation.osgi --> - <service id="AddService" ref="AddComponent" interface="calculator.dosgi.operations.AddService"> - </service> - <service id="SubtractService" ref="SubtractComponent" interface="calculator.dosgi.operations.SubtractService"> - </service> - <service id="MultiplyService" ref="MultiplyComponent" interface="calculator.dosgi.operations.MultiplyService"> - </service> - <service id="DivideService" ref="DivideComponent" interface="calculator.dosgi.operations.DivideService"> - </service> -</components>
\ No newline at end of file diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml deleted file mode 100644 index 322d4daf2f..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.DivideServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.DivideService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml deleted file mode 100644 index b9ca777bd8..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.MultiplyServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.MultiplyService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType deleted file mode 100644 index 72e2c339f1..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"> - - - <!-- The service elment defines an SCA proxy to a remote OSGi service --> - <service name="AddService"> - <interface.java interface="calculator.dosgi.operations.AddService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </service> - <service name="SubtractService"> - <interface.java interface="calculator.dosgi.operations.SubtractService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </service> - <service name="MultiplyService"> - <interface.java interface="calculator.dosgi.operations.MultiplyService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </service> - <service name="DivideService"> - <interface.java interface="calculator.dosgi.operations.DivideService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </service> - -</componentType> diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite deleted file mode 100644 index 253f7d0df1..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://calculator.dosgi" - name="OperationsComposite"> - - <component name="OperationsComponent"> - <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" /> - <service name="AddService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/> - </service> - <service name="SubtractService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/> - </service> - <service name="MultiplyService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/> - </service> - <service name="DivideService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/> - </service> - - </component> - -</composite> diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml deleted file mode 100644 index 1472f5a976..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.SubtractServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.SubtractService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-calculator-operations/README b/java/sca/samples/dosgi-calculator-operations/README deleted file mode 100644 index e533bfcdb6..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/README +++ /dev/null @@ -1,183 +0,0 @@ -Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
-INFO: Equinox-based service discoverer is now configured.
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-calculator-operations.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Starting calculator.dosgi.operations_1.0.0 [198]
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.AddService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.SubtractService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.MultiplyService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.DivideService
-Nov 4, 2009 9:51:56 AM calculator.dosgi.operations.impl.OperationsActivator getB
-undle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.operations
-Nov 4, 2009 9:51:56 AM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: calculator.dosgi.operations domain: tuscany.apache.org
-Nov 4, 2009 9:51:56 AM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadCont
-ributions
-INFO: Loading contribution: bundleentry://198.fwk8152936/
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/AddService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@27845948)Endpoint: URI = OperationsComponent#service-bin
-ding(AddService/AddService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@10576215)Endpoint: URI = OperationsComponent#service-bin
-ding(SubtractService/SubtractService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@31713234)Endpoint: URI = OperationsComponent#service-bin
-ding(MultiplyService/MultiplyService)
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/DivideService
-Nov 4, 2009 9:52:00 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@10202447)Endpoint: URI = OperationsComponent#service-bin
-ding(DivideService/DivideService)
-
-osgi>
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: calculator.dosgi.operations
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@27845948)Endpoint: URI = OperationsComponent#service-
-binding(AddService/AddService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/AddService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@10576215)Endpoint: URI = OperationsComponent#service-
-binding(SubtractService/SubtractService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@31713234)Endpoint: URI = OperationsComponent#service-
-binding(MultiplyService/MultiplyService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@10202447)Endpoint: URI = OperationsComponent#service-
-binding(DivideService/DivideService)
-Nov 4, 2009 9:53:19 AM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/DivideService
-Nov 4, 2009 9:53:19 AM calculator.dosgi.operations.impl.OperationsActivator stop
-
-INFO: Stopping calculator.dosgi.operations_1.0.0 [198]
-
-osgi>
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-calculator-operations)
-
-
-dosgi-calculator-operations/
- src/
- main/
- java/
- calculator/
- dosgi/
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- impl/
- OperationsActivator.java - OSGi bundle activator
- AddServiceImpl.java - Implementation for Add
- SubtractServiceImpl.java - Implementation for Subtract
- MultiplyServiceImpl.java - Implementation for Multiply
- DivideServiceImpl.java - Implementation for Divide
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca/
- bundle.componentType - The component type for implementation.osgi of this bundle
- bundle.composite - The composite file
- test/
- java/
- src/
- calculator/
- dosgi/
- operations/
- test/
- OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator-operations
-mvn
-
diff --git a/java/sca/samples/dosgi-calculator-operations/pom.xml b/java/sca/samples/dosgi-calculator-operations/pom.xml deleted file mode 100644 index af8b8f7690..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/pom.xml +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>sample-dosgi-calculator-operations</artifactId> - <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Operations Sample</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-ejava</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl-osgi</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.osgi</groupId> - <artifactId>services</artifactId> - <version>3.2.0-v20090520-1800</version> - <scope>test</scope> - </dependency> - - <!-- Equinox Declarative Services --> - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>ds</artifactId> - <version>1.1.0-v20090601</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>util</artifactId> - <version>1.0.100-v20090520-1800</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <buildcommands> - <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> - <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> - </buildcommands> - <projectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.eclipse.pde.PluginNature</projectnature> - </projectnatures> - <classpathContainers> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java deleted file mode 100644 index 66b2977241..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.AddService; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java deleted file mode 100644 index a3c21b2b96..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.DivideService; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java deleted file mode 100644 index 7922d2d392..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.MultiplyService; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java deleted file mode 100644 index da2ce9063a..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * - */ -public class OperationsActivator implements BundleActivator { - private Logger logger = Logger.getLogger(OperationsActivator.class.getName()); - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - - Dictionary<String, Object> props = new Hashtable<String, Object>(); - - logger.info("Registering " + AddService.class.getName()); - props.put("sca.service", "AddComponent#service-name(Add)"); - context.registerService(AddService.class.getName(), new AddServiceImpl(), props); - - logger.info("Registering " + SubtractService.class.getName()); - props.put("sca.service", "SubtractComponent#service-name(Subtract)"); - context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props); - - logger.info("Registering " + MultiplyService.class.getName()); - props.put("sca.service", "MultiplyComponent#service-name(Multiply)"); - context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props); - - logger.info("Registering " + DivideService.class.getName()); - props.put("sca.service", "DivideComponent#service-name(Divide)"); - context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props); - - getBundle(context, AddService.class); - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - - private Bundle getBundle(BundleContext bundleContext, Class<?> cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java deleted file mode 100644 index 4bbe83b14f..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 16a33f4f65..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:c="http://calculator.dosgi"> - <deployable composite="c:OperationsComposite" /> -</contribution> diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java deleted file mode 100644 index cd92989da1..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param <T> - * @param obj - * @param cls - * @return - */ - public static <T> T cast(Object obj, Class<T> cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class<?>[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java deleted file mode 100644 index 02007c385c..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class OperationsNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java deleted file mode 100644 index 49c5aab041..0000000000 --- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; - -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class OperationsOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle operationsBundle; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.operations".equals(b.getSymbolicName())) { - operationsBundle = b; - } - } - - if (operationsBundle != null) { - operationsBundle.start(); - System.out.println(bundleStatus(operationsBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() throws Exception { - Registry registry = LocateRegistry.getRegistry(8085); - Object add = registry.lookup("AddService"); - AddService addService = OSGiTestUtils.cast(add, AddService.class); - double sum = addService.add(1.0, 2.0); - Assert.assertEquals(3.0, sum, 0.0); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - context = null; - } - } - -} diff --git a/java/sca/samples/dosgi-calculator/LICENSE b/java/sca/samples/dosgi-calculator/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/java/sca/samples/dosgi-calculator/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/java/sca/samples/dosgi-calculator/META-INF/MANIFEST.MF b/java/sca/samples/dosgi-calculator/META-INF/MANIFEST.MF deleted file mode 100644 index 542b53b085..0000000000 --- a/java/sca/samples/dosgi-calculator/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0
-Export-Package: calculator.dosgi;version="1.0.0",
- calculator.dosgi.operations;version="1.0.0"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi
-Bundle-Activator: calculator.dosgi.impl.CalculatorActivator
-Bundle-ManifestVersion: 2
-Import-Package: org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin,
- org.osgi.util.tracker
-Bundle-SymbolicName: calculator.dosgi
-Bundle-Vendor: The Apache Software Foundation
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Service-Component-Disabled: OSGI-INF/calculator-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/java/sca/samples/dosgi-calculator/NOTICE b/java/sca/samples/dosgi-calculator/NOTICE deleted file mode 100644 index 51042eab05..0000000000 --- a/java/sca/samples/dosgi-calculator/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml b/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml deleted file mode 100644 index fd834e12ef..0000000000 --- a/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) --> -<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl"> - <property name="addService" ref="AddService" /> - <property name="subtractService" ref="SubtractService" /> - <property name="multiplyService" ref="MultiplyService" /> - <property name="divideService" ref="DivideService" /> - </component> - - <!-- We can derive the SCA services for the implementation.osgi --> - <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService"> - </service> - - <!-- We can derive the SCA references for the implementation.osgi --> - <reference id="AddService" interface="calculator.dosgi.operations.AddService"> - </reference> - <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService"> - </reference> - <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService"> - </reference> - <reference id="DivideService" interface="calculator.dosgi.operations.DivideService"> - </reference> - -</components>
\ No newline at end of file diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml b/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml deleted file mode 100644 index 5daaa59aae..0000000000 --- a/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="CalculatorComponent" - xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" /> - <service> - <provide interface="calculator.dosgi.CalculatorService" /> - </service> - - <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService" - policy="dynamic" /> - <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService" - unbind="unsetSubtractService" policy="dynamic" /> - <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService" - unbind="unsetMultiplyService" policy="dynamic" /> - <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService" - unbind="unsetDivideService" policy="dynamic" /> - -</scr:component> diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType deleted file mode 100644 index 769bcdd14d..0000000000 --- a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"> - <!-- The service elment defines an SCA view of the OSGi service --> - <service name="CalculatorService"> - <!-- The interface will be mapped into the OSGi service class --> - <interface.java interface="calculator.dosgi.CalculatorService"/> - <!-- The list of OSGi properties --> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </service> - - <!-- The reference elment defines an SCA proxy to a remote OSGi service --> - <reference name="addService"> - <interface.java interface="calculator.dosgi.operations.AddService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </reference> - <reference name="subtractService"> - <interface.java interface="calculator.dosgi.operations.SubtractService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </reference> - <reference name="multiplyService"> - <interface.java interface="calculator.dosgi.operations.MultiplyService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </reference> - <reference name="divideService"> - <interface.java interface="calculator.dosgi.operations.DivideService"/> - <t:osgi.property name="prop1">1</t:osgi.property> - <t:osgi.property name="prop2">ABC</t:osgi.property> - </reference> - -</componentType> diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite deleted file mode 100644 index 481fd67e09..0000000000 --- a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://calculator.dosgi" - name="CalculatorComposite"> - - <component name="CalculatorComponent"> - <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" /> - <service name="CalculatorService"> - <binding.ws uri="http://localhost:8086/CalculatorService"/> - </service> - <reference name="addService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/> - </reference> - <reference name="subtractService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/> - </reference> - <reference name="multiplyService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/> - </reference> - <reference name="divideService"> - <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/> - </reference> - </component> - -</composite> diff --git a/java/sca/samples/dosgi-calculator/README b/java/sca/samples/dosgi-calculator/README deleted file mode 100644 index d8aa13497a..0000000000 --- a/java/sca/samples/dosgi-calculator/README +++ /dev/null @@ -1,140 +0,0 @@ -Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-calculator.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 9:40:00 AM calculator.dosgi.impl.CalculatorActivator start
-INFO: Starting calculator.dosgi_1.0.0 [198]
-Nov 4, 2009 9:40:01 AM calculator.dosgi.impl.CalculatorActivator start
-INFO: Registering calculator.dosgi.CalculatorService
-Nov 4, 2009 9:40:01 AM calculator.dosgi.impl.CalculatorActivator getBundle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi
-Nov 4, 2009 9:40:01 AM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: calculator.dosgi domain: tuscany.apache.org
-Nov 4, 2009 9:40:01 AM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadCont
-ributions
-INFO: Loading contribution: bundleentry://198.fwk15020296/
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Nov 4, 2009 9:40:47 AM org.mortbay.log.Slf4jLog info
-INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
-bay.log.Slf4jLog
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: jetty-6.1.x
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: Started SelectChannelConnector@0.0.0.0:8086
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
-apping
-INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
-Nov 4, 2009 9:40:48 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@1277930)Endpoint: URI = CalculatorComponent#service-bind
-ing(CalculatorService/CalculatorService)
-osgi>
-
-You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
-the WSDL.
-
-You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: calculator.dosgi
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@1277930)Endpoint: URI = CalculatorComponent#service-b
-inding(CalculatorService/CalculatorService)
-Nov 4, 2009 9:41:22 AM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
-etMapping
-INFO: Removed Servlet mapping: /CalculatorService
-Nov 4, 2009 9:41:22 AM calculator.dosgi.impl.CalculatorActivator stop
-INFO: Stopping calculator.dosgi_1.0.0 [198]
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-calculator-operations)
-
-
-dosgi-calculator/
- src/
- main/
- java/
- calculator/
- dosgi/
- CalculatorService.java - The interface for Calculator service
- impl/
- CalculatorActivator.java - OSGi bundle activator for Calculator bundle
- CalculatorServiceDSImpl.java - OSGi declarative service based implementation
- CalculatorServiceImpl.java - Basic OSGi implementation
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- rmi/
- OperationsRemote.java - RMI remote interface for operations
- OperationsRMIServer_Stub.java - RMI stub
- OperationsRMIServer.java - RMI server implementation of the operations
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca/
- bundle.componentType - The component type for implementation.osgi of this bundle
- bundle.composite - The composite file
- test/
- java/
- src/
- calculator/
- dosgi/
- test/
- CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- dosig-calculator.png - a pictorial representation of the sample
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator
-mvn
-
diff --git a/java/sca/samples/dosgi-calculator/dosgi-calculator.png b/java/sca/samples/dosgi-calculator/dosgi-calculator.png Binary files differdeleted file mode 100644 index 805baa54d2..0000000000 --- a/java/sca/samples/dosgi-calculator/dosgi-calculator.png +++ /dev/null diff --git a/java/sca/samples/dosgi-calculator/pom.xml b/java/sca/samples/dosgi-calculator/pom.xml deleted file mode 100644 index 8dfddd6dc2..0000000000 --- a/java/sca/samples/dosgi-calculator/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>sample-dosgi-calculator</artifactId> - <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Sample</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-ejava</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-webservice</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl-osgi</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.osgi</groupId> - <artifactId>services</artifactId> - <version>3.2.0-v20090520-1800</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - <!-- Equinox Declarative Services --> - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>ds</artifactId> - <version>1.1.0-v20090601</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>util</artifactId> - <version>1.0.100-v20090520-1800</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <buildcommands> - <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> - <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> - </buildcommands> - <projectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.eclipse.pde.PluginNature</projectnature> - </projectnatures> - <classpathContainers> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java deleted file mode 100644 index cc562b7c2f..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java deleted file mode 100644 index 6b42645f69..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class CalculatorActivator implements BundleActivator { - private Logger logger = Logger.getLogger(CalculatorActivator.class.getName()); - - private Bundle getBundle(BundleContext bundleContext, Class<?> cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - Dictionary<String, Object> props = new Hashtable<String, Object>(); - props.put("sca.service", "CalculatorComponent#service-name(Calculator)"); - props.put("calculator", "Calculator"); - - logger.info("Registering " + CalculatorService.class.getName()); - CalculatorService calculator = new CalculatorServiceImpl(context); - context.registerService(CalculatorService.class.getName(), calculator, props); - - getBundle(context, AddService.class); - - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java deleted file mode 100644 index 5f9db16ca9..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import org.osgi.service.component.ComponentContext; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceDSImpl implements CalculatorService { - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - public CalculatorServiceDSImpl() { - super(); - System.out.println("CalculatorServiceDSImpl()"); - } - - protected void activate(ComponentContext context) { - System.out.println("Activating " + context); - } - - protected void deactivate(ComponentContext context) { - System.out.println("Deactivating " + context); - } - - /* - * The following setters can be used for DS injection - */ - public void setAddService(AddService addService) { - System.out.println("setAddService()"); - this.addService = addService; - } - - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - /* - * The following setters can be used for DS injection - */ - public void unsetAddService(AddService addService) { - System.out.println("unsetAddService()"); - this.addService = null; - } - - public void unsetSubtractService(SubtractService subtractService) { - this.subtractService = null; - } - - public void unsetDivideService(DivideService divideService) { - this.divideService = null; - } - - public void unsetMultiplyService(MultiplyService multiplyService) { - this.multiplyService = null; - } - private <T> T getService(Class<T> cls) { - for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) { - if (cls.isInstance(s)) { - return cls.cast(s); - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java deleted file mode 100644 index a9ea37585a..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import static org.osgi.framework.Constants.OBJECTCLASS; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.util.tracker.ServiceTracker; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - private ServiceTracker remoteServices; - private ServiceTracker localServices; - - public CalculatorServiceImpl() { - super(); - } - - public CalculatorServiceImpl(BundleContext context) { - super(); - Filter remoteFilter = null, localFilter = null; - try { - remoteFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))"); - localFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))"); - } catch (InvalidSyntaxException e) { - e.printStackTrace(); - } - this.remoteServices = new ServiceTracker(context, remoteFilter, null); - remoteServices.open(); - this.localServices = new ServiceTracker(context, localFilter, null); - localServices.open(); - } - - private <T> T getService(Class<T> cls) { - try { - // Wait for 10 seconds until the remote services are imported - remoteServices.waitForService(10000); - } catch (InterruptedException e) { - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - Object[] remoteObjects = remoteServices.getServices(); - if (remoteObjects != null) { - for (Object s : remoteObjects) { - if (cls.isInstance(s)) { - System.out.println("Remote service: " + s); - return cls.cast(s); - } - } - } - Object[] localObjects = localServices.getServices(); - if (localObjects != null) { - for (Object s : localObjects) { - if (cls.isInstance(s)) { - System.out.println("Local service: " + s); - return cls.cast(s); - } - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java deleted file mode 100644 index a4fc52694e..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; - -/** - * - */ -public class OperationsRMIServer implements OperationsRemote, Serializable { - - private static final long serialVersionUID = 6081008315263103012L; - private transient Registry registry; - - public OperationsRMIServer() throws RemoteException { - super(); - } - - public double add(double n1, double n2) { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public void start() throws RemoteException { - Thread thread = new Thread() { - public void run() { - try { - System.out.println("Starting the RMI server for calculator operations..."); - Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this); - registry = LocateRegistry.createRegistry(8085); - registry.bind("AddService", stub); - registry.bind("SubtractService", stub); - registry.bind("MultiplyService", stub); - registry.bind("DivideService", stub); - System.out.println("RMI server for calculator operations is now started."); - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - thread.start(); - } - - public void stop() { - if (registry != null) { - try { - registry.unbind("AddService"); - registry.unbind("SubtractService"); - registry.unbind("MultiplyService"); - registry.unbind("DivideService"); - UnicastRemoteObject.unexportObject(this, false); - UnicastRemoteObject.unexportObject(registry, false); - registry = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java deleted file mode 100644 index a813dfb6f3..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Stub class generated by rmic, do not edit. -// Contents subject to change without notice. -package calculator.rmi; - -public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote { - private static final long serialVersionUID = 2; - - private static java.lang.reflect.Method $method_add_0; - private static java.lang.reflect.Method $method_divide_1; - private static java.lang.reflect.Method $method_multiply_2; - private static java.lang.reflect.Method $method_subtract_3; - - static { - try { - $method_add_0 = - calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class}); - $method_divide_1 = - calculator.rmi.OperationsRemote.class.getMethod("divide", - new java.lang.Class[] {double.class, double.class}); - $method_multiply_2 = - calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class, - double.class}); - $method_subtract_3 = - calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class, - double.class}); - } catch (java.lang.NoSuchMethodException e) { - throw new java.lang.NoSuchMethodError("stub class initialization failed"); - } - } - - // constructors - public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) { - super(ref); - } - - // methods from remote interfaces - - // implementation of add(double, double) - public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_add_0, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 864055858262779977L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of divide(double, double) - public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_divide_1, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 8097593626497421928L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of multiply(double, double) - public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_multiply_2, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -346155016949350695L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of subtract(double, double) - public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_subtract_3, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -610707357620578750L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } -} diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java deleted file mode 100644 index 955e386ad8..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -/** - * RMI Remote interface - */ -public interface OperationsRemote extends Remote { - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; - -} diff --git a/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index b14b3516f6..0000000000 --- a/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> - -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:c="http://calculator.dosgi"> - <deployable composite="c:CalculatorComposite" /> -</contribution> diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java deleted file mode 100644 index 565a314d85..0000000000 --- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class CalculatorNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java deleted file mode 100644 index 4dd713ecef..0000000000 --- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import static calculator.dosgi.test.OSGiTestUtils.bundleStatus; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceReference; - -import calculator.dosgi.CalculatorService; -import calculator.rmi.OperationsRMIServer; - -/** - * - */ -public class CalculatorOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle calculatorBundle; - private static OperationsRMIServer rmiServer; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - rmiServer = new OperationsRMIServer(); - rmiServer.start(); - - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - System.out.println(b); - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi".equals(b.getSymbolicName())) { - calculatorBundle = b; - } - } - - if (calculatorBundle != null) { - calculatorBundle.start(); - System.out.println(bundleStatus(calculatorBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() { - ServiceReference ref = - calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName()); - Assert.assertNotNull(ref); - Object service = context.getService(ref); - Assert.assertNotNull(service); - CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class); - System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); - System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); - System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); - System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0)); - } - - @Test - /** - * Test the Web service exposed by the Calculator - */ - public void testWS() throws Exception { - URL url = new URL("http://localhost:8086/CalculatorService?wsdl"); - InputStream is = url.openStream(); - Reader reader = new InputStreamReader(is); - char[] content = new char[10240]; // 10k - int len = 0; - while (true) { - int size = reader.read(content, len, content.length - len); - if (size < 0) { - break; - } - len += size; - } - Assert.assertTrue(len > 0); - String str = new String(content, 0, len); - System.out.println(str); - Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - rmiServer.stop(); - host = null; - rmiServer = null; - context = null; - } - } - -} diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java deleted file mode 100644 index 99e0da9f97..0000000000 --- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param <T> - * @param obj - * @param cls - * @return - */ - public static <T> T cast(Object obj, Class<T> cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class<?>[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/LICENSE b/java/sca/samples/dosgi-dynamic-calculator-operations/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF b/java/sca/samples/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF deleted file mode 100644 index cea4e2ff79..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0
-Export-Package: calculator.dosgi.operations;version="1.0.1"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi.dynamic.operations
-Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator
-Bundle-ManifestVersion: 2
-Import-Package: calculator.dosgi.operations;version="[1.0.1,1.0.1]",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin
-Bundle-SymbolicName: calculator.dosgi.dynamic.operations
-Bundle-Vendor: The Apache Software Foundation
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Service-Component-Disabled: OSGI-INF/add-component.xml,
- OSGI-INF/subtract-component.xml,
- OSGI-INF/multiply-component.xml,
- OSGI-INF/divide-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 -SCA-Configuration: OSGI-INF/sca-config/*.xml
diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/NOTICE b/java/sca/samples/dosgi-dynamic-calculator-operations/NOTICE deleted file mode 100644 index 51042eab05..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml deleted file mode 100644 index 99845257ff..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.AddServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.AddService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml deleted file mode 100644 index f6b5f4690e..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) --> -<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <component id="AddComponent" class="calculator.dosgi.operations.impl.AddServiceImpl"> - </component> - <component id="SubtractComponent" class="calculator.dosgi.operations.impl.SubtractServiceImpl"> - </component> - <component id="MultiplyComponent" class="calculator.dosgi.operations.impl.MultiplyServiceImpl"> - </component> - <component id="DivideComponent" class="calculator.dosgi.operations.impl.DivideServiceImpl"> - </component> - - <!-- We can derive the SCA services for the implementation.osgi --> - <service id="AddService" ref="AddComponent" interface="calculator.dosgi.operations.AddService"> - </service> - <service id="SubtractService" ref="SubtractComponent" interface="calculator.dosgi.operations.SubtractService"> - </service> - <service id="MultiplyService" ref="MultiplyComponent" interface="calculator.dosgi.operations.MultiplyService"> - </service> - <service id="DivideService" ref="DivideComponent" interface="calculator.dosgi.operations.DivideService"> - </service> -</components>
\ No newline at end of file diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml deleted file mode 100644 index 322d4daf2f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.DivideServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.DivideService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml deleted file mode 100644 index b9ca777bd8..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.MultiplyServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.MultiplyService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml deleted file mode 100644 index b00f05ad2d..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> -<scact:sca-config targetNamespace="http://sample" - xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0" - xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"> - <tuscany:binding.rmi name="Add" uri="rmi://localhost:8085/AddService"/> - <tuscany:binding.rmi name="Divide" uri="rmi://localhost:8085/DivideService"/> - <tuscany:binding.rmi name="Subtract" uri="rmi://localhost:8085/SubtractService"/> - <tuscany:binding.rmi name="Multiply" uri="rmi://localhost:8085/MultiplyService"/> -</scact:sca-config> -
\ No newline at end of file diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml deleted file mode 100644 index 1472f5a976..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.impl.SubtractServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.SubtractService" /> - </service> -</scr:component> diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/README b/java/sca/samples/dosgi-dynamic-calculator-operations/README deleted file mode 100644 index 1e8626dfec..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/README +++ /dev/null @@ -1,194 +0,0 @@ -Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Starting calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-4486-
-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-41f0
--b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47b3-
-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-444e-
-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator getB
-undle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic.operations
-
-osgi>
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-44
-4e-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:18:43 PM calculator.dosgi.operations.impl.OperationsActivator stop
-
-INFO: Stopping calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-44
-86-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-4
-1f0-b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47
-b3-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-
-osgi>
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator-operations/
- src/
- main/
- java/
- calculator/
- dosgi/
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- impl/
- OperationsActivator.java - OSGi bundle activator
- AddServiceImpl.java - Implementation for Add
- SubtractServiceImpl.java - Implementation for Subtract
- MultiplyServiceImpl.java - Implementation for Multiply
- DivideServiceImpl.java - Implementation for Divide
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- operations-config.xml - The SCA configuration file for OSGi remote services
- test/
- java/
- src/
- calculator/
- dosgi/
- operations/
- test/
- OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-dynamic-calculator-operations
-mvn
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/pom.xml b/java/sca/samples/dosgi-dynamic-calculator-operations/pom.xml deleted file mode 100644 index 3e047a1ada..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/pom.xml +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>sample-dosgi-dynamic-calculator-operations</artifactId> - <name>Apache Tuscany SCA OSGi RemoteService Dynamic Caculator Operations Sample</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-ejava</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl-osgi</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.osgi</groupId> - <artifactId>services</artifactId> - <version>3.2.0-v20090520-1800</version> - <scope>test</scope> - </dependency> - - <!-- Equinox Declarative Services --> - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>ds</artifactId> - <version>1.1.0-v20090601</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>util</artifactId> - <version>1.0.100-v20090520-1800</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <buildcommands> - <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> - <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> - </buildcommands> - <projectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.eclipse.pde.PluginNature</projectnature> - </projectnatures> - <classpathContainers> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java deleted file mode 100644 index 66b2977241..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.AddService; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java deleted file mode 100644 index a3c21b2b96..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.DivideService; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java deleted file mode 100644 index 7922d2d392..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.MultiplyService; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java deleted file mode 100644 index f75cc6444e..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * - */ -public class OperationsActivator implements BundleActivator { - private Logger logger = Logger.getLogger(OperationsActivator.class.getName()); - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - - Dictionary<String, Object> props = new Hashtable<String, Object>(); - props.put("service.exported.configs", new String[] {"org.osgi.sca"}); - props.put("service.exported.interfaces", new String[] {"*"}); - - logger.info("Registering " + AddService.class.getName()); - props.put("sca.service", "AddComponent#service-name(Add)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Add"}); - context.registerService(AddService.class.getName(), new AddServiceImpl(), props); - - logger.info("Registering " + SubtractService.class.getName()); - props.put("sca.service", "SubtractComponent#service-name(Subtract)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Subtract"}); - context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props); - - logger.info("Registering " + MultiplyService.class.getName()); - props.put("sca.service", "MultiplyComponent#service-name(Multiply)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Multiply"}); - context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props); - - logger.info("Registering " + DivideService.class.getName()); - props.put("sca.service", "DivideComponent#service-name(Divide)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Divide"}); - context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props); - - getBundle(context, AddService.class); - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - - private Bundle getBundle(BundleContext bundleContext, Class<?> cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java deleted file mode 100644 index 4bbe83b14f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java deleted file mode 100644 index cd92989da1..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param <T> - * @param obj - * @param cls - * @return - */ - public static <T> T cast(Object obj, Class<T> cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class<?>[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java deleted file mode 100644 index 02007c385c..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class OperationsNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java deleted file mode 100644 index eee64bf86f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; - -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class OperationsOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle operationsBundle; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.dynamic.operations".equals(b.getSymbolicName())) { - operationsBundle = b; - } - } - - if (operationsBundle != null) { - operationsBundle.start(); - System.out.println(bundleStatus(operationsBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() throws Exception { - Registry registry = LocateRegistry.getRegistry(8085); - Object add = registry.lookup("AddService"); - AddService addService = OSGiTestUtils.cast(add, AddService.class); - double sum = addService.add(1.0, 2.0); - Assert.assertEquals(3.0, sum, 0.0); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - context = null; - } - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/LICENSE b/java/sca/samples/dosgi-dynamic-calculator/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ -
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator/META-INF/MANIFEST.MF b/java/sca/samples/dosgi-dynamic-calculator/META-INF/MANIFEST.MF deleted file mode 100644 index 6ce24a4a32..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0
-Export-Package: calculator.dosgi;version="1.0.1",
- calculator.dosgi.operations;version="1.0.1"
-Bundle-Version: 1.0.0
-Bundle-Name: calculator.dosgi.dynamic
-Bundle-Activator: calculator.dosgi.impl.CalculatorActivator
-Bundle-ManifestVersion: 2
-Import-Package: org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework,
- org.osgi.service.component;resolution:=optional,
- org.osgi.service.packageadmin,
- org.osgi.util.tracker
-Bundle-SymbolicName: calculator.dosgi.dynamic
-Bundle-Vendor: The Apache Software Foundation
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Service-Component-Disabled: OSGI-INF/calculator-component.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-SCA-Configuration: OSGI-INF/sca-config/calculator-config.xml
-Remote-Service: OSGI-INF/remote-service/*.xml
- diff --git a/java/sca/samples/dosgi-dynamic-calculator/NOTICE b/java/sca/samples/dosgi-dynamic-calculator/NOTICE deleted file mode 100644 index 51042eab05..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml b/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml deleted file mode 100644 index fd834e12ef..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) --> -<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl"> - <property name="addService" ref="AddService" /> - <property name="subtractService" ref="SubtractService" /> - <property name="multiplyService" ref="MultiplyService" /> - <property name="divideService" ref="DivideService" /> - </component> - - <!-- We can derive the SCA services for the implementation.osgi --> - <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService"> - </service> - - <!-- We can derive the SCA references for the implementation.osgi --> - <reference id="AddService" interface="calculator.dosgi.operations.AddService"> - </reference> - <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService"> - </reference> - <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService"> - </reference> - <reference id="DivideService" interface="calculator.dosgi.operations.DivideService"> - </reference> - -</components>
\ No newline at end of file diff --git a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml b/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml deleted file mode 100644 index 5daaa59aae..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<scr:component name="CalculatorComponent" - xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" /> - <service> - <provide interface="calculator.dosgi.CalculatorService" /> - </service> - - <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService" - policy="dynamic" /> - <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService" - unbind="unsetSubtractService" policy="dynamic" /> - <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService" - unbind="unsetMultiplyService" policy="dynamic" /> - <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService" - unbind="unsetDivideService" policy="dynamic" /> - -</scr:component> diff --git a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml deleted file mode 100644 index ac73ea98f0..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> -<!-- A consumer-side service description file for RFC 119 --> -<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" - xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"> - <!-- Describe a remote OSGi service --> - <service-description> - <provide interface="calculator.dosgi.operations.AddService" /> - <property name="remote.exported.intents"></property> - <property name="remote.configs.supported">org.osgi.sca</property> - <property name="sca.reference"> - addService - </property> - <property name="org.osgi.sca.bindings">{http://sample}Add</property> - </service-description> - <service-description> - <provide interface="calculator.dosgi.operations.SubtractService" /> - <property name="remote.exported.intents"></property> - <property name="remote.configs.supported">org.osgi.sca</property> - <property name="sca.reference"> - subtractService - </property> - <property name="org.osgi.sca.bindings">{http://sample}Subtract</property> - </service-description> - <service-description> - <provide interface="calculator.dosgi.operations.MultiplyService" /> - <property name="remote.exported.intents"></property> - <property name="remote.configs.supported">org.osgi.sca</property> - <property name="sca.reference"> - multiplyService - </property> - <property name="org.osgi.sca.bindings">{http://sample}Multiply</property> - </service-description> - <service-description> - <provide interface="calculator.dosgi.operations.DivideService" /> - <property name="remote.exported.intents"></property> - <property name="remote.configs.supported">org.osgi.sca</property> - <property name="sca.reference"> - divideService - </property> - <property name="org.osgi.sca.bindings">{http://sample}Divide</property> - </service-description> -</service-descriptions>
\ No newline at end of file diff --git a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml b/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml deleted file mode 100644 index 878ef9c18e..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> -<scact:sca-config targetNamespace="http://sample" - xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0" - xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"> - <sca:binding.ws name="Calculator" uri="http://localhost:8086/CalculatorService"/> - - <!-- bindings for the remote services --> - <tuscany:binding.rmi name="Add" uri="rmi://localhost:8085/AddService"/> - <tuscany:binding.rmi name="Divide" uri="rmi://localhost:8085/DivideService"/> - <tuscany:binding.rmi name="Subtract" uri="rmi://localhost:8085/SubtractService"/> - <tuscany:binding.rmi name="Multiply" uri="rmi://localhost:8085/MultiplyService"/> -</scact:sca-config> -
\ No newline at end of file diff --git a/java/sca/samples/dosgi-dynamic-calculator/README b/java/sca/samples/dosgi-dynamic-calculator/README deleted file mode 100644 index 04fc30c0be..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/README +++ /dev/null @@ -1,143 +0,0 @@ -Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
-INFO: Equinox-based service discoverer is now configured.
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Starting calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Registering calculator.dosgi.CalculatorService
-Nov 4, 2009 5:20:21 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869 domai
-n: tuscany.apache.org
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Nov 4, 2009 5:20:24 PM org.mortbay.log.Slf4jLog info
-INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
-bay.log.Slf4jLog
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: jetty-6.1.x
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: Started SelectChannelConnector@0.0.0.0:8086
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
-apping
-INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-42b3
--9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:20:25 PM calculator.dosgi.impl.CalculatorActivator getBundle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic
-
-You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
-the WSDL.
-
-You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-4
-2b3-9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
-etMapping
-INFO: Removed Servlet mapping: /CalculatorService
-Nov 4, 2009 5:21:16 PM calculator.dosgi.impl.CalculatorActivator stop
-INFO: Stopping calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator/
- src/
- main/
- java/
- calculator/
- dosgi/
- CalculatorService.java - The interface for Calculator service
- impl/
- CalculatorActivator.java - OSGi bundle activator for Calculator bundle
- CalculatorServiceDSImpl.java - OSGi declarative service based implementation
- CalculatorServiceImpl.java - Basic OSGi implementation
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- rmi/
- OperationsRemote.java - RMI remote interface for operations
- OperationsRMIServer_Stub.java - RMI stub
- OperationsRMIServer.java - RMI server implementation of the operations
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- calculator-config.xml - The SCA configuration file for OSGi remote services
- remote-service/
- calculator-service-descriptions.xml - The OSGi remote service endpoint descriptions
- test/
- java/
- src/
- calculator/
- dosgi/
- test/
- CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- dosig-calculator.png - a pictorial representation of the sample
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator
-mvn
-
diff --git a/java/sca/samples/dosgi-dynamic-calculator/dosgi-calculator.png b/java/sca/samples/dosgi-dynamic-calculator/dosgi-calculator.png Binary files differdeleted file mode 100644 index 805baa54d2..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/dosgi-calculator.png +++ /dev/null diff --git a/java/sca/samples/dosgi-dynamic-calculator/pom.xml b/java/sca/samples/dosgi-dynamic-calculator/pom.xml deleted file mode 100644 index 98ae90115d..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>sample-dosgi-dynamic-calculator</artifactId> - <name>Apache Tuscany SCA OSGi RemoteService Dynamic Caculator Sample</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-ejava</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-webservice</artifactId> - <version>2.0-SNAPSHOT</version> - <type>pom</type> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl-osgi</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.osgi</groupId> - <artifactId>services</artifactId> - <version>3.2.0-v20090520-1800</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - <!-- Equinox Declarative Services --> - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>ds</artifactId> - <version>1.1.0-v20090601</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.eclipse.equinox</groupId> - <artifactId>util</artifactId> - <version>1.0.100-v20090520-1800</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <buildcommands> - <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> - <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand> - </buildcommands> - <projectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.eclipse.pde.PluginNature</projectnature> - </projectnatures> - <classpathContainers> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java deleted file mode 100644 index cc562b7c2f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java deleted file mode 100644 index 6228afcd53..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class CalculatorActivator implements BundleActivator { - private Logger logger = Logger.getLogger(CalculatorActivator.class.getName()); - - private Bundle getBundle(BundleContext bundleContext, Class<?> cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - Dictionary<String, Object> props = new Hashtable<String, Object>(); - props.put("sca.service", "CalculatorComponent#service-name(Calculator)"); - props.put("calculator", "Calculator"); - props.put("service.exported.configs", new String[] {"org.osgi.sca"}); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Calculator"}); - props.put("service.exported.interfaces", new String[] {"*"}); - logger.info("Registering " + CalculatorService.class.getName()); - CalculatorService calculator = new CalculatorServiceImpl(context); - context.registerService(CalculatorService.class.getName(), calculator, props); - - getBundle(context, AddService.class); - - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java deleted file mode 100644 index 5f9db16ca9..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import org.osgi.service.component.ComponentContext; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceDSImpl implements CalculatorService { - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - public CalculatorServiceDSImpl() { - super(); - System.out.println("CalculatorServiceDSImpl()"); - } - - protected void activate(ComponentContext context) { - System.out.println("Activating " + context); - } - - protected void deactivate(ComponentContext context) { - System.out.println("Deactivating " + context); - } - - /* - * The following setters can be used for DS injection - */ - public void setAddService(AddService addService) { - System.out.println("setAddService()"); - this.addService = addService; - } - - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - /* - * The following setters can be used for DS injection - */ - public void unsetAddService(AddService addService) { - System.out.println("unsetAddService()"); - this.addService = null; - } - - public void unsetSubtractService(SubtractService subtractService) { - this.subtractService = null; - } - - public void unsetDivideService(DivideService divideService) { - this.divideService = null; - } - - public void unsetMultiplyService(MultiplyService multiplyService) { - this.multiplyService = null; - } - private <T> T getService(Class<T> cls) { - for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) { - if (cls.isInstance(s)) { - return cls.cast(s); - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java deleted file mode 100644 index a9ea37585a..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import static org.osgi.framework.Constants.OBJECTCLASS; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.util.tracker.ServiceTracker; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - private ServiceTracker remoteServices; - private ServiceTracker localServices; - - public CalculatorServiceImpl() { - super(); - } - - public CalculatorServiceImpl(BundleContext context) { - super(); - Filter remoteFilter = null, localFilter = null; - try { - remoteFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))"); - localFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))"); - } catch (InvalidSyntaxException e) { - e.printStackTrace(); - } - this.remoteServices = new ServiceTracker(context, remoteFilter, null); - remoteServices.open(); - this.localServices = new ServiceTracker(context, localFilter, null); - localServices.open(); - } - - private <T> T getService(Class<T> cls) { - try { - // Wait for 10 seconds until the remote services are imported - remoteServices.waitForService(10000); - } catch (InterruptedException e) { - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - Object[] remoteObjects = remoteServices.getServices(); - if (remoteObjects != null) { - for (Object s : remoteObjects) { - if (cls.isInstance(s)) { - System.out.println("Remote service: " + s); - return cls.cast(s); - } - } - } - Object[] localObjects = localServices.getServices(); - if (localObjects != null) { - for (Object s : localObjects) { - if (cls.isInstance(s)) { - System.out.println("Local service: " + s); - return cls.cast(s); - } - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java deleted file mode 100644 index a4fc52694e..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; - -/** - * - */ -public class OperationsRMIServer implements OperationsRemote, Serializable { - - private static final long serialVersionUID = 6081008315263103012L; - private transient Registry registry; - - public OperationsRMIServer() throws RemoteException { - super(); - } - - public double add(double n1, double n2) { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public void start() throws RemoteException { - Thread thread = new Thread() { - public void run() { - try { - System.out.println("Starting the RMI server for calculator operations..."); - Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this); - registry = LocateRegistry.createRegistry(8085); - registry.bind("AddService", stub); - registry.bind("SubtractService", stub); - registry.bind("MultiplyService", stub); - registry.bind("DivideService", stub); - System.out.println("RMI server for calculator operations is now started."); - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - thread.start(); - } - - public void stop() { - if (registry != null) { - try { - registry.unbind("AddService"); - registry.unbind("SubtractService"); - registry.unbind("MultiplyService"); - registry.unbind("DivideService"); - UnicastRemoteObject.unexportObject(this, false); - UnicastRemoteObject.unexportObject(registry, false); - registry = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java deleted file mode 100644 index a813dfb6f3..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Stub class generated by rmic, do not edit. -// Contents subject to change without notice. -package calculator.rmi; - -public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote { - private static final long serialVersionUID = 2; - - private static java.lang.reflect.Method $method_add_0; - private static java.lang.reflect.Method $method_divide_1; - private static java.lang.reflect.Method $method_multiply_2; - private static java.lang.reflect.Method $method_subtract_3; - - static { - try { - $method_add_0 = - calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class}); - $method_divide_1 = - calculator.rmi.OperationsRemote.class.getMethod("divide", - new java.lang.Class[] {double.class, double.class}); - $method_multiply_2 = - calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class, - double.class}); - $method_subtract_3 = - calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class, - double.class}); - } catch (java.lang.NoSuchMethodException e) { - throw new java.lang.NoSuchMethodError("stub class initialization failed"); - } - } - - // constructors - public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) { - super(ref); - } - - // methods from remote interfaces - - // implementation of add(double, double) - public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_add_0, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 864055858262779977L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of divide(double, double) - public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_divide_1, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 8097593626497421928L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of multiply(double, double) - public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_multiply_2, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -346155016949350695L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of subtract(double, double) - public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_subtract_3, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -610707357620578750L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java deleted file mode 100644 index 955e386ad8..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -/** - * RMI Remote interface - */ -public interface OperationsRemote extends Remote { - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java deleted file mode 100644 index 565a314d85..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class CalculatorNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java deleted file mode 100644 index 4015c7bbc2..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import static calculator.dosgi.test.OSGiTestUtils.bundleStatus; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceReference; - -import calculator.dosgi.CalculatorService; -import calculator.rmi.OperationsRMIServer; - -/** - * - */ -public class CalculatorOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle calculatorBundle; - private static OperationsRMIServer rmiServer; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - rmiServer = new OperationsRMIServer(); - rmiServer.start(); - - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - System.out.println(b); - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.dynamic".equals(b.getSymbolicName())) { - calculatorBundle = b; - } - } - - if (calculatorBundle != null) { - calculatorBundle.start(); - System.out.println(bundleStatus(calculatorBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() { - ServiceReference ref = - calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName()); - Assert.assertNotNull(ref); - Object service = context.getService(ref); - Assert.assertNotNull(service); - CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class); - System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); - System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); - System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); - System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0)); - } - - @Test - /** - * Test the Web service exposed by the Calculator - */ - public void testWS() throws Exception { - URL url = new URL("http://localhost:8086/CalculatorService?wsdl"); - InputStream is = url.openStream(); - Reader reader = new InputStreamReader(is); - char[] content = new char[10240]; // 10k - int len = 0; - while (true) { - int size = reader.read(content, len, content.length - len); - if (size < 0) { - break; - } - len += size; - } - Assert.assertTrue(len > 0); - String str = new String(content, 0, len); - System.out.println(str); - Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - rmiServer.stop(); - host = null; - rmiServer = null; - context = null; - } - } - -} diff --git a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java deleted file mode 100644 index 99e0da9f97..0000000000 --- a/java/sca/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param <T> - * @param obj - * @param cls - * @return - */ - public static <T> T cast(Object obj, Class<T> cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class<?>[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/java/sca/samples/helloworld-bpel/README b/java/sca/samples/helloworld-bpel/README deleted file mode 100644 index bf5f500ef3..0000000000 --- a/java/sca/samples/helloworld-bpel/README +++ /dev/null @@ -1,151 +0,0 @@ -Hello World BPEL Sample -====================================== -This sample demonstrates an SCA service implemented by a BPEL process. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory, and do - -ant compile run - -OR if you don't have ant, on Windows do - -mkdir target\classes -mkdir target\wsdl2java-source -java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl -java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl -unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database -javac -d target\classes -cp target\classes;..\..\lib\tuscany-sca-manifest.jar -sourcepath src\main\java;target\wsdl2java-source -target 1.5 -g -source 1.5 src\main\java\helloworld\BPELClient.java -copy src\main\resources\* target\classes -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient - -and on *nix do - -mkdir target/classes -mkdir target/wsdl2java-source -java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl -java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl -unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database -javac -d target/classes -cp target/classes;../../lib/tuscany-sca-manifest.jar -sourcepath src/main/java;target/wsdl2java-source -target 1.5 -g -source 1.5 src/main/java/helloworld/BPELClient.java -cp src/main/resources/* target/classes -java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient - -The sample will start an embedded BPEL engine, deploy a process and invoke it. - -Sample Overview ---------------- -The sample provides a single component that is wired to a service with a -web service binding. - -helloworld-bpel/ - src/ - main/ - java/ - helloworld/ - BPELClient.java - client application for - BEPELHelloWorldComponent - - resources/ - deploy.xml - ODE deployment descriptor - helloworld.bpel - helloworld bpel process - helloworld.componentType - helloworld bpel service description - helloworld.composite - the SCA assembly for this sample - helloworld.wsdl - the service description that describes - the bpel process - log4j.properties - logging configuration - - test/ - java/ - helloworld/ - BPELHelloWorldTestCase.java - JUnit test case - helloworld-bpel.png - a pictorial representation of the - sample .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ - -With the binary distribution the sample can be built and run using Ant as -follows - -cd helloworld-bpel -ant compile -ant run - - -You should see the following output from the run target. - -run: - [java] Starting BPELHelloWorldComponent - [java] >>> Deploying : D:\temp\SCA1.1-RC1\tuscany-sca-1.1-incubating\samples\helloworld-bpel\target\classes - [java] ::arg:::::: <?xml version="1.0" encoding="UTF-8"?> - [java] <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/exampl -e/helloworld.wsdl">Hello</message></hello> - [java] ::message:: <?xml version="1.0" encoding="UTF-8"?> - [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/impleme -ntation/bpel/example/helloworld.wsdl">Hello</message></hello></TestPart></message> - [java] Status: RESPONSE - [java] Response: <?xml version="1.0" encoding="UTF-8"?> - [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message> - [java] Hello World - [java] Stopping BPELHelloWorldComponent - [java] Stopped !!! - -BUILD SUCCESSFUL -Total time: 36 seconds - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. When using Maven, a simple test is present that exercise -the same logic as the client to invoke the BPEl process. - -cd helloworld-bpel -mvn - -You should see the following output from the test phase. - -- - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running helloworld.BPELHelloWorldTestCase -Starting BPELHelloWorldComponent ->>> Deploying : D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\classes -::arg:::::: <?xml version="1.0" encoding="UTF-8"?> -<hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld -.wsdl">Hello</message></hello> -::message:: <?xml version="1.0" encoding="UTF-8"?> -<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel -/example/helloworld.wsdl">Hello</message></hello></TestPart></message> -Status: RESPONSE -Response: <?xml version="1.0" encoding="UTF-8"?> -<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message> -Stopping BPELHelloWorldComponent -Stopped !!! -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.656 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -[INFO] [jar:jar] -[INFO] Building jar: D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar -[INFO] [install:install] -[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresend -e\.m2\repository\org\apache\tuscany\sca\sample-helloworld-bpel\1.1-incubating-SNAPSHOT\sample-helloworld-bpel-1.1-incubating-SNAPSHOT.jar -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESSFUL -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 53 seconds -[INFO] Finished at: Sun Jan 13 09:54:39 PST 2008 -[INFO] Final Memory: 24M/43M -[INFO] ------------------------------------------------------------------------ - - -This shows that the Junit test cases have run successfully. diff --git a/java/sca/samples/helloworld-bpel/build.xml b/java/sca/samples/helloworld-bpel/build.xml deleted file mode 100644 index 008953e63b..0000000000 --- a/java/sca/samples/helloworld-bpel/build.xml +++ /dev/null @@ -1,95 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project name="sample-helloworld-bpel" default="compile"> - <property name="test.class" value="helloworld.BPELClient" /> - <property name="test.jar" value="sample-helloworld-bpel.jar" /> - <property name="manifest.jar" value="../../lib/tuscany-sca-manifest.jar" /> - - <target name="init"> - <mkdir dir="target/classes"/> - <mkdir dir="target/wsdl2java-source"/> - </target> - - <target name="generate-wsdl" depends="init"> - <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true"> - <arg value="-targetDirectory"/> - <arg value="target/wsdl2java-source"/> - <arg value="-prefix"/> - <arg value="HelloWorld"/> - <arg value="-noContainment"/> - <arg value="-noUnsettable"/> - <arg value="src/main/resources/helloworld.wsdl"/> - - <classpath> - <pathelement location="${manifest.jar}"/> - </classpath> - </java> - - <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="true"> - <arg value="-targetDirectory"/> - <arg value="target/wsdl2java-source"/> - <arg value="src/main/resources/helloworld.wsdl"/> - - <classpath> - <pathelement location="${manifest.jar}"/> - </classpath> - </java> - </target> - - <target name="unzip-ode-db" depends="init"> - <unzip src="../../lib/ode-dao-jpa-ojpa-derby-1.3.2.zip" dest="target/database"/> - </target> - - <target name="compile" depends="init,generate-wsdl,unzip-ode-db"> - <javac destdir="target/classes" debug="on" source="1.5" target="1.5"> - <src path="src/main/java"/> - <src path="target/wsdl2java-source"/> - <classpath> - <pathelement location="${manifest.jar}"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${test.jar}" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="${test.class}" /> - </manifest> - </jar> - </target> - - <target name="run"> - <java classname="${test.class}" fork="true"> - <!-- jvmarg value="-Xdebug"/ --> - <!-- jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/ --> - <classpath> - <pathelement location="target/classes"/> - <pathelement location="target/database"/> - <pathelement location="${manifest.jar}"/> - </classpath> - </java> - </target> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - -</project> diff --git a/java/sca/samples/helloworld-bpel/helloworld-bpel.png b/java/sca/samples/helloworld-bpel/helloworld-bpel.png Binary files differdeleted file mode 100644 index 5f53a3c5d1..0000000000 --- a/java/sca/samples/helloworld-bpel/helloworld-bpel.png +++ /dev/null diff --git a/java/sca/samples/helloworld-bpel/helloworld-bpel.svg b/java/sca/samples/helloworld-bpel/helloworld-bpel.svg deleted file mode 100644 index 5a98f1a07c..0000000000 --- a/java/sca/samples/helloworld-bpel/helloworld-bpel.svg +++ /dev/null @@ -1,179 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-panic\sca\samples\helloworld-bpel" - sodipodi:docname="helloworld-bpel.svg" - version="1.0" - inkscape:export-filename="C:\simon\tuscany\java-panic\sca\samples\helloworld-bpel\helloworld-bpel.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="519.38407" - inkscape:cy="414.63224" - inkscape:document-units="px" - inkscape:current-layer="layer1" - inkscape:window-width="1141" - inkscape:window-height="676" - inkscape:window-x="360" - inkscape:window-y="147" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997" - transform="matrix(0.991389,0,0,1,2.215655,0)"> - <rect - rx="13.79423" - ry="12.692303" - y="192.00233" - x="258.3114" - height="299.99988" - width="446.72086" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.00866628;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2960">helloworldws</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.77353811;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="137.03178" - height="139.37514" - x="433.16025" - y="308.26868" - rx="8.2887468" - ry="11.562291" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(183.89697,109.51481)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">HelloWorld</flowPara><flowPara - id="flowPara1883">Service</flowPara><flowPara - id="flowPara1885">Component</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 414.90867,339.0146 L 448.24371,339.0146 L 454.30462,352.14658 L 447.23356,364.26842 L 414.90867,364.26842 L 422.48482,352.14658 L 414.90867,339.0146 z " - id="path3017" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 226.73064,320.75315 L 293.91185,320.75315 L 306.1266,352.82797 L 291.87606,382.43553 L 226.73064,382.43553 L 241.99911,352.82797 L 226.73064,320.75315 z " - id="path1892" /> - <flowRoot - xml:space="preserve" - id="flowRoot1894" - transform="translate(-37.47944,122.8324)" - style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion - id="flowRegion1896"><rect - id="rect1898" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" - style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara - id="flowPara1900">HelloWorld</flowPara><flowPara - id="flowPara1906">Web</flowPara><flowPara - id="flowPara1904">Service</flowPara></flowRoot> <path - style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 305.71429,353.3802 L 422.85714,351.95163" - id="path1910" - inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\helloworld-ws-service\helloworld-ws-service.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84" /> - <rect - style="opacity:1;fill:#e4a637;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.03563392;stroke-miterlimit:4;stroke-dasharray:6.21380369, 1.03563395;stroke-dashoffset:0;stroke-opacity:1" - id="rect2179" - width="107.35972" - height="30.216856" - x="454.17728" - y="404.70035" - rx="1.1482089" - ry="1.0659764" /> - <flowRoot - xml:space="preserve" - id="flowRoot3152" - transform="matrix(0.8110318,0,0,0.9349147,74.607827,34.581873)"><flowRegion - id="flowRegion3154"><rect - id="rect3156" - width="114.28571" - height="12.857142" - x="450.71429" - y="376.23734" /></flowRegion><flowPara - id="flowPara3158">implementation.bpel</flowPara></flowRoot> <text - xml:space="preserve" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" - x="466.42856" - y="423.38019" - id="text3160"><tspan - sodipodi:role="line" - id="tspan3162" - x="466.42856" - y="423.38019">helloworld.bpel</tspan></text> - </g> -</svg> diff --git a/java/sca/samples/helloworld-bpel/pom.xml b/java/sca/samples/helloworld-bpel/pom.xml deleted file mode 100644 index a2068de07c..0000000000 --- a/java/sca/samples/helloworld-bpel/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-helloworld-bpel</artifactId> - <name>Apache Tuscany SCA Sample HelloWorld BPEL</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-bpel-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>unpack</id> - <phase>test-compile</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.apache.ode</groupId> - <artifactId>ode-dao-jpa-ojpa-derby</artifactId> - <version>1.3.2</version> - <type>zip</type> - <overWrite>true</overWrite> - <outputDirectory>${project.build.directory}/test-classes/</outputDirectory> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <!-- - <plugin> - <groupId>org.apache.tuscany.maven.plugins</groupId> - <artifactId>maven-osgi-junit-plugin</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>${pom.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <id>osgi-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration></configuration> - </execution> - </executions> - </plugin> - --> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/BPELClient.java b/java/sca/samples/helloworld-bpel/src/main/java/helloworld/BPELClient.java deleted file mode 100644 index 6a9891a821..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/BPELClient.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * Simple BPEL sample application invoking a helloworld - * - * @version $Rev$ $Date$ - */ -public class BPELClient { - public static void main(String[] args) throws Exception { - - String contribution = ContributionLocationHelper.getContributionLocation(BPELClient.class); - Node node = NodeFactory.newInstance().createNode("helloworld.composite", new Contribution("calculator", contribution)); - node.start(); - - Hello bpelService = node.getService(Hello.class, "BPELHelloWorldComponent"); - - String result = bpelService.hello("Hello"); - System.out.println(result); - - node.stop(); - - System.exit(0); - } -} diff --git a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java b/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java deleted file mode 100644 index dbd3854d7c..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Hello { - - String hello(String name); - -} diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index b95468acd8..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:sample="http://bpel"> - <deployable composite="sample:bpel"/> -</contribution>
\ No newline at end of file diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.bpel b/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.bpel deleted file mode 100644 index 19afe61fd3..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.bpel +++ /dev/null @@ -1,78 +0,0 @@ -<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<process name="HelloWorld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
- expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
-
- <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
- namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
-
- <partnerLinks>
- <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
- </partnerLinks>
-
- <variables>
- <variable name="myVar" messageType="test:HelloMessage"/>
- <variable name="tmpVar" type="xsd:string"/>
- </variables>
-
- <sequence>
- <receive
- name="start"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="myVar"
- createInstance="yes"/>
-
- <assign name="assign1">
- <copy>
- <from>concat($myVar.TestPart/test:message/text(), ' World')</from>
- <to variable="tmpVar"/>
- </copy>
- <!--
- <copy>
- <from>
- <literal>
- <test:hello>
- <test:message>$tmpVar</test:message>
- </test:hello>
- </literal>
- </from>
- <to variable="myVar" part="TestPart"/>
- </copy>
- -->
- <copy>
- <from>$tmpVar</from>
- <to>$myVar.TestPart/test:message</to>
- </copy>
- </assign>
- <reply name="end"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="myVar"/>
- </sequence>
-</process>
diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.composite b/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.composite deleted file mode 100644 index 603cc17af9..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.composite +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - targetNamespace="http://bpel" - xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld" - name="bpel"> - - <component name="BPELHelloWorldComponent"> - <implementation.bpel process="hns:HelloWorld"/> - </component> - -</composite> diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.wsdl b/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.wsdl deleted file mode 100644 index 46cf381577..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/resources/helloworld.wsdl +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<wsdl:definitions - targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" - xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> - - <wsdl:types> - <schema elementFormDefault="qualified" - targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns="http://www.w3.org/2001/XMLSchema"> - - <element name="hello"> - <complexType> - <sequence> - <element name="message" type="xsd:string"/> - </sequence> - </complexType> - </element> - </schema> - </wsdl:types> - - <wsdl:message name="HelloMessage"> - <wsdl:part element="tns:hello" name="TestPart"/> - </wsdl:message> - - <wsdl:portType name="HelloPortType"> - <wsdl:operation name="hello"> - <wsdl:input message="tns:HelloMessage" name="TestIn"/> - <wsdl:output message="tns:HelloMessage" name="TestOut"/> - </wsdl:operation> - </wsdl:portType> - - - <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType"> - <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="hello"> - <wsdlsoap:operation soapAction=""/> - <wsdl:input name="TestIn"> - <wsdlsoap:body use="literal"/> - </wsdl:input> - <wsdl:output name="TestOut"> - <wsdlsoap:body use="literal"/> - </wsdl:output> - </wsdl:operation> - </wsdl:binding> - - <wsdl:service name="HelloService"> - <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding"> - <soap:address location="http://localhost:8085/ode/processes/helloWorld"/> - </wsdl:port> - </wsdl:service> - - <plnk:partnerLinkType name="HelloPartnerLinkType"> - <plnk:role name="me" portType="tns:HelloPortType"/> - <plnk:role name="you" portType="tns:HelloPortType"/> - </plnk:partnerLinkType> -</wsdl:definitions>
\ No newline at end of file diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/log4j.properties b/java/sca/samples/helloworld-bpel/src/main/resources/log4j.properties deleted file mode 100644 index 8649a71550..0000000000 --- a/java/sca/samples/helloworld-bpel/src/main/resources/log4j.properties +++ /dev/null @@ -1,35 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Set root logger level to WARN and its only appender to CONSOLE -log4j.rootLogger=OFF, CONSOLE - -# log4j properties to work with commandline tools. -log4j.category.org.mortbay=OFF -log4j.category.org.hibernate.type=OFF -log4j.category.org.objectweb=OFF -log4j.category.org.apache.ode.sql=OFF -log4j.category.org.apache.ode.axis2=OFF -log4j.category.org.apache.ode.bpel.engine=OFF -log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF -log4j.category.org.apache.ode.bpel.epr=OFF -log4j.category.org.apache.openjpa.kernel=OFF - -# Console appender -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n
\ No newline at end of file diff --git a/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java b/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java deleted file mode 100644 index d311bad3c5..0000000000 --- a/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Tests the BPEL service - * - * @version $Rev$ $Date$ - */ -public class BPELHelloWorldTestCase { - - private static Node node; - private static Hello bpelService; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUp() throws Exception { - // String location = ContributionLocationHelper.getContributionLocation(BPELClient.class); - String location = ContributionLocationHelper.getContributionLocation("helloworld.composite"); - node = NodeFactory.newInstance().createNode(new Contribution("c1", location)); - node.start(); - - bpelService = node.getService(Hello.class, "BPELHelloWorldComponent"); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testInvoke() throws Exception { - String response = bpelService.hello("Hello"); - Assert.assertEquals("Hello World", response); - } -} diff --git a/java/sca/samples/implementation-java-calculator/README b/java/sca/samples/implementation-java-calculator/README deleted file mode 100644 index 28eccbdebb..0000000000 --- a/java/sca/samples/implementation-java-calculator/README +++ /dev/null @@ -1,96 +0,0 @@ -Calculator Sample -================= -This sample implements a simple calculator using SCA components. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -jar ..\..\features\tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ..\..\features\configuration\ -ttl 0 target\sample-implementation-java-calculator.jar -and on *nix do - -java -jar ../../features/tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ../../features/configuration/ -ttl 0 target/sample-implementation-java-calculator.jar - -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. - -calculator/ - src/ - main/ - java/ - calculator/ - CalculatorService.java - the first component, calls +-/* as - appropriate - CalculatorServiceImpl.java - AddService.java - adds two numbers - AddServiceImpl.java - SubtractService.java - subtracts one number from another - SubtractServiceImpl.java - MultiplyService.java - multiplies two numbers - MultiplyServiceImpl.java - DivideService.java - divides one number by another - DivideServiceImpl.java - CalculatorClient.java - starts the SCA Runtime and - deploys the Calculator.composite. - It then calls the deployed Calculator - Components services - resources/ - Calculator.composite - the SCA assembly for this sample - test/ - java/ - calculator/ - CalculatorTestCase.java - JUnit test case - calculator.png - a pictorial representation of the sample - .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant as -follows - -cd calculator -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd calculator -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running calculator.CalculatorTestCase -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. diff --git a/java/sca/samples/implementation-java-calculator/build.xml b/java/sca/samples/implementation-java-calculator/build.xml deleted file mode 100644 index b95847f600..0000000000 --- a/java/sca/samples/implementation-java-calculator/build.xml +++ /dev/null @@ -1,59 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<project name="implementation-java-calculator" default="run"> <!-- could dertmine the same name autmatically --> - - <property name="jar.name" value="sample-implementation-java-calculator.jar" /> - - <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> - <pathelement location="../../modules/tuscany-sca-api-2.0-SNAPSHOT.jar"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${jar.name}" basedir="target/classes"/> - </target> - - <target name="run" depends="compile"> - <java classname="org.apache.tuscany.sca.launcher.LauncherMain" - fork="true" - inputstring="q" - failonerror="true"> - <classpath> - <pathelement location="../../bin/launcher.jar"/> - </classpath> - <arg value="target/${jar.name}"/> - </java> - </target> -</project> diff --git a/java/sca/samples/implementation-java-calculator/calculator.png b/java/sca/samples/implementation-java-calculator/calculator.png Binary files differdeleted file mode 100644 index 995a57b1fd..0000000000 --- a/java/sca/samples/implementation-java-calculator/calculator.png +++ /dev/null diff --git a/java/sca/samples/implementation-java-calculator/calculator.svg b/java/sca/samples/implementation-java-calculator/calculator.svg deleted file mode 100644 index af34f07e04..0000000000 --- a/java/sca/samples/implementation-java-calculator/calculator.svg +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * 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.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/java/sca/samples/implementation-java-calculator/pom.xml b/java/sca/samples/implementation-java-calculator/pom.xml deleted file mode 100644 index 82b7d23309..0000000000 --- a/java/sca/samples/implementation-java-calculator/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-implementation-java-calculator</artifactId> - <name>Apache Tuscany SCA Sample Implementation Java Calculator</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-api</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-feature-core</artifactId> - <type>pom</type> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddService.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 84c98d7f70..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -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: " + print(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)); - } - - private static String print(ClassLoader cl) { - StringBuffer buf = new StringBuffer(); - for (; cl != null;) { - buf.append(cl.toString()); - buf.append(' '); - cl = cl.getParent(); - } - return buf.toString(); - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 031fa8b912..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 17fad7de6b..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - - -/** - * An implementation of the Calculator service. - */ -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); - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/java/sca/samples/implementation-java-calculator/src/main/resources/Calculator.composite b/java/sca/samples/implementation-java-calculator/src/main/resources/Calculator.composite deleted file mode 100644 index 9450558145..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/main/resources/Calculator.composite +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - 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"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - - <component name="CalculatorClient"> - <implementation.java class="calculator.CalculatorClient"/> - <reference name="calculatorService" target="CalculatorServiceComponent" /> - </component> - -</composite> diff --git a/java/sca/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 461c970373..0000000000 --- a/java/sca/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - - private static NodeLauncher launcher; - private static Node node; - private static String status = "Sample Success"; - - public static void main(String[] args) throws Exception { - setUpBeforeClass(); - tearDownAfterClass(); - } - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - launcher = NodeLauncher.newInstance(); - String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - node = launcher.createNode("Calculator.composite", new Contribution("test", location)); - - try { - node.start(); - } catch (Exception ex) { - status = ex.toString(); - System.out.println(status); - } - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node.destroy(); - } - if (launcher != null) { - launcher.destroy(); - } - } - - @Test - public void testSample() throws Exception { - Assert.assertEquals("Sample Success", status); - } -} diff --git a/java/sca/samples/logging.properties b/java/sca/samples/logging.properties deleted file mode 100644 index cf452e7812..0000000000 --- a/java/sca/samples/logging.properties +++ /dev/null @@ -1,25 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -handlers= java.util.logging.ConsoleHandler - -.level = INFO - -java.util.logging.ConsoleHandler.level = FINE -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter - -org.apache.tuscany.sca.level = INFO diff --git a/java/sca/samples/pom.xml b/java/sca/samples/pom.xml deleted file mode 100644 index 2cd4c4ac9a..0000000000 --- a/java/sca/samples/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-samples</artifactId> - <packaging>pom</packaging> - <name>Apache Tuscany SCA Samples</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <profiles> - <profile> - <id>default</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <modules> - <module>calculator</module> - <module>calculator-equinox</module> - <module>calculator-osgi</module> - <module>calculator-rmi-reference</module> - <module>calculator-rmi-service</module> - <module>dosgi-calculator</module> - <module>dosgi-calculator-operations</module> - <module>dosgi-dynamic-calculator</module> - -<!-- ********* - IF YOU ADD ANY SAMPLES THEN ALSO ADD THEM TO - distribution\all\src\main\components\bin-samples.xml - OR THEY WONT GET IN RELEASES - ********* --> - - <module>dosgi-dynamic-calculator-operations</module> - <module>helloworld-bpel</module> - <module>implementation-java-calculator</module> - <module>binding-ws-calculator</module> - <module>webapps/helloworld</module> - <module>webapps/helloworld-bpel</module> - <module>webapps/helloworld-jms</module> - <module>webapps/helloworld-js-client</module> - <module>webapps/helloworld-jsp</module> - <module>webapps/helloworld-stripes</module> - <module>webapps/helloworld-servlet</module> - </modules> - </profile> - </profiles> -</project> diff --git a/java/sca/samples/store-webapp/README b/java/sca/samples/store-webapp/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/java/sca/samples/store-webapp/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/java/sca/samples/store-webapp/pom.xml b/java/sca/samples/store-webapp/pom.xml deleted file mode 100644 index b9bb4af45b..0000000000 --- a/java/sca/samples/store-webapp/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-webapp</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Getting Started Online Store as WebApp</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-webapp</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-js-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-js-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-maven-ant-generator</artifactId> - <version>2.0-SNAPSHOT</version> - <executions> - <execution> - <configuration> - <buildDependencyFileOnly>true</buildDependencyFileOnly> - </configuration> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/store-webapp/src/main/java/services/Cart.java b/java/sca/samples/store-webapp/src/main/java/services/Cart.java deleted file mode 100644 index 3fb5439bc3..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/Catalog.java b/java/sca/samples/store-webapp/src/main/java/services/Catalog.java deleted file mode 100644 index b5e504fe11..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverter.java b/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index a064f3dd69..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java b/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java b/java/sca/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index d132a24b00..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/Item.java b/java/sca/samples/store-webapp/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java b/java/sca/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 698614212d..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/java/sca/samples/store-webapp/src/main/java/services/Total.java b/java/sca/samples/store-webapp/src/main/java/services/Total.java deleted file mode 100644 index b77cc1c7ac..0000000000 --- a/java/sca/samples/store-webapp/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/java/sca/samples/store-webapp/src/main/resources/store.composite b/java/sca/samples/store-webapp/src/main/resources/store.composite deleted file mode 100644 index 2fa6f93b39..0000000000 --- a/java/sca/samples/store-webapp/src/main/resources/store.composite +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://store" - name="store"> - - <component name="Store"> - <tuscany:implementation.widget location="store.html"/> - <reference name="catalog" target="Catalog"> - <tuscany:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Catalog"/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <tuscany:binding.atom uri="http://localhost:8080/sample-store-webapp/ShoppingCart/Cart"/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <tuscany:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Total"/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <tuscany:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Catalog"/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <implementation.java class="services.ShoppingCartImpl"/> - <service name="Cart"> - <tuscany:binding.atom uri="http://localhost:8080/sample-store-webapp/ShoppingCart/Cart"/> - </service> - <service name="Total"> - <tuscany:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Total"/> - </service> - </component> - - <component name="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml b/java/sca/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index 41c84c9a44..0000000000 --- a/java/sca/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:store="http://store"> - <deployable composite="store:store"/> -</contribution>
\ No newline at end of file diff --git a/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml deleted file mode 100644 index d191961f95..0000000000 --- a/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web:web-app - xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" - xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0" - xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" - xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" - xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-2.0" - xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2" - xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2" - xmlns:pers="http://java.sun.com/xml/ns/persistence" - xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" - xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" - xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"> - <dep:environment> - <dep:moduleId> - <dep:groupId>org.apache.tuscany</dep:groupId> - <dep:artifactId>sample-store-secure-webapp</dep:artifactId> - <dep:version>1.0</dep:version> - <dep:type>car</dep:type> - </dep:moduleId> - - <!-- TUSCANY-2622 --> - <dep:hidden-classes> - <dep:filter>org.apache.axiom</dep:filter> - <dep:filter>org.apache.axis2</dep:filter> - <dep:filter>org.apache.commons</dep:filter> - <dep:filter>org.jdom</dep:filter> - </dep:hidden-classes> - - </dep:environment> - <web:context-root>/sample-store-secure-webapp</web:context-root> -</web:web-app> diff --git a/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 348be0df21..0000000000 --- a/java/sca/samples/store-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> - <display-name>sample-store-secure-webapp</display-name> - - <filter> - <filter-name>tuscany</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>store.html</welcome-file> - </welcome-file-list> -</web-app>
\ No newline at end of file diff --git a/java/sca/samples/store-webapp/src/main/webapp/store.html b/java/sca/samples/store-webapp/src/main/webapp/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/java/sca/samples/store-webapp/src/main/webapp/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<html> -<head> -<title>Store</title> - -<script type="text/javascript" src="store.js"></script> - -<script language="JavaScript"> - - //@Reference - var catalog = new tuscany.sca.Reference("catalog"); - - //@Reference - var shoppingCart = new tuscany.sca.Reference("shoppingCart"); - - //@Reference - var shoppingTotal = new tuscany.sca.Reference("shoppingTotal"); - - var catalogItems; - - function catalog_getResponse(items,exception) { - if(exception){ - alert(exception.message); - return; - } - var catalog = ""; - - for (var i=0; i<items.length; i++) { - var item = items[i].name + ' - ' + items[i].price; - catalog += '<input name="items" type="checkbox" value="' + - item + '">' + item + ' <br>'; - } - document.getElementById('catalog').innerHTML=catalog; - catalogItems = items; - } - - function shoppingCart_getResponse(feed) { - if (feed != null) { - var entries = feed.getElementsByTagName("entry"); - var list = ""; - for (var i=0; i<entries.length; i++) { - var content = entries[i].getElementsByTagName("content")[0]; - var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; - var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; - list += name + ' - ' + price + ' <br>'; - } - document.getElementById("shoppingCart").innerHTML = list; - - if (entries.length != 0) { - try { - shoppingTotal.getTotal(shoppingTotal_getTotalResponse); - } - catch(e){ - alert(e); - } - } - } - } - - function shoppingTotal_getTotalResponse(total,exception) { - if(exception) { - alert(exception.message); - return; - } - document.getElementById('total').innerHTML = total; - } - - function shoppingCart_postResponse(entry) { - shoppingCart.get("", shoppingCart_getResponse); - } - - function addToCart() { - var items = document.catalogForm.items; - var j = 0; - for (var i=0; i<items.length; i++) - if (items[i].checked) { - - var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' + - '<Item xmlns="http://services/">' + - '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' + - '</Item>' + '</content></entry>'; - shoppingCart.post(entry, shoppingCart_postResponse); - items[i].checked = false; - } - } - function checkoutCart() { - document.getElementById('store').innerHTML='<h2>' + - 'Thanks for Shopping With Us!</h2>'+ - '<h2>Your Order</h2>'+ - '<form name="orderForm">'+ - document.getElementById('shoppingCart').innerHTML+ - '<br>'+ - document.getElementById('total').innerHTML+ - '<br>'+ - '<br>'+ - '<input type="submit" value="Continue Shopping">'+ - '</form>'; - shoppingCart.del("", null); - } - function deleteCart() { - shoppingCart.del("", null); - document.getElementById('shoppingCart').innerHTML = ""; - document.getElementById('total').innerHTML = ""; - } - - function init() { - - try { - catalog.get(catalog_getResponse); - shoppingCart.get("", shoppingCart_getResponse); - } - catch(e){ - alert(e); - } - } - -</script> - -</head> - -<body onload="init()"> -<h1>Store</h1> - <div id="store"> - <h2>Catalog</h2> - <form name="catalogForm"> - <div id="catalog" ></div> - <br> - <input type="button" onClick="addToCart()" value="Add to Cart"> - </form> - - <br> - - <h2>Your Shopping Cart</h2> - <form name="shoppingCartForm"> - <div id="shoppingCart"></div> - <br> - <div id="total"></div> - <br> - <input type="button" onClick="checkoutCart()" value="Checkout"> - <input type="button" onClick="deleteCart()" value="Empty"> - <a href="../ShoppingCart/Cart/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/java/sca/samples/store-webapp/store.png b/java/sca/samples/store-webapp/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/java/sca/samples/store-webapp/store.png +++ /dev/null diff --git a/java/sca/samples/store-webapp/store.svg b/java/sca/samples/store-webapp/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/java/sca/samples/store-webapp/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/java/sca/samples/store/README b/java/sca/samples/store/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/java/sca/samples/store/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/java/sca/samples/store/build.xml b/java/sca/samples/store/build.xml deleted file mode 100644 index dec09d5dc2..0000000000 --- a/java/sca/samples/store/build.xml +++ /dev/null @@ -1,79 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project name="store" default="compile"> - <property name="test.class" value="launch.Launch" /> - <property name="test.jar" value="sample-store.jar" /> - - <target name="init"> - <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"> - <classpath> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${test.jar}" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="${test.class}" /> - </manifest> - </jar> - </target> - - <target name="run-classes"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/classes"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="run"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/${test.jar}"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - - <fileset id="3rdparty.jars" dir="../../lib"> - <include name="saxon-8.7.jar"/> - </fileset> -</project> diff --git a/java/sca/samples/store/pom.xml b/java/sca/samples/store/pom.xml deleted file mode 100644 index 5e54efd09b..0000000000 --- a/java/sca/samples/store/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Store</name> - - <repositories> - <repository> - <id>apache.incubator</id> - <url>http://people.apache.org/repo/m2-incubating-repository</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-js-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-js-dojo</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-jetty</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/java/sca/samples/store/src/main/java/launch/Launch.java b/java/sca/samples/store/src/main/java/launch/Launch.java deleted file mode 100644 index 06981d17eb..0000000000 --- a/java/sca/samples/store/src/main/java/launch/Launch.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launch; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -public class Launch { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - String contribution = ContributionLocationHelper.getContributionLocation(Launch.class); - Node node = NodeFactory.newInstance().createNode("store.composite", new Contribution("test", contribution)); - node.start(); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - node.stop(); - node.destroy(); - System.out.println(); - } -} diff --git a/java/sca/samples/store/src/main/java/services/Cart.java b/java/sca/samples/store/src/main/java/services/Cart.java deleted file mode 100644 index 3fb5439bc3..0000000000 --- a/java/sca/samples/store/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/java/sca/samples/store/src/main/java/services/Catalog.java b/java/sca/samples/store/src/main/java/services/Catalog.java deleted file mode 100644 index b5e504fe11..0000000000 --- a/java/sca/samples/store/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/java/sca/samples/store/src/main/java/services/CurrencyConverter.java b/java/sca/samples/store/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index a064f3dd69..0000000000 --- a/java/sca/samples/store/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/java/sca/samples/store/src/main/java/services/CurrencyConverterImpl.java b/java/sca/samples/store/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/java/sca/samples/store/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/java/sca/samples/store/src/main/java/services/FruitsCatalogImpl.java b/java/sca/samples/store/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index d132a24b00..0000000000 --- a/java/sca/samples/store/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/java/sca/samples/store/src/main/java/services/Item.java b/java/sca/samples/store/src/main/java/services/Item.java deleted file mode 100644 index fe32cfc828..0000000000 --- a/java/sca/samples/store/src/main/java/services/Item.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/java/sca/samples/store/src/main/java/services/ShoppingCartImpl.java b/java/sca/samples/store/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 698614212d..0000000000 --- a/java/sca/samples/store/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/java/sca/samples/store/src/main/java/services/Total.java b/java/sca/samples/store/src/main/java/services/Total.java deleted file mode 100644 index b77cc1c7ac..0000000000 --- a/java/sca/samples/store/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/java/sca/samples/store/src/main/resources/store.composite b/java/sca/samples/store/src/main/resources/store.composite deleted file mode 100644 index e8f4715f74..0000000000 --- a/java/sca/samples/store/src/main/resources/store.composite +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://store" - name="store"> - - <component name="Store"> - <tuscany:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <tuscany:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"/> - <reference name="shoppingCart" target="ShoppingCart/Cart"/> - <reference name="shoppingTotal" target="ShoppingCart/Total"/> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <tuscany:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <implementation.java class="services.ShoppingCartImpl"/> - <service name="Cart"> - <tuscany:binding.atom uri="/ShoppingCart/Cart"/> - </service> - <service name="Total"> - <tuscany:binding.jsonrpc/> - </service> - </component> - - <component name="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/store/src/main/resources/uiservices/store.html b/java/sca/samples/store/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/java/sca/samples/store/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<html> -<head> -<title>Store</title> - -<script type="text/javascript" src="store.js"></script> - -<script language="JavaScript"> - - //@Reference - var catalog = new tuscany.sca.Reference("catalog"); - - //@Reference - var shoppingCart = new tuscany.sca.Reference("shoppingCart"); - - //@Reference - var shoppingTotal = new tuscany.sca.Reference("shoppingTotal"); - - var catalogItems; - - function catalog_getResponse(items,exception) { - if(exception){ - alert(exception.message); - return; - } - var catalog = ""; - - for (var i=0; i<items.length; i++) { - var item = items[i].name + ' - ' + items[i].price; - catalog += '<input name="items" type="checkbox" value="' + - item + '">' + item + ' <br>'; - } - document.getElementById('catalog').innerHTML=catalog; - catalogItems = items; - } - - function shoppingCart_getResponse(feed) { - if (feed != null) { - var entries = feed.getElementsByTagName("entry"); - var list = ""; - for (var i=0; i<entries.length; i++) { - var content = entries[i].getElementsByTagName("content")[0]; - var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; - var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; - list += name + ' - ' + price + ' <br>'; - } - document.getElementById("shoppingCart").innerHTML = list; - - if (entries.length != 0) { - try { - shoppingTotal.getTotal(shoppingTotal_getTotalResponse); - } - catch(e){ - alert(e); - } - } - } - } - - function shoppingTotal_getTotalResponse(total,exception) { - if(exception) { - alert(exception.message); - return; - } - document.getElementById('total').innerHTML = total; - } - - function shoppingCart_postResponse(entry) { - shoppingCart.get("", shoppingCart_getResponse); - } - - function addToCart() { - var items = document.catalogForm.items; - var j = 0; - for (var i=0; i<items.length; i++) - if (items[i].checked) { - - var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' + - '<Item xmlns="http://services/">' + - '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' + - '</Item>' + '</content></entry>'; - shoppingCart.post(entry, shoppingCart_postResponse); - items[i].checked = false; - } - } - function checkoutCart() { - document.getElementById('store').innerHTML='<h2>' + - 'Thanks for Shopping With Us!</h2>'+ - '<h2>Your Order</h2>'+ - '<form name="orderForm">'+ - document.getElementById('shoppingCart').innerHTML+ - '<br>'+ - document.getElementById('total').innerHTML+ - '<br>'+ - '<br>'+ - '<input type="submit" value="Continue Shopping">'+ - '</form>'; - shoppingCart.del("", null); - } - function deleteCart() { - shoppingCart.del("", null); - document.getElementById('shoppingCart').innerHTML = ""; - document.getElementById('total').innerHTML = ""; - } - - function init() { - - try { - catalog.get(catalog_getResponse); - shoppingCart.get("", shoppingCart_getResponse); - } - catch(e){ - alert(e); - } - } - -</script> - -</head> - -<body onload="init()"> -<h1>Store</h1> - <div id="store"> - <h2>Catalog</h2> - <form name="catalogForm"> - <div id="catalog" ></div> - <br> - <input type="button" onClick="addToCart()" value="Add to Cart"> - </form> - - <br> - - <h2>Your Shopping Cart</h2> - <form name="shoppingCartForm"> - <div id="shoppingCart"></div> - <br> - <div id="total"></div> - <br> - <input type="button" onClick="checkoutCart()" value="Checkout"> - <input type="button" onClick="deleteCart()" value="Empty"> - <a href="../ShoppingCart/Cart/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/java/sca/samples/store/store.png b/java/sca/samples/store/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/java/sca/samples/store/store.png +++ /dev/null diff --git a/java/sca/samples/store/store.svg b/java/sca/samples/store/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/java/sca/samples/store/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/java/sca/samples/webapps/helloworld-bpel/pom.xml b/java/sca/samples/webapps/helloworld-bpel/pom.xml deleted file mode 100644 index dad495c13a..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/pom.xml +++ /dev/null @@ -1,130 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-bpel</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld BPEL</name>
-
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- <jetty.version>6.1.18</jetty.version>
- </properties>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
-
- <!-- JETTY DEPENDENCIES FOR TESTING -->
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-management</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.1.1</version>
- <type>zip</type>
- <overWrite>false</overWrite>
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- <includes>**/*</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java deleted file mode 100644 index c1a50d9be5..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HelloworldService { - - String hello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel b/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel deleted file mode 100644 index f1e8895f76..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel +++ /dev/null @@ -1,66 +0,0 @@ -<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<process name="HelloWorld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
- expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
-
- <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
- namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
-
- <partnerLinks>
- <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
- </partnerLinks>
-
- <variables>
- <variable name="myVar" messageType="test:HelloMessage"/>
- <variable name="tmpVar" type="xsd:string"/>
- </variables>
-
- <sequence>
- <receive
- name="start"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="myVar"
- createInstance="yes"/>
-
- <assign name="assign1">
- <copy>
- <from>concat('Hello ', $myVar.TestPart/test:message/text())</from>
- <to variable="tmpVar"/>
- </copy>
- <copy>
- <from>$tmpVar</from>
- <to>$myVar.TestPart/test:message</to>
- </copy>
- </assign>
- <reply name="end"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="myVar"/>
- </sequence>
-</process>
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl b/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl deleted file mode 100644 index 46cf381577..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<wsdl:definitions - targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/" - xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"> - - <wsdl:types> - <schema elementFormDefault="qualified" - targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" - xmlns="http://www.w3.org/2001/XMLSchema"> - - <element name="hello"> - <complexType> - <sequence> - <element name="message" type="xsd:string"/> - </sequence> - </complexType> - </element> - </schema> - </wsdl:types> - - <wsdl:message name="HelloMessage"> - <wsdl:part element="tns:hello" name="TestPart"/> - </wsdl:message> - - <wsdl:portType name="HelloPortType"> - <wsdl:operation name="hello"> - <wsdl:input message="tns:HelloMessage" name="TestIn"/> - <wsdl:output message="tns:HelloMessage" name="TestOut"/> - </wsdl:operation> - </wsdl:portType> - - - <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType"> - <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="hello"> - <wsdlsoap:operation soapAction=""/> - <wsdl:input name="TestIn"> - <wsdlsoap:body use="literal"/> - </wsdl:input> - <wsdl:output name="TestOut"> - <wsdlsoap:body use="literal"/> - </wsdl:output> - </wsdl:operation> - </wsdl:binding> - - <wsdl:service name="HelloService"> - <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding"> - <soap:address location="http://localhost:8085/ode/processes/helloWorld"/> - </wsdl:port> - </wsdl:service> - - <plnk:partnerLinkType name="HelloPartnerLinkType"> - <plnk:role name="me" portType="tns:HelloPortType"/> - <plnk:role name="you" portType="tns:HelloPortType"/> - </plnk:partnerLinkType> -</wsdl:definitions>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 3ffe604ef7..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld" - targetNamespace="http://sample" - name="helloworld-bpel"> - - <component name="WebComponent"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"> - <interface.java interface="sample.HelloworldService"/> - </reference> - </component> - - <component name="HelloworldComponent"> - <implementation.bpel process="hns:HelloWorld"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index bf01a7b759..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app version="2.4" - xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > - - <display-name>helloworld-bpel</display-name> - - <filter> - <filter-name>tuscany.helloworld-bpel</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany.helloworld-bpel</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>hello.jsp</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp deleted file mode 100644 index c52d7b1cb2..0000000000 --- a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
-
-<sca:reference name="service" type="sample.HelloworldService" />
-
-<html>
- <body >
-
- <h2>helloworld-bpel</h2>
-
- Calling HelloworldService sayHello("world") returns:
-
- <p>
-
- <%= service.hello("world") %>
-
- </body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-jms/README b/java/sca/samples/webapps/helloworld-jms/README deleted file mode 100644 index 88bbe9adcb..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/README +++ /dev/null @@ -1,131 +0,0 @@ -JMS HelloWorld Sample -===================== -This sample demonstrates a simple webapp containing a hello world style client -and service using the JMS binding for request-response style messaging. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -As this sample provides a web app there is a manual step where the WAR file -that contains the sample is copied to your web app container. If you just want -to give this sample a go deploy the WAR file (target/helloworld-jms.war ) -to you web application server. Alternatevly, the sample pom.xml is configured -with the Jetty plugin so you can run the it with Jetty by simply doing "mvn jetty:run". - -Once the web app is deployed use your browser to visit the following URL; - -http://localhost:8080/helloworld-jms - -The port and hostname will of course vary depending on your local installation. - -Configuring the JMS resources ------------------------------ - -The sample requires JMS resources be manually configured in the server environment, these are: - -- a JMS connection factory named "ConnectionFactory" -- a JMS queue named "HelloWorldService" - -See the following for how to define these resources depending on the application server being used: - -Tuscany with embedded ActiveMQ broker -------------------------------------- - - -Apache Tomcat -------------- - -No configuration is necessary for Tomcat as the sample WAR includes everything pre-configured to run -an ActiveMQ embedded JMS broker and to configure the JMS resources in JNDI. - -The JNDI resources are configured in the META-INF/comtext.xml file, for more information on running -ActiveMQ in Tomcat see: http://activemq.apache.org/tomcat.html - - -Apache Geronimo ---------------- - -For Apache Geronimo 2.0.1 (2.0.2 fails to define JMS resources for me) - -Logon to the Geronimo Server Console (http://localhost:8080/console, uid system, pswd manager) - -In the Console Navigation on the left under Services click JMS Resources - -At the bottom of the JMS Resources panel click under Create a new JMS Resource Group click For ActiveMQ - -In Resource Group Name enter "MyRGN" and click next - -At JMS Resource Group click Add Connection Factory - -For JMS Factory Type choose javax.jms.ConnectionFactory and click Next - -In Connection Factory Name enter "ConnectionFactory" and click Next - -Click Add destination - -For JMS Destination Type choose javax.jms.Queue and click Next - -Enter "HelloWorldService" for both Message Destination Name and PhysicalName and click Next - -Click Deploy Now - -Thats it, you're done. - - -WebSphere ---------- - -To define the JMS resources in a new WebSphere Application Server 6.1 installation: - -1) First define a Service integration bus: - -Logon to the WebSphere Integrated Solutions Console (http://localhost:9060/ibm/console) - -On the Left hand menu expand Service integration, and click on Buses. - -In the Buses panel click on New - -Enter a name for the bus, eg MyBus, and click Next, and then click Finish and Save the changes. - -In the Buses panel click on MyBus - -Find the Topology secion and click on Bus members - -Click on Add, leave the defaults and click Next, Next, Next, Finish, and Save the changes. - -Restart WebSphere and when back up logon back on to the Integrated Solutions Console - -2) Now define the JMS rescources - -On the Left hand menu expand Resources, and JMS and click on Connection Facotories. - -In the Connection factories panel click New. - -Leave the Default messaging provider and click OK - -Enter "ConnectionFactory" in the Name and JNDI name and in the Bus name in the Connection pane choose MyBus and click OK - -On the Left hand menu in JMS click on Queues - -In the Queues panel click New, accept the defaults and click OK - -Enter "HelloWorldService" for the Name and JNDI name and in the Bus name in the Connection pane choose MyBus, -and then in the Queue name drop down list choose "Create SIB destination" - -In the Set queue attributes panel enter "HelloWorldService" for the Identifier and click Next, Next, and Finish - -That should take you back to the Queues panel where you can click OK to create the new JMS queue. - -Save the changes - -Restart WebSphere and you're done. - - - -Others... ---------- - - - -
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-jms/pom.xml b/java/sca/samples/webapps/helloworld-jms/pom.xml deleted file mode 100644 index 4e45d20d5c..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-jms</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample JMS HelloWorld in a WebApp</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jms-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>activemq-core</artifactId> - <version>5.1.0</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - <version>3.1</version> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldClient.java b/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldClient.java deleted file mode 100644 index f209f11605..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldClient.java +++ /dev/null @@ -1,37 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-/**
- * The HelloWorld client implementation
- */
-public class HelloWorldClient implements HelloWorldService {
-
- HelloWorldService helloWorldRef;
-
- public String sayHello(String name) {
- System.out.println("HelloWorldClient.sayHello " + name);
- return helloWorldRef.sayHello(name);
- }
-
- public void setHelloWorldRef(HelloWorldService helloWorldRef) {
- System.out.println("HelloWorldClient.setHelloWorldService " + helloWorldRef);
- this.helloWorldRef = helloWorldRef;
- }
-}
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldService.java b/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldService.java deleted file mode 100644 index df2a852161..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldService.java +++ /dev/null @@ -1,29 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the helloworld service
- */
-@Remotable
-public interface HelloWorldService {
- public String sayHello(String name);
-}
diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldServiceImpl.java b/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldServiceImpl.java deleted file mode 100644 index c09af51e23..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-/**
- * This class implements the HelloWorld service.
- */
-public class HelloWorldServiceImpl implements HelloWorldService {
-
- public String sayHello(String name) {
- System.out.println("HelloWorldServiceImpl.sayHello " + name);
- return "Hello " + name;
- }
-
-}
diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/META-INF/context.xml b/java/sca/samples/webapps/helloworld-jms/src/main/webapp/META-INF/context.xml deleted file mode 100644 index 7575edfc29..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/META-INF/context.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<!-- -This file configures the ActiveMQ JMS resources and is only required when -using Apache ActiveMQ as the JMS broker in Apache Tomcat. ---> - -<Context> - - <Resource name="ConnectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" - factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm://localhost?broker.persistent=false" brokerName="LocalActiveMQBroker"/> - - <Resource name="HelloWorldService" auth="Container" type="org.apache.activemq.command.ActiveMQQueue" description="my Queue" - factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="RequestQueue"/> - -</Context>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/jetty-env.xml b/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/jetty-env.xml deleted file mode 100644 index a8cd27f6c6..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/jetty-env.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<!--
-This file configures the ActiveMQ JMS resources and is only required when
-using Apache ActiveMQ as the JMS broker in Jetty.
--->
-
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-
-<Configure class="org.mortbay.jetty.webapp.WebAppContext">
-
- <New id="cf" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>ConnectionFactory</Arg>
- <Arg>
- <New class="org.apache.activemq.ActiveMQConnectionFactory">
- <Arg>vm://localhost?broker.persistent=false</Arg>
- </New>
- </Arg>
- </New>
-
- <New id="myQueue" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg>HelloWorldService</Arg>
- <Arg>
- <New class="org.apache.activemq.command.ActiveMQQueue">
- <Arg>DEMO</Arg>
- </New>
- </Arg>
- </New>
-
-</Configure>
diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 5c52638661..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloWorldClientComponent"/>
- </component>
-
- <component name="HelloWorldClientComponent">
- <implementation.java class="sample.HelloWorldClient"/>
- <reference name="helloWorldRef">
- <binding.jms uri="jms:HelloWorldService"/>
- </reference>
- </component>
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="sample.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms />
- </service>
- </component>
-
-</composite>
diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 86710435ae..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * 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.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
-Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
-
- <display-name>Apache Tuscany JMS Web Service Sample</display-name>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
- <!-- Uncomment this to use an appserver thread pool
- <resource-ref>
- <res-ref-name>wm/TuscanyWorkManager</res-ref-name>
- <res-type>commonj.work.WorkManager</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
- -->
-
- <!-- Uncomment these to use local jndi name aliases
- <resource-ref>
- <res-ref-name>ConnectionFactory</res-ref-name>
- <res-type>javax.jms.ConnectionFactory</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
-
- <resource-ref>
- <res-ref-name>HelloWorldService</res-ref-name>
- <res-type>javax.jms.Queue</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
- -->
-
-</web-app>
diff --git a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/hello.jsp b/java/sca/samples/webapps/helloworld-jms/src/main/webapp/hello.jsp deleted file mode 100644 index 9ae037f2c2..0000000000 --- a/java/sca/samples/webapps/helloworld-jms/src/main/webapp/hello.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
---%>
-
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
-
-<sca:reference name="service" type="sample.HelloWorldService" />
-
-<html>
-<head><title>HelloWorld JMS sample</title></head>
-
-<body>
-
-If this sample is working correctly you should see "Hello World" on the next line...
-<p>
-<%= service.sayHello("world") %>
-<p>
-If you do not see "Hello World" on the line above then there has been a problem.
-<p>
-The sample requires JMS resources be manually configured in the server environment, these are:
-a JMS connection factory named "ConnectionFactory", and a destination queues named "HelloWorldService".
-See the sample README file for more information.
-
-</body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-js-client/pom.xml b/java/sca/samples/webapps/helloworld-js-client/pom.xml deleted file mode 100644 index a85e72b925..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-js-client</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld Javascript Client</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-client</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 123774b936..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
diff --git a/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 66cef71a25..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
diff --git a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index c59c7a8f6d..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent">
- <interface.java interface="sample.HelloworldService" />
- </reference>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
diff --git a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index babeb7b203..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>Apache Tuscany Helloworld JSP Sample</display-name>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
diff --git a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/hello.html b/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/hello.html deleted file mode 100644 index 12024cc4d3..0000000000 --- a/java/sca/samples/webapps/helloworld-js-client/src/main/webapp/hello.html +++ /dev/null @@ -1,51 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<html>
-
-<head>
- <title>Apache Tuscany Helloworld Javascript Client Sample</title>
-
- <script type="text/javascript" src="org.oasisopen.sca.componentContext.js"></script>
-
- <script language="JavaScript">
-
- function callSayHello() {
- componentContext.getService("service").sayHello(document.getElementById('name').value, sayHelloResponse);
- }
-
- function sayHelloResponse(reply) {
- document.getElementById('result').innerHTML=reply;
- }
-
- </script>
-
-</head>
-
-<body>
-
-<h2>Apache Tuscany Helloworld Javascript Client Sample</h2>
-
- <input type="text" id="name" width="10">
-
- <button name="submit" onclick="callSayHello()">Say hello</button>
-
- <div id='result'></div>
-
-</body>
-</html>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-jsf/pom.xml b/java/sca/samples/webapps/helloworld-jsf/pom.xml deleted file mode 100644 index e9093cc098..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-jsf</artifactId> - <name>Apache Tuscany SCA Sample Helloworld JSF</name> - <packaging>war</packaging> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-myfaces</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java deleted file mode 100644 index 9c9f541997..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; - -/** - * - */ -public class HelloWorldController { - - @Reference - protected HelloworldService service; - - private String name; - - public HelloWorldController() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Method that is backed to a submit button of a form. - */ - public String send() { - if (service == null) { - name = "reference not injected!"; - } else { - name = service.sayHello(name); - } - return "success"; - } - -} diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 23925d6c69..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 99cee9faeb..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<faces-config version="1.2" - xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> - - <!-- managed beans of the simple hello world app --> - <managed-bean> - <managed-bean-name>helloWorld</managed-bean-name> - <managed-bean-class>sample.HelloWorldController</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - </managed-bean> - - <!-- navigation rules for helloWorld.jsp --> - <navigation-rule> - <from-view-id>/helloWorld.jsp</from-view-id> - <navigation-case> - <from-outcome>success</from-outcome> - <to-view-id>/page2.jsp</to-view-id> - </navigation-case> - </navigation-rule> - - <!-- navigation rules for page2.jsp --> - <navigation-rule> - <from-view-id>/page2.jsp</from-view-id> - <navigation-case> - <from-outcome>back</from-outcome> - <to-view-id>/helloWorld.jsp</to-view-id> - </navigation-case> - </navigation-rule> - -</faces-config> diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 875d6aae9d..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="foo"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"/> - </component> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index fecbd7c79b..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,191 +0,0 @@ -<?xml version="1.0"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> - - <description>MyProject web.xml</description> - - <!-- The only web.xml change to the MyFaces Helloworld sample is to add - the Tuscany listener and annotation processor context parameter --> - <listener> - <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class> - </listener> - <context-param> - <param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name> - <param-value>org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider</param-value> - </context-param> - - <!--optional: context-param> - <description>Comma separated list of URIs of (additional) faces config files. - (e.g. /WEB-INF/my-config.xml) - See JSF 1.0 PRD2, 10.3.2 - Attention: You do not need to put /WEB-INF/faces-config.xml in here. - </description> - <param-name>javax.faces.CONFIG_FILES</param-name> - <param-value>/WEB-INF/examples-config.xml</param-value> - </context-param--> - <context-param> - <description>State saving method: "client" or "server" (= default) - See JSF Specification 2.5.3</description> - <param-name>javax.faces.STATE_SAVING_METHOD</param-name> - <param-value>client</param-value> - </context-param> - <context-param> - <description>Only applicable if state saving method is "server" (= default). - Defines the amount (default = 20) of the latest views are stored in session.</description> - <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name> - <param-value>20</param-value> - </context-param> - <context-param> - <description>Only applicable if state saving method is "server" (= default). - If true (default) the state will be serialized to a byte stream before it - is written to the session. - If false the state will not be serialized to a byte stream.</description> - <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name> - <param-value>true</param-value> - </context-param> - <context-param> - <description>Only applicable if state saving method is "server" (= default) and if - org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default) - If true (default) the serialized state will be compressed before it - is written to the session. If false the state will not be compressed.</description> - <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name> - <param-value>true</param-value> - </context-param> - <context-param> - <description>This parameter tells MyFaces if javascript code should be allowed in the - rendered HTML output. - If javascript is allowed, command_link anchors will have javascript code - that submits the corresponding form. - If javascript is not allowed, the state saving info and nested parameters - will be added as url parameters. - Default: "true"</description> - <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name> - <param-value>true</param-value> - </context-param> - <context-param> - <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name> - <param-value>false</param-value> - </context-param> - <context-param> - <description>If true, rendered HTML code will be formatted, so that it is "human readable". - i.e. additional line separators and whitespace will be written, that do not - influence the HTML code. - Default: "true"</description> - <param-name>org.apache.myfaces.PRETTY_HTML</param-name> - <param-value>true</param-value> - </context-param> - <context-param> - <description>If true, a javascript function will be rendered that is able to restore the - former vertical scroll on every request. Convenient feature if you have pages - with long lists and you do not want the browser page to always jump to the top - if you trigger a link or button action that stays on the same page. - Default: "false"</description> - <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> - <param-value>true</param-value> - </context-param> - - <context-param> - <description>Used for encrypting view state. Only relevant for client side - state saving. See MyFaces wiki/web site documentation for instructions - on how to configure an application for diffenent encryption strengths. - </description> - <param-name>org.apache.myfaces.SECRET</param-name> - <param-value>NzY1NDMyMTA=</param-value> - </context-param> - - <context-param> - <description> - Validate managed beans, navigation rules and ensure that forms are not nested. - </description> - <param-name>org.apache.myfaces.VALIDATE</param-name> - <param-value>true</param-value> - </context-param> - - <context-param> - <description> - Treat readonly same as if disabled attribute was set for select elements. - </description> - <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name> - <param-value>true</param-value> - </context-param> - - <context-param> - <description> - Use the defined class as the class which will be called when a resource is added to the - ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add - custom components and want to use the ExtensionFilter, you need to provide your custom implementation here. - </description> - <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name> - <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value> - </context-param> - - <context-param> - <description> - Virtual path in the URL which triggers loading of resources for the MyFaces extended components - in the ExtensionFilter. - </description> - <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name> - <param-value>/faces/myFacesExtensionResource</param-value> - </context-param> - - <context-param> - <description> - Check if the extensions-filter has been properly configured. - </description> - <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name> - <param-value>true</param-value> - </context-param> - - <context-param> - <description> - Define partial state saving as true/false. - </description> - <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name> - <param-value>false</param-value> - </context-param> - - <!-- Listener, to allow Jetty serving MyFaces apps --> - <listener> - <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> - </listener> - - <!-- Faces Servlet --> - <servlet> - <servlet-name>Faces Servlet</servlet-name> - <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <!-- Faces Servlet Mapping --> - <servlet-mapping> - <servlet-name>Faces Servlet</servlet-name> - <url-pattern>*.jsf</url-pattern> - </servlet-mapping> - - <!-- Welcome files --> - <welcome-file-list> - <welcome-file>index.jsp</welcome-file> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/helloWorld.jsp b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/helloWorld.jsp deleted file mode 100644 index 189c142c99..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/helloWorld.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-
-<html>
- <head>
- <title>Apache Tuscany Helloworld JSF sample</title>
- </head>
- <body>
- <h2>Apache Tuscany Helloworld JSF sample</h2>
- <f:view>
- <h:form id="mainForm">
- <h:panelGrid columns="2">
- <h:outputLabel for="name" value="Please enter your name" />
- <h:inputText id="name" value="#{helloWorld.name}" required="true"/>
- <h:commandButton value="Press me" action="#{helloWorld.send}"/>
- <h:messages showDetail="true" showSummary="false"/>
- </h:panelGrid>
- </h:form>
- </f:view>
- </body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/index.jsp b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/index.jsp deleted file mode 100644 index 5ca296e115..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/index.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<%@ page session="false"%>
-<%
-response.sendRedirect("helloWorld.jsf");
-%>
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/page2.jsp b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/page2.jsp deleted file mode 100644 index 89259021c7..0000000000 --- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/page2.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<html>
- <head>
- <title>Apache Tuscany Helloworld JSF sample</title>
- </head>
- <body>
- <h2>Apache Tuscany Helloworld JSF sample</h2>
- <f:view>
- <h:form id="mainForm">
- <h:inputTextarea readonly="true" rows="20" cols="80" value="#{helloWorld.name}"/>
- <br>
- <h:commandLink action="back">
- <h:outputText value="Home"/>
- </h:commandLink>
- </h:form>
- </f:view>
- </body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-jsp/pom.xml b/java/sca/samples/webapps/helloworld-jsp/pom.xml deleted file mode 100644 index 88773913a5..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-jsp</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Helloworld JSP</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index a22c095f29..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 875d6aae9d..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="foo"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"/> - </component> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index fa1f7ad7b9..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app version="2.4" - xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > - - <display-name>Apache Tuscany Helloworld JSP Sample</display-name> - - <filter> - <filter-name>tuscany</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>hello.jsp</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/hello.jsp b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/hello.jsp deleted file mode 100644 index ffd01cca73..0000000000 --- a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/hello.jsp +++ /dev/null @@ -1,37 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
-
-<sca:reference name="service" type="sample.HelloworldService" />
-
-<html>
- <body >
-
- <h2>Apache Tuscany Helloworld JSP Sample</h2>
-
- Calling HelloworldService sayHello("world") returns:
-
- <p>
-
- <%= service.sayHello("world") %>
-
- </body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-rest/README b/java/sca/samples/webapps/helloworld-rest/README deleted file mode 100644 index 00568d9bb0..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/README +++ /dev/null @@ -1,37 +0,0 @@ -Hello World REST Sample
-=======================
-
-Sample Overview
----------------
-The service 'HelloWorldService' is exposed using the REST binding.
-
-helloworld-jsonrpc-webapp/
- src/
- main/
- java/
- helloworldjsonrpc/
- HelloWorldService.java - service interface
- HelloWorldServiceImpl.java - service implementation
- ClientTestServiceWebapp.java - Test class; uses java.net.HttpURLConnection to make 'GET', 'PUT', 'POST requests
- resources/
- rest.composite - the SCA assembly for this sample
- webapp
- META-INF/
- sca-contribution.xml - specifies the composite to be deployed
- WEB-INF/
- web.xml - defines the listener that starts up the
- Tuscany SCA runtime
- pom.xml - the Maven build file
-
-Build the sample using Maven.
-A war 'helloworld-rest-webapp.war' will be created in the target directory. Deploy it in your web container.
-You can access the service from the browser by making a simple GET request using the following URL:
-http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname
-
-Use the test class 'ClientTestServiceWebapp' to test PUT, POST operations.
-
-
-
-
-
-
diff --git a/java/sca/samples/webapps/helloworld-rest/pom.xml b/java/sca/samples/webapps/helloworld-rest/pom.xml deleted file mode 100644 index 0bb7a58812..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>helloworld-rest</artifactId> - <packaging>war</packaging> - <name>HelloWorld RESTFul Web Application</name> - - <repositories> - <repository> - <id>maven2-repository.dev.java.net</id> - <name>Java.net Repository for Maven</name> - <url>http://download.java.net/maven/2/</url> - <layout>default</layout> - </repository> - <repository> - <id>maven-repository.dev.java.net</id> - <name>Java.net Maven 1 Repository (legacy)</name> - <url>http://download.java.net/maven/1</url> - <layout>legacy</layout> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-rest-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>jsr311-api</artifactId> - <version>1.0</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-bundle</artifactId> - <version>1.0.3</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java deleted file mode 100644 index 8c84b4f372..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworldrest; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/* - * To test, simply run the program - * Access the service by invoking the getName() method of HelloWorldService - */ - -public class ClientJavaTestService { - - /** - * @param args - */ - public static void main(String[] args) { - NodeFactory factory = NodeFactory.newInstance(); - Node node = factory.createNode("rest.composite", ClientJavaTestService.class.getClassLoader()).start(); - HelloWorldService helloService = node.getService(HelloWorldService.class, "HelloWorldRESTServiceComponent"); - - //HelloWorldService helloService = new HelloWorldServiceImpl(); - System.out.println("### Message from REST service " + helloService.getName()); - - node.stop(); - node.destroy(); - factory.destroy(); - } - -} diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java deleted file mode 100644 index 31ff956185..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworldrest; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Formatter; - -/** - * - * To test, deploy the application as a webapp. - * Then, run this file to access the REST web service by making HTTP GET/POST requests - * - */ -public class ClientTestServiceWebapp { - - final static String UrlBase = "http://localhost:8080/helloworld-rest-webapp/HelloWorldService"; - - final static class HttpResponse { - Object content; - int code; - String message; - } - - static HttpResponse makeHttpGetRequest(String method, String url, String contentType) throws Exception { - HttpResponse response = new HttpResponse(); - URL urlAddress = new URL(url); - HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection(); - huc.setRequestMethod(method); - huc.setRequestProperty("Content-type", contentType); - huc.connect(); - InputStreamReader isr = new InputStreamReader(huc.getInputStream()); - - BufferedReader in = new BufferedReader(isr); - String uline = in.readLine(); - response.content = uline; - - // huc.disconnect(); - // System.out.println("#### huc disconnected ###"); - - return response; - } - - static HttpResponse makeHttpRequest(String method, String url, String contentType, InputStream is) throws Exception { - HttpResponse response = new HttpResponse(); - URL urlAddress = new URL(url); - HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection(); - huc.setRequestMethod(method); - if (null != is) { - huc.setDoOutput(true); - huc.setRequestProperty("Content-Type", contentType); - OutputStream os = huc.getOutputStream(); - byte[] buf = new byte[1024]; - int read; - while ((read = is.read(buf)) != -1) { - os.write(buf, 0, read); - } - } - InputStreamReader isr = new InputStreamReader(huc.getInputStream()); - BufferedReader in = new BufferedReader(isr); - String uline = in.readLine(); - response.content = uline; - return response; - } - - static HttpResponse makeHttpGetRequest(String method, String url, String contentType, String content) - throws Exception { - return makeHttpRequest(method, url, contentType, new ByteArrayInputStream(content.getBytes("UTF-8"))); - } - - static HttpResponse makeHttpRequest(String method, String url) throws Exception { - return makeHttpRequest(method, url, null, (InputStream)null); - } - - public static void main(String[] args) { - try { - - HttpResponse response; - - System.out.println("Getting the name *BEFORE* setting it:"); - response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain"); - System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString())); - - System.out.println("Setting the name:"); - String newText = "Morpheus"; - InputStream inputStream = new ByteArrayInputStream(newText.getBytes()); - response = makeHttpRequest("PUT", UrlBase + "/helloworld/setname", "text/plain", inputStream); - - System.out.println("Getting the name *AFTER* setting it:"); - response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain"); - System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString())); - - System.out.println("POST Operation:"); - response = makeHttpGetRequest("POST", UrlBase + "/helloworld/postoperation/prateek", "text/plain"); - //System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString())); - - System.out.println("Getting the name *AFTER* the POST operation:"); - response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain"); - System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString())); - } catch (Exception e) { - System.out.println("TEST FAILED! :-("); - e.printStackTrace(System.out); - } - } -} diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java deleted file mode 100644 index 7e33b15efc..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworldrest; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HelloWorldService { - - public void setName(String name); - - public String getName(); - - public void postOperationTest(String name); -} diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java deleted file mode 100644 index d4441c0ab8..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworldrest; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; - -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(HelloWorldService.class) -@Scope("Composite") -@Path("/helloworld") -public class HelloWorldServiceImpl implements HelloWorldService { - - private String name = new String("original!"); - - @Path("/setname") - @PUT - @Consumes("text/plain") - public void setName(String name) { - this.name = name; - - } - - //http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname - @Path("/getname") - @GET - @Produces("text/plain") - public String getName() { - return this.name; - } - - @POST - @Path("/postoperation/{name}/") - @Consumes("text/plain") - public void postOperationTest(@PathParam("name") String name) { - this.name = name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite b/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite deleted file mode 100644 index 7f76f5946d..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> - -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://sample" - xmlns:sample="http://sample" - name="helloworldrest"> - - <service name="HelloWorldService" promote="HelloWorldRESTServiceComponent/HelloWorldService"> - <interface.java interface="helloworldrest.HelloWorldService"/> - <tuscany:binding.rest /> - </service> - - <component name="HelloWorldRESTServiceComponent"> - <implementation.java class="helloworldrest.HelloWorldServiceImpl"/> - </component> - -</composite> - diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/HelloWorldJSONRPC.html b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/HelloWorldJSONRPC.html deleted file mode 100644 index 745164bf8d..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/HelloWorldJSONRPC.html +++ /dev/null @@ -1,75 +0,0 @@ -<html>
-<!--
- * 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.
- -->
- <head>
- <title>Tuscany JSON-RPC HelloWorld Example</TITLE>
-
- <script type="text/javascript" src="SCADomain/scaDomain.js"></script>
-
- <script language="JavaScript">
-
- function getGreeting() {
- var name = document.getElementById("name").value;
- HelloWorldService.getGreetings(name, handleResponse);
- }
-
- function handleResponse(result) {
- document.getElementById('greeting').innerHTML=result;
- }
-
- </script>
-
- <link rel="stylesheet" type="text/css" href="style.css" />
- </head>
-
- <body>
-
- <h2>Tuscany JSON-RPC HelloWorld Sample</h2>
-
- <table>
- <tr>
- <th colspan="2">Non-Dojo Example</th>
- </tr>
- <tr>
- <td colspan="2">
- This example uses the JavaScript served from
- <a href="SCADomain/scaDomain.js">SCADomain/scaDomain.js</a>
- to make JSON-RPC requests to the SCA service 'HelloWorldService'
- </tr>
- <tr>
- <td>Request</td>
- <td>Response</td>
- </tr>
- <tr>
- <td>
- <p>
- Name please:
- <input type="text" id="name" size="30" value="World" />
- <input type="button" value="Submit" onclick="getGreeting()" />
- </p>
-
- </td>
- <td>
- <div id='greeting'>None Yet.</div>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index 9fc16372b3..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. ---> - -<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://sample" - xmlns:sample="http://sample"> - <deployable composite="sample:helloworldrest"/> -</contribution> - diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 3a670696e4..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - * 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. ---> - -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web -Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> -<web-app> - - <filter> - <filter-name>tuscany</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/style.css b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/style.css deleted file mode 100644 index 0f1cea3aaf..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/style.css +++ /dev/null @@ -1,22 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-* { font-family: arial; }
-
-table, th, td { border: 2px solid blue; border-collapse: collapse; }
-th { color: white; background-color: blue; }
diff --git a/java/sca/samples/webapps/helloworld-rest/target/classes/rest.composite b/java/sca/samples/webapps/helloworld-rest/target/classes/rest.composite deleted file mode 100644 index 70b83fd986..0000000000 --- a/java/sca/samples/webapps/helloworld-rest/target/classes/rest.composite +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="helloworldrest">
-
- <service name="HelloWorldService" promote="HelloWorldRESTServiceComponent/HelloWorldService">
- <interface.java interface="helloworldrest.HelloWorldService"/>
- <tuscany:binding.rest />
- </service>
-
- <component name="HelloWorldRESTServiceComponent">
- <implementation.java class="helloworldrest.HelloWorldServiceImpl"/>
- </component>
-
-</composite>
-
diff --git a/java/sca/samples/webapps/helloworld-servlet/pom.xml b/java/sca/samples/webapps/helloworld-servlet/pom.xml deleted file mode 100644 index 7c60031b6f..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-servlet</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Helloworld Servlet</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web-runtime</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> -</project> - diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 2e43e09897..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 9e79276704..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java deleted file mode 100644 index bb72c50f6a..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import java.io.IOException; -import java.io.Writer; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Reference; - -/** - */ -public class HelloworldServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - @Reference - protected HelloworldService service; - - @Override - public void init(ServletConfig servletConfig) throws ServletException { - if (service == null) { - System.out.println("HelloworldServlet reference injection failed, using ComponentContext"); - ComponentContext cc = (ComponentContext)servletConfig.getServletContext().getAttribute("org.oasisopen.sca.ComponentContext"); - service = cc.getService(HelloworldService.class, "service"); - } - } - - @Override - protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException { - - String name = request.getParameter("name"); - String greeting = service.sayHello(name); - - Writer out = response.getWriter(); - out.write("<html><head><title>Apache Tuscany Helloworld Servlet Sample</title></head><body>"); - out.write("<h2>Apache Tuscany Helloworld Servlet Sample</h2>"); - out.write("<br><strong>Result: </strong>" + greeting); - out.write("</body></html>"); - out.flush(); - out.close(); - } -} diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 875d6aae9d..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="foo"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"/> - </component> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index a91b3fc96b..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app version="2.4" - xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > - - <display-name>Apache Tuscany Helloworld Servlet Sample</display-name> - - <listener><listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class></listener> - - <servlet> - <servlet-name>HelloworldServlet</servlet-name> - <servlet-class>sample.HelloworldServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>HelloworldServlet</servlet-name> - <url-pattern>/HelloworldServlet</url-pattern> - </servlet-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>hello.html</welcome-file> - </welcome-file-list> - -</web-app> - diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/hello.html b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/hello.html deleted file mode 100644 index c4484916aa..0000000000 --- a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/hello.html +++ /dev/null @@ -1,46 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<html> - -<head> -<title>Apache Tuscany Helloworld Servlet Sample</title> -</head> - -<body> - -<h2>Apache Tuscany Helloworld Servlet Sample</h2> - -<form action="HelloworldServlet" method="post"> - <table> - <tr> - <td>Enter your name:</td> - <td> - <input type="text" name="name" width="10"> - </td> - </tr> - <tr> - <td align="left" colspan="2"> - <button name="submit" type="submit">Say hello</button> - </td> - </tr> - </table> -</form> - -</body> -</html>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-stripes/pom.xml b/java/sca/samples/webapps/helloworld-stripes/pom.xml deleted file mode 100644 index ec5cb600ea..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-stripes</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Helloworld using Stripes</name> - - <dependencies> - - <!-- Tuscany dependencies --> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-stripes</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <!-- Stripes Framework dependencies --> - <dependency> - <groupId>net.sourceforge.stripes</groupId> - <artifactId>stripes</artifactId> - <version>1.5</version> - </dependency> - <dependency> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - <version>1.1.2</version> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java deleted file mode 100644 index 0ab02682ac..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package mystripes.action; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.action.ActionBeanContext; - -public class BaseActionBean implements ActionBean { - private ActionBeanContext context; - - public ActionBeanContext getContext() { - return context; - } - public void setContext(ActionBeanContext context) { - this.context = context; - } -} diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java deleted file mode 100644 index 0385c92369..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package mystripes.action; - -import net.sourceforge.stripes.action.DefaultHandler; -import net.sourceforge.stripes.action.ForwardResolution; -import net.sourceforge.stripes.action.Resolution; -import net.sourceforge.stripes.action.UrlBinding; - -import org.oasisopen.sca.annotation.Reference; - -import sample.HelloworldService; - -@UrlBinding("/Home.htm") -public class HomeActionBean extends BaseActionBean { - - @Reference - HelloworldService service; - - @DefaultHandler - public Resolution view() { - return new ForwardResolution("/WEB-INF/jsp/home.jsp"); - } - - public String getHello() { - return service.sayHello("world"); - } - -} diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index a22c095f29..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/resources/StripesResources.properties b/java/sca/samples/webapps/helloworld-stripes/src/main/resources/StripesResources.properties deleted file mode 100644 index 902842a19e..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/resources/StripesResources.properties +++ /dev/null @@ -1,73 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Resource strings used by the <stripes:errors> tag when there are no nested tags -stripes.errors.header=<div style="color:#b72222; font-weight: bold">Please fix the following errors:</div><ol> -stripes.errors.beforeError=<li style="color: #b72222;"> -stripes.errors.afterError=</li> -stripes.errors.footer=</ol> - -# Resource strings used by the <stripes:errors> tag when displaying errors for a -# specific field (e.g. <stripes:errors field="password"/>). If not supplied the -# values above will be used instead. -stripes.fieldErrors.header= -stripes.fieldErrors.beforeError=<span style="color: #b72222;"> -stripes.fieldErrors.afterError=</span><br /> -stripes.fieldErrors.footer= - -# Resource strings used by the stripes:messages tag -stripes.messages.header=<ul class="messages"> -stripes.messages.beforeMessage=<li> -stripes.messages.afterMessage=</li> -stripes.messages.footer=</ul> - -# Validation error messages produced by Stripes' built-in converter classes. These -# are default error messages and can be overridden on per-field and per-form levels. -# Using the 'invalidNumber' error for a field 'age' of a form posting to -# '/user/Profile.action', the keys looked for (in order) would be: -# 1: /user/Profile.action.age.invalidNumber -# 2: /user/Profile.action.age.errorMessage -# 3: age.errorMessage -# 4: /user/Profile.action.invalidNumber -# 5: converter.number.invalidNumber -converter.number.invalidNumber=The value ({1}) entered in field {0} must be a valid number -converter.byte.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.short.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.integer.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.float.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.enum.notAnEnumeratedValue=The value "{1}" is not a valid value for field {0} -converter.date.invalidDate=The value ({1}) entered in field {0} must be a valid date -converter.email.invalidEmail=The value ({1}) entered is not a valid email address -converter.creditCard.invalidCreditCard=The value ({1}) entered is not a valid credit card number - -# Validation error messages produced by Stripes' annotation based validations. These -# are default error messages and can be overridden on per-field and per-form levels. -# Using the 'valueNotPresent' required field error for a field 'username' of a form -# posting to '/user/Register.action', the keys looked for (in order) would be: -# 1: /user/Register.action.username.valueNotPresent -# 2: /user/Register.action.username.errorMessage -# 3: username.errorMessage -# 4: /user/Register.action.valueNotPresent -# 5: validation.required.valueNotPresent -validation.required.valueNotPresent={0} is a required field -validation.minlength.valueTooShort={0} must be at least {2} characters long -validation.maxlength.valueTooLong={0} must be no more than {2} characters long -validation.minvalue.valueBelowMinimum=The minimum allowed value for {0} is {2} -validation.maxvalue.valueAboveMaximum=The maximum allowed value for {0} is {2} -validation.mask.valueDoesNotMatch=<em>{1}</em> is not a valid {0} -validation.expression.valueFailedExpression=The value supplied ({1}) for field {0} is invalid -validation.file.postBodyTooBig=Total upload size of {3} KB exceeds the maximum size of {2} KB diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/resources/log4j.properties b/java/sca/samples/webapps/helloworld-stripes/src/main/resources/log4j.properties deleted file mode 100644 index 2741999098..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/resources/log4j.properties +++ /dev/null @@ -1,48 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# log4j.properties - -# Set up a logger to the console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n - -# Use this to only see log messages beyond a certain threshold in the console -#log4j.appender.stdout.Threshold=WARN - -# Set up a logger to a log file -log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender -log4j.appender.logfile.layout=org.apache.log4j.PatternLayout -log4j.appender.logfile.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n -log4j.appender.logfile.File=${user.home}/stripesquick.log -log4j.appender.logfile.DatePattern='.'yyyy-MM-dd - -# Use this to only see log messages beyond a certain threshold in the log file -#log4j.appender.logfile.Threshold=WARN - -# Logger settings -log4j.rootLogger=INFO, stdout, logfile - -# Valid levels are TRACE, DEBUG, INFO, WARN, ERROR, FATAL -# Change to TRACE or DEBUG to see more log messages -log4j.logger.net.sourceforge.stripes=WARN -log4j.logger.org.stripesbook.quickstart=INFO -log4j.logger.org.mortbay.log=INFO -log4j.logger.org=WARN -log4j.logger.com=WARN -log4j.logger.net=WARN diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp deleted file mode 100644 index 0681c1f2bf..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp +++ /dev/null @@ -1,26 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<%@ include file="/WEB-INF/jsp/taglibs.jsp" %>
-
-<s:layout-render name="/WEB-INF/jsp/layout.jsp" title="Welcome">
- <s:layout-component name="body">
- <p>sayHello returns: ${actionBean.hello}</p>
- <p>Congratulations, you've set up a Stripes SCA project!</p>
- </s:layout-component>
-</s:layout-render>
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp deleted file mode 100644 index d0fb716b80..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<%@ include file="/WEB-INF/jsp/taglibs.jsp" %>
-
-<s:layout-definition>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title>${title}</title>
- <link rel="stylesheet" type="text/css" href="${contextPath}/css/style.css">
- <s:layout-component name="head">
- </s:layout-component>
- </head>
- <body>
- <div id="main">
- <s:layout-component name="body">
- </s:layout-component>
- </div>
- </body>
-</html>
-
-</s:layout-definition>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp deleted file mode 100644 index f85602fcfa..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<%-- Stripes TLD --%>
-<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
-<%@ taglib prefix="sdyn" uri="http://stripes.sourceforge.net/stripes-dynattr.tld" %>
-
-<%-- JSTL TLDs --%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
-
-<%-- This is so that you can conveniently refer to the context path with ${contextPath} --%>
-<c:set var="contextPath" value="${pageContext.request.contextPath}"/>
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 875d6aae9d..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="foo"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"/> - </component> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index f01584cc2f..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - <!-- - * Licensed to the Apache Software Foundation (ASF) under one * or more - contributor license agreements. See the NOTICE file * distributed with - this work for additional information * regarding copyright ownership. - The ASF licenses this file * to you under the Apache License, Version - 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at * * - http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by - applicable law or agreed to in writing, * software distributed under - the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES - OR CONDITIONS OF ANY * KIND, either express or implied. See the - License for the * specific language governing permissions and - limitations * under the License. - --> -<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> - - <display-name>Apache Tuscany Helloworld Stripes Sample</display-name> - - <listener> - <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class> - </listener> - - <filter> - <filter-name>StripesFilter</filter-name> - <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class> - <init-param> - <param-name>ActionResolver.Packages</param-name> - <param-value>mystripes.action</param-value> - </init-param> - <init-param> - <param-name>Extension.Packages</param-name> - <param-value>org.apache.tuscany.sca.stripes</param-value> - </init-param> - </filter> - - <servlet> - <servlet-name>DispatcherServlet</servlet-name> - <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <filter-mapping> - <filter-name>StripesFilter</filter-name> - <servlet-name>DispatcherServlet</servlet-name> - <dispatcher>REQUEST</dispatcher> - <dispatcher>FORWARD</dispatcher> - </filter-mapping> - - <servlet-mapping> - <servlet-name>DispatcherServlet</servlet-name> - <url-pattern>*.htm</url-pattern> - </servlet-mapping> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/index.html b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/index.html deleted file mode 100644 index c79d29e6a5..0000000000 --- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/index.html +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<!--
- * 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.
--->
-<html>
- <head>
- <meta http-equiv="refresh" content="0;url=Home.htm">
- </head>
-</html>
diff --git a/java/sca/samples/webapps/helloworld-wicket/pom.xml b/java/sca/samples/webapps/helloworld-wicket/pom.xml deleted file mode 100644 index 82f08f1e41..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld-wicket</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Helloworld using Wicket</name> - - <dependencies> - - <!-- Tuscany dependencies --> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-wicket</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - - <!-- Wicket dependencies --> - <dependency> - <groupId>org.apache.wicket</groupId> - <artifactId>wicket</artifactId> - <version>1.4-rc2</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.2</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.14</version> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index a22c095f29..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.html b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.html deleted file mode 100644 index 61eb207e23..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.html +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" >
-<head>
- <title>Wicket Examples - guice</title>
- <link rel="stylesheet" type="text/css" href="style.css"/>
-</head>
-<body>
- <p>
- This page uses <a href="http://code.google.com/p/google-guice/">Google Guice</a>.
- There is a service interface called <code>IMyService</code>, with an implementation POJO called <code>MyService</code>.
- Guice is used to wire the implementation into the <code>Page</code> using an <code>@Inject</code> annotation. You can use this
- annotation on the fields of any <code>Component</code> subclass.
- </p>
- <p>
- The value of the <code>Label</code> component below will be updated with the return value from one of the service's methods when you click the link.
- </p>
- <hr />
- <blockquote>
- Value: <b wicket:id="message" id="message">Message goes here</b>
- <br />
- To update the label above, <a href="#" wicket:id="link">click here</a>.
- </blockquote>
- <hr />
- <p>
- The wicket-guice project will take care of proxying the injected beans so that your pages can be serialized safely.
- To configure your application for Guice injection, see the javadoc for <code>GuiceComponentInjector</code>.
- </p>
-
-</body>
-</html>
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java deleted file mode 100644 index 061f4c58ae..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.wicket; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.AbstractReadOnlyModel; -import org.oasisopen.sca.annotation.Reference; - -/** - * Everybody's favorite example (Hello World), modified to use Guice. - * - * @author Alastair Maw - */ -public class HomePage extends WebPage -{ - @Reference - IMyService service; - - private String labelValue = "<not yet initialized>"; - - /** - * Constructor - */ - public HomePage() - { - add(new Link("link") - { - /** - * @see org.apache.wicket.markup.html.link.Link#onClick() - */ - @Override - public void onClick() - { - labelValue = service.getHelloWorldText(); - } - }); - add(new Label("message", new AbstractReadOnlyModel<String>() - { - - @Override - public String getObject() - { - return labelValue; - } - - })); - } -}
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java deleted file mode 100644 index fdd91b0933..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.wicket; - - -/** - * Service interface for a simple "Hello World" app. - * - * @author Alastair Maw - */ -public interface IMyService -{ - /** - * Retrieves the text to say "Hello World". - * - * @return "Hello World" - */ - public String getHelloWorldText(); -}
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java deleted file mode 100644 index e7d864c5e6..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.wicket; - - -/** - * Implementation of IService. - * - * @author Alastair Maw - */ -public class MyService implements IMyService -{ - - /** - * @see org.apache.wicket.examples.guice.service.IMyService#getHelloWorldText() - */ - public String getHelloWorldText() - { - return "Hello World"; - } - -}
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java deleted file mode 100644 index 85f2c00dbc..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.wicket; - -import org.apache.wicket.Page; -import org.apache.wicket.protocol.http.WebApplication; -import org.apache.tuscany.sca.wicket.TuscanyComponentInjector;; - -/** - * Application object for your web application. If you want to run this application without deploying, run the Start class. - * - * @see com.mycompany.Start#main(String[]) - */ -public class WicketApplication extends WebApplication -{ - - @Override - protected void init() - { - addComponentInstantiationListener(new TuscanyComponentInjector(this)); - } - - /** - * @see org.apache.wicket.Application#getHomePage() - */ - @Override - public Class< ? extends Page> getHomePage() - { - return HomePage.class; - } -}
\ No newline at end of file diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties b/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties deleted file mode 100644 index 1e24577860..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -log4j.appender.Stdout=org.apache.log4j.ConsoleAppender -log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n - -log4j.rootLogger=INFO,Stdout - -log4j.logger.org.apache.wicket=INFO -log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO -log4j.logger.org.apache.wicket.version=INFO -log4j.logger.org.apache.wicket.RequestCycle=INFO - - diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index a52d6b6cbe..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="foo"> - <implementation.web web-uri=""/> - <reference name="service" target="HelloworldComponent"/> - </component> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 3783b7bf82..0000000000 --- a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - <!-- - * Licensed to the Apache Software Foundation (ASF) under one * or more - contributor license agreements. See the NOTICE file * distributed with - this work for additional information * regarding copyright ownership. - The ASF licenses this file * to you under the Apache License, Version - 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at * * - http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by - applicable law or agreed to in writing, * software distributed under - the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES - OR CONDITIONS OF ANY * KIND, either express or implied. See the - License for the * specific language governing permissions and - limitations * under the License. - --> -<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> - - <display-name>Apache Tuscany Helloworld Wicket Sample</display-name> - - <listener> - <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class> - </listener> - - <!-- - There are three means to configure Wickets configuration mode and they are - tested in the order given. - 1) A system property: -Dwicket.configuration - 2) servlet specific <init-param> - 3) context specific <context-param> - The value might be either "development" (reloading when templates change) - or "deployment". If no configuration is found, "development" is the default. - --> - - <filter> - <filter-name>wicket.tuscany</filter-name> - <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> - <init-param> - <param-name>applicationClassName</param-name> - <param-value>sample.wicket.WicketApplication</param-value> - </init-param> - </filter> - - <filter-mapping> - <filter-name>wicket.tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - -</web-app> diff --git a/java/sca/samples/webapps/helloworld/pom.xml b/java/sca/samples/webapps/helloworld/pom.xml deleted file mode 100644 index 1d8a7d3a72..0000000000 --- a/java/sca/samples/webapps/helloworld/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca</artifactId> - <version>2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>helloworld</artifactId> - <name>Apache Tuscany SCA Sample Helloworld</name> - <packaging>war</packaging> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-sca-api</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-webapp</artifactId> - <version>2.0-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.18</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 8d220029a5..0000000000 --- a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@EagerInit -@Scope("COMPOSITE") -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - - @Init - public void init() { - System.out.println(sayHello("world")); - } - -} diff --git a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 045aa4674f..0000000000 --- a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" - targetNamespace="http://samples" - name="Helloworld"> - - <component name="HelloworldComponent"> - <implementation.java class="sample.HelloworldServiceImpl"/> - </component> - -</composite> diff --git a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index d7b237641c..0000000000 --- a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<web-app version="2.4" - xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > - - <display-name>Apache Tuscany Helloworld Sample</display-name> - - <filter> - <filter-name>tuscany</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - -</web-app> |