diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.6/samples')
155 files changed, 0 insertions, 7275 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.classpath b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.classpath deleted file mode 100644 index 73c77ee74d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.classpath +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-assembly"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-assembly-xml"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-assembly-xsd"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-definitions"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-definitions-xml"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-extensibility"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-implementation-java"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-implementation-java-runtime"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-implementation-java-xml"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-interface"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-interface-java"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-interface-java-xml"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-monitor"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-policy"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-sca-api"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-contribution"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-contribution-impl"/> - <classpathentry combineaccessrules="false" kind="src" path="/tuscany-host-embedded"/> - <classpathentry kind="lib" path="/home/acc/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/> - <classpathentry kind="lib" path="/home/acc/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.project b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.project deleted file mode 100644 index b0a16117c8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.project +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>calculator-android</name>
- <comment></comment>
- <projects>
- <project>tuscany-assembly</project>
- <project>tuscany-definitions</project>
- <project>tuscany-extensibility</project>
- <project>tuscany-interface</project>
- <project>tuscany-monitor</project>
- <project>tuscany-policy</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.settings/org.eclipse.jdt.core.prefs b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4077c7b7f0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Mon Nov 24 19:53:10 PST 2008 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/AndroidManifest.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/AndroidManifest.xml deleted file mode 100644 index ad6daf347e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/AndroidManifest.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="calculator.android" - android:versionCode="1" - android:versionName="1.0.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> - <activity android:name=".CalculatorClient" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> -</manifest>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/META-INF/MANIFEST.MF b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/META-INF/MANIFEST.MF deleted file mode 100644 index 58630c02ef..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0
-
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/drawable/icon.png b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/drawable/icon.png Binary files differdeleted file mode 100644 index 75024841d3..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/drawable/icon.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/layout/main.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/layout/main.xml deleted file mode 100644 index 3a5f117d3c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > -<TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" - /> -</LinearLayout> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/values/strings.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/values/strings.xml deleted file mode 100644 index 71052e74b8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World, CalculatorClient</string> - <string name="app_name">Calculator</string> -</resources> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.class Binary files differdeleted file mode 100644 index 8a5ed25f9f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.java deleted file mode 100644 index 21c6789632..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddService.java +++ /dev/null @@ -1,11 +0,0 @@ -package calculator;
-
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.class Binary files differdeleted file mode 100644 index c6fd83f6a1..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.java deleted file mode 100644 index 6181a1c651..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/AddServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorBuilder.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorBuilder.class Binary files differdeleted file mode 100644 index b4466a3017..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorBuilder.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.class Binary files differdeleted file mode 100644 index aaf9e9710f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.java deleted file mode 100644 index 3b977259e8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorClient.java +++ /dev/null @@ -1,30 +0,0 @@ -package calculator;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-
-
-/**
- * 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 {
-
-
- SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
-
- CalculatorService calculatorService =
- scaDomain.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));
-
- scaDomain.close();
-
- }
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.class Binary files differdeleted file mode 100644 index c3cc2911e9..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.java deleted file mode 100644 index 862d7b892d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorService.java +++ /dev/null @@ -1,18 +0,0 @@ -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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.class Binary files differdeleted file mode 100644 index 8e0f206119..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 2c88b5319e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package calculator;
-
-
-//import org.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.class Binary files differdeleted file mode 100644 index 8f056b16b6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.java deleted file mode 100644 index 8f544632dc..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideService.java +++ /dev/null @@ -1,11 +0,0 @@ -package calculator;
-
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.class Binary files differdeleted file mode 100644 index 09cae06d9c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.java deleted file mode 100644 index 5dfae77222..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.class Binary files differdeleted file mode 100644 index 6542db7083..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.java deleted file mode 100644 index f7f4ee77b5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyService.java +++ /dev/null @@ -1,11 +0,0 @@ -package calculator;
-
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.class Binary files differdeleted file mode 100644 index 0e69e7ad2d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 3142f86a58..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.class Binary files differdeleted file mode 100644 index 84c741e301..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.java deleted file mode 100644 index 2349febb0f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractService.java +++ /dev/null @@ -1,11 +0,0 @@ -package calculator;
-
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.class Binary files differdeleted file mode 100644 index 7b1aeab811..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.java deleted file mode 100644 index ec55f4f07d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.class Binary files differdeleted file mode 100644 index 20b588f972..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.java deleted file mode 100644 index 9e5c782447..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/CalculatorClient.java +++ /dev/null @@ -1,233 +0,0 @@ -package calculator.android; - -import java.io.FileDescriptor; -import java.net.InetAddress; -import java.net.URL; -import java.security.Permission; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; -import calculator.CalculatorService; - -public class CalculatorClient extends Activity { - private EmbeddedSCADomain domain; - private CalculatorService calculatorService; - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - String calculationResult = "Error !"; - try { - System.setSecurityManager(new SecurityManager() { - @Override - public void checkPermission(Permission permission) { - - } - - @Override - public void checkAccept(String host, int port) { - - } - - @Override - public void checkAccess(Thread thread) { - // TODO Auto-generated method stub - - } - @Override - public void checkAccess(ThreadGroup group) { - - } - - @Override - public void checkAwtEventQueueAccess() { - // TODO Auto-generated method stub - - } - @Override - public void checkConnect(String host, int port) { - - } - @Override - public void checkConnect(String host, int port, Object context) { - - } - @Override - public void checkCreateClassLoader() { - // TODO Auto-generated method stub - - } - @Override - public void checkDelete(String file) { - - } - @Override - public void checkExec(String cmd) { - // TODO Auto-generated method stub - - } - @Override - public void checkExit(int status) { - - } - @Override - public void checkLink(String libName) { - // TODO Auto-generated method stub - - } - @Override - public void checkListen(int port) { - // TODO Auto-generated method stub - - } - @Override - public void checkMemberAccess(Class<?> cls, int type) { - // TODO Auto-generated method stub - - } - @Override - public void checkMulticast(InetAddress maddr) { - // TODO Auto-generated method stub - - } - @Override - public void checkMulticast(InetAddress maddr, byte ttl) { - // TODO Auto-generated method stub - - } - @Override - public void checkPackageAccess(String packageName) { - // TODO Auto-generated method stub - - } - @Override - public void checkPackageDefinition(String packageName) { - // TODO Auto-generated method stub - - } - @Override - public void checkPermission(Permission permission, - Object context) { - // TODO Auto-generated method stub - - } - @Override - public void checkPrintJobAccess() { - // TODO Auto-generated method stub - - } - @Override - public void checkPropertiesAccess() { - // TODO Auto-generated method stub - - } - @Override - public void checkPropertyAccess(String key) { - // TODO Auto-generated method stub - - } - @Override - public void checkRead(FileDescriptor fd) { - // TODO Auto-generated method stub - - } - @Override - public void checkRead(String file) { - // TODO Auto-generated method stub - - } - @Override - public void checkRead(String file, Object context) { - // TODO Auto-generated method stub - - } - @Override - public void checkSecurityAccess(String target) { - // TODO Auto-generated method stub - - } - @Override - public void checkSetFactory() { - // TODO Auto-generated method stub - - } - @Override - public void checkSystemClipboardAccess() { - // TODO Auto-generated method stub - - } - - @Override - public void checkWrite(FileDescriptor fd) { - // TODO Auto-generated method stub - - } - @Override - public void checkWrite(String file) { - // TODO Auto-generated method stub - - } - - }); - - Thread.currentThread().setContextClassLoader(getClassLoader()); - - SCADomain scaDomain = SCADomain.newInstance("Calculator.composite"); - - CalculatorService calculatorService = - scaDomain.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)); - - scaDomain.close(); - - } catch(Exception e) { - e.printStackTrace(); - } - - - - TextView tv = new TextView(this); - tv.setText("3 + 2 =" + calculationResult); - setContentView(tv); - - } - - @Override - protected void onDestroy() { - super.onDestroy(); - - try { - //scaDomain.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onContentChanged() { - super.onContentChanged(); - /* - // 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)); - */ - - } - - -}
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$attr.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$attr.class Binary files differdeleted file mode 100644 index 4d7e121ddc..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$attr.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$drawable.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$drawable.class Binary files differdeleted file mode 100644 index 842aa47958..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$drawable.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$layout.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$layout.class Binary files differdeleted file mode 100644 index 2b7eadeac8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$layout.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$string.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$string.class Binary files differdeleted file mode 100644 index fd104e6c86..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R$string.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.class b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.class Binary files differdeleted file mode 100644 index 7bca04a8a4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.class +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.java deleted file mode 100644 index a338c98c3a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-android/src/calculator/android/R.java +++ /dev/null @@ -1,23 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package calculator.android; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int icon=0x7f020000; - } - public static final class layout { - public static final int main=0x7f030000; - } - public static final class string { - public static final int app_name=0x7f040001; - public static final int hello=0x7f040000; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/README b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/README deleted file mode 100644 index cde5fe981f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/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 ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../lib/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/build.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/build.xml deleted file mode 100644 index c4b755ef94..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/build.xml +++ /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. ---> -<project name="calculator" default="compile"> - <property name="test.class" value="calculator.CalculatorClient" /> - <property name="test.jar" value="sample-calculator.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"/> - </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"/> - </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"/> - </classpath> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/calculator.png b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/calculator.png Binary files differdeleted file mode 100644 index 995a57b1fd..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/calculator.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/calculator.svg b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/calculator.svg deleted file mode 100644 index af34f07e04..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/pom.xml deleted file mode 100644 index 5730bb5b0a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/pom.xml +++ /dev/null @@ -1,99 +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>1.6-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-calculator-osgi</artifactId> - <name>Apache Tuscany SCA Calculator OSGi Sample</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>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-node-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility-equinox</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> <!-- To be compatible with Jetty 6 --> - <scope>provided</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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/AddService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index c193b2ce66..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/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.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 031fa8b912..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 3d861f2018..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/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.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/resources/Calculator.composite b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/main/resources/Calculator.composite deleted file mode 100644 index 913081b9be..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/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://www.osoa.org/xmlns/sca/1.0" - 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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index dc0da7d20d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 junit.framework.TestCase; - -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Scope; - -/** - * This shows how to test the Calculator composition. - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorTestCase extends TestCase { - - private NodeLauncher launcher; - private SCANode node; - - @Override - protected void setUp() throws Exception { - launcher = NodeLauncher.newInstance(); - node = launcher.createNodeFromClassLoader("Calculator.composite", getClass().getClassLoader()); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - node.start(); - } - - @Override - protected void tearDown() throws Exception { - if (launcher != null) { - node.stop(); - launcher.destroy(); - } - } - - public void testDummy() { - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/build.properties b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/build.properties deleted file mode 100644 index 0530eb648b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/main/java/ -output.. = target/classes/ -bin.includes = plugin.xml,\ - META-INF/,\ - . diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_16.gif b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_16.gif Binary files differdeleted file mode 100644 index 05626b17d8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_16.gif +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_32.gif b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_32.gif Binary files differdeleted file mode 100644 index b432f88339..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/icons/alt_window_32.gif +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/plugin.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/plugin.xml deleted file mode 100644 index 1fb5acd9b5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/plugin.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?> -<plugin> - - <extension - id="application" - point="org.eclipse.core.runtime.applications"> - <application> - <run - class="calculator.rcp.Application"> - </run> - </application> - </extension> - <extension - point="org.eclipse.ui.perspectives"> - <perspective - name="Perspective" - class="calculator.rcp.Perspective" - id="org.apache.tuscany.sca.sample.calculator.rcp.perspective"> - </perspective> - </extension> - <extension - point="org.eclipse.ui.views"> - <view - name="View" - class="calculator.rcp.View" - id="org.apache.tuscany.sca.sample.calculator.rcp.view"> - </view> - </extension> - -</plugin> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/pom.xml deleted file mode 100644 index 98a857d1af..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/pom.xml +++ /dev/null @@ -1,126 +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>1.6-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample.calculator.rcp</artifactId> - <name>Apache Tuscany SCA Calculator RCP Sample</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>1.6-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-impl</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-node-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-extensibility-equinox</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher-equinox</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - <!-- - <dependency> - <groupId>org.eclipse</groupId> - <artifactId>ui</artifactId> - <version>3.3.0-I20070614-0800</version> - </dependency> - --> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> <!-- To be compatible with Jetty 6 --> - <scope>provided</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> - <classpathContainer>org.eclipse.pde.core.requiredPlugins - </classpathContainer> - </classpathContainers> - </configuration> - </plugin> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/Calculator.composite b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/Calculator.composite deleted file mode 100644 index 913081b9be..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/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://www.osoa.org/xmlns/sca/1.0" - 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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/AddService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/AddServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorClient.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index adbd18a9e4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index c89043276e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index ba897fa301..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/DivideServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/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/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Activator.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Activator.java deleted file mode 100644 index 50f68dcb01..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Activator.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.rcp; - -import java.io.File; - -import org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer; -import org.apache.tuscany.sca.node.SCAContribution; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.apache.tuscany.sca.sample.calculator.rcp"; - - // The shared instance - private static Activator plugin; - - private SCANode node; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - Class<?> cls = EquinoxServiceDiscoverer.class; - SCANodeFactory factory = SCANodeFactory.newInstance(); - node = factory.createSCANode("Calculator.composite", new SCAContribution("c1", new File("target/classes").toURI().toString())); - node.start(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - if (node != null) { - node.stop(); - } - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Application.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Application.java deleted file mode 100644 index 5ce6522fed..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Application.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.rcp; - -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PlatformUI; - -/** - * This class controls all aspects of the application's execution - */ -public class Application implements IApplication { - - /* (non-Javadoc) - * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) - */ - public Object start(IApplicationContext context) { - Display display = PlatformUI.createDisplay(); - try { - int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); - if (returnCode == PlatformUI.RETURN_RESTART) { - return IApplication.EXIT_RESTART; - } - return IApplication.EXIT_OK; - } finally { - display.dispose(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.app.IApplication#stop() - */ - public void stop() { - final IWorkbench workbench = PlatformUI.getWorkbench(); - if (workbench == null) - return; - final Display display = workbench.getDisplay(); - display.syncExec(new Runnable() { - public void run() { - if (!display.isDisposed()) - workbench.close(); - } - }); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationActionBarAdvisor.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationActionBarAdvisor.java deleted file mode 100644 index 2fccfb2d77..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationActionBarAdvisor.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.rcp; - -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; -import org.eclipse.ui.application.ActionBarAdvisor; -import org.eclipse.ui.application.IActionBarConfigurer; - -/** - * An action bar advisor is responsible for creating, adding, and disposing of - * the actions added to a workbench window. Each window will be populated with - * new actions. - */ -public class ApplicationActionBarAdvisor extends ActionBarAdvisor { - - // Actions - important to allocate these only in makeActions, and then use - // them - // in the fill methods. This ensures that the actions aren't recreated - // when fillActionBars is called with FILL_PROXY. - private IWorkbenchAction exitAction; - - public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { - super(configurer); - } - - protected void makeActions(final IWorkbenchWindow window) { - // Creates the actions and registers them. - // Registering is needed to ensure that key bindings work. - // The corresponding commands keybindings are defined in the plugin.xml - // file. - // Registering also provides automatic disposal of the actions when - // the window is closed. - - exitAction = ActionFactory.QUIT.create(window); - register(exitAction); - } - - protected void fillMenuBar(IMenuManager menuBar) { - MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); - menuBar.add(fileMenu); - fileMenu.add(exitAction); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchAdvisor.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchAdvisor.java deleted file mode 100644 index ac1893509c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchAdvisor.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.rcp; - -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.application.WorkbenchAdvisor; -import org.eclipse.ui.application.WorkbenchWindowAdvisor; - -public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { - - private static final String PERSPECTIVE_ID = "org.apache.tuscany.sca.sample.calculator.rcp.perspective"; - - public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { - return new ApplicationWorkbenchWindowAdvisor(configurer); - } - - public String getInitialWindowPerspectiveId() { - return PERSPECTIVE_ID; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchWindowAdvisor.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchWindowAdvisor.java deleted file mode 100644 index 6378decf20..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/ApplicationWorkbenchWindowAdvisor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.rcp; - -import org.eclipse.swt.graphics.Point; -import org.eclipse.ui.application.ActionBarAdvisor; -import org.eclipse.ui.application.IActionBarConfigurer; -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.application.WorkbenchWindowAdvisor; - -public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { - - public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { - super(configurer); - } - - public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { - return new ApplicationActionBarAdvisor(configurer); - } - - public void preWindowOpen() { - IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); - configurer.setInitialSize(new Point(400, 300)); - configurer.setShowCoolBar(false); - configurer.setShowStatusLine(false); - configurer.setTitle("Tuscany SCA Calculator RCP Application"); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Perspective.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Perspective.java deleted file mode 100644 index 445b4b65b2..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/Perspective.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.rcp; - -import org.eclipse.ui.IPageLayout; -import org.eclipse.ui.IPerspectiveFactory; - -public class Perspective implements IPerspectiveFactory { - - public void createInitialLayout(IPageLayout layout) { - String editorArea = layout.getEditorArea(); - layout.setEditorAreaVisible(false); - layout.setFixed(true); - - layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 1.0f, editorArea); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/View.java b/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/View.java deleted file mode 100644 index f95c1e029c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/calculator-rcp/src/main/java/calculator/rcp/View.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.rcp; - -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.ViewPart; - -public class View extends ViewPart { - public static final String ID = "org.apache.tuscany.sca.sample.calculator.rcp.view"; - - private TableViewer viewer; - - /** - * The content provider class is responsible for providing objects to the - * view. It can wrap existing objects in adapters or simply return objects - * as-is. These objects may be sensitive to the current input of the view, - * or ignore it and always show the same content (like Task List, for - * example). - */ - class ViewContentProvider implements IStructuredContentProvider { - public void inputChanged(Viewer v, Object oldInput, Object newInput) { - } - - public void dispose() { - } - - public Object[] getElements(Object parent) { - return new String[] {"One", "Two", "Three"}; - } - } - - class ViewLabelProvider extends LabelProvider implements ITableLabelProvider { - public String getColumnText(Object obj, int index) { - return getText(obj); - } - - public Image getColumnImage(Object obj, int index) { - return getImage(obj); - } - - public Image getImage(Object obj) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT); - } - } - - /** - * This is a callback that will allow us to create the viewer and initialize - * it. - */ - public void createPartControl(Composite parent) { - viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - viewer.setContentProvider(new ViewContentProvider()); - viewer.setLabelProvider(new ViewLabelProvider()); - viewer.setInput(getViewSite()); - } - - /** - * Passing the focus request to the viewer's control. - */ - public void setFocus() { - viewer.getControl().setFocus(); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/README b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/README deleted file mode 100644 index 0186006211..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/README +++ /dev/null @@ -1,61 +0,0 @@ -Chat WebApp Sample -================== -This sample demonstrates the SCA DWR binding to implement the classic Ajax sample -of a chat application which allows multiple users to chat from their browsers. - -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/sample-chat-webapp.war) -to your web application server. - -Once the web app is deployed use your browser to visit the following URL; - -http://localhost:8080/sample-chat-webapp - -The port and hostname will of course vary depending on your local installation. - -Sample Overview ---------------- -The sample provides an SCA component which has an SCA service using the SCA DWR -binding and an SCA reference also using the DWR binding. The component implementation -simply forwards every invocation of the service as an invocation on the reference. The -component reference is scoped by the composite so every active client of the composite -will receive every message sent to the component service, thus implementing the chat -application with very little code. - -chat-webapp/ - src/ - main/ - java/ - sample/ - ChatService.java - service interface - ChatServiceImpl.java - service implementation - resources/ - chat.composite - the SCA assembly for this sample - webapp - chat.html - the html UserInterface for this application - 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 - -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 chat-webapp -mvn - -Again this should result in a war file (sample-chat-webapp.war) in the target -directory. Follow the steps described in the previous section for running the web -app and for the expected results. - - diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/build.xml b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/build.xml deleted file mode 100644 index b7b8cc70e7..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/build.xml +++ /dev/null @@ -1,117 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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-chat2-webapp" default="compile"> - - <target name="compile"> - <mkdir dir="target/classes"/> - <javac destdir="target/classes" debug="on" source="1.5" target="1.5"> - <src path="src\main\java"/> - <classpath> - <fileset refid="tuscany.jars"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src\main\resources"/> - <fileset dir="." includes="*" excludes="src, target, pom.xml, build.xml"/> - </copy> - <war destfile="target/sample-chat2-webapp.war" webxml="src/main/webapp/WEB-INF/web.xml"> - <fileset dir="src/main/webapp"/> - <lib refid="tuscany.jars"/> - <lib refid="3rdparty.jars"/> - <classes dir="target/classes"/> - </war> - </target> - - <target name="package" depends="compile"/> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - - <fileset id="tuscany.jars" dir="../../modules"> - <include name="tuscany-assembly-1.6-SNAPSHOT.jar"/> - <include name="tuscany-assembly-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-assembly-xsd-1.6-SNAPSHOT.jar"/> - <include name="tuscany-binding-dwr-1.6-SNAPSHOT.jar"/> - <include name="tuscany-binding-sca-1.6-SNAPSHOT.jar"/> - <include name="tuscany-binding-sca-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-impl-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-java-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-namespace-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-resource-1.6-SNAPSHOT.jar"/> - <include name="tuscany-contribution-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-core-1.6-SNAPSHOT.jar"/> - <include name="tuscany-core-databinding-1.6-SNAPSHOT.jar"/> - <include name="tuscany-core-spi-1.6-SNAPSHOT.jar"/> - <include name="tuscany-databinding-1.6-SNAPSHOT.jar"/> - <include name="tuscany-databinding-jaxb-1.6-SNAPSHOT.jar"/> - <include name="tuscany-definitions-1.6-SNAPSHOT.jar"/> - <include name="tuscany-definitions-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-domain-1.6-SNAPSHOT.jar"/> - <include name="tuscany-domain-api-1.6-SNAPSHOT.jar"/> - <include name="tuscany-extensibility-1.6-SNAPSHOT.jar"/> - <include name="tuscany-extension-helper-1.6-SNAPSHOT.jar"/> - <include name="tuscany-host-embedded-1.6-SNAPSHOT.jar"/> - <include name="tuscany-host-http-1.6-SNAPSHOT.jar"/> - <include name="tuscany-host-webapp-1.6-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-1.6-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-runtime-1.6-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-implementation-web-1.6-SNAPSHOT.jar"/> - <include name="tuscany-interface-1.6-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-1.6-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-jaxws-1.6-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-node-1.6-SNAPSHOT.jar"/> - <include name="tuscany-node-api-1.6-SNAPSHOT.jar"/> - <include name="tuscany-policy-1.6-SNAPSHOT.jar"/> - <include name="tuscany-policy-xml-1.6-SNAPSHOT.jar"/> - <include name="tuscany-sca-api-1.6-SNAPSHOT.jar"/> - </fileset> - <fileset id="3rdparty.jars" dir="../../lib"> - <include name="activation-1.1.jar"/> - <include name="axiom-api-1.2.5.jar"/> - <include name="axiom-impl-1.2.5.jar"/> - <include name="cglib-nodep-2.1_3.jar"/> - <include name="commons-logging-1.1.jar"/> - <include name="dwr-2.0.1.jar"/> - <include name="geronimo-commonj_1.1_spec-1.0.jar"/> - <include name="jaxb-api-2.1.jar"/> - <include name="jaxb-impl-2.1.6.jar"/> - <include name="jaxb2-reflection-2.1.4.jar"/> - <include name="jaxen-1.1-beta-9.jar"/> - <include name="jaxws-api-2.1.jar"/> - <include name="jsr181-api-1.0-MR1.jar"/> - <include name="jsr250-api-1.0.jar"/> - <include name="mail-1.4.jar"/> - <include name="neethi-2.0.2.jar"/> - <include name="saaj-api-1.3.jar"/> - <include name="stax-api-1.0-2.jar"/> - <include name="wstx-asl-3.2.1.jar"/> - <include name="xalan-2.7.0.jar"/> - <include name="xercesImpl-2.8.1.jar"/> - <include name="xml-apis-1.3.03.jar"/> - </fileset> - -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/pom.xml deleted file mode 100644 index 817d7e37eb..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/pom.xml +++ /dev/null @@ -1,104 +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>1.6-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <artifactId>sample-chat2-webapp</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Chat Sample WebApp using callbacks</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>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-dwr</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-web</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <!-- exclude stax 1.0.1 as we're also pulling in javax\xml\stream\stax-api\1.0-2 --> - <dependency> - <groupId>stax</groupId> - <artifactId>stax-api</artifactId> - <version>1.0.1</version> - <scope>provided</scope> - </dependency> - - <!-- marking dependency as provided to exclude from war file --> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.3</version> - <scope>provided</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-maven-ant-generator</artifactId> - <version>1.6-SNAPSHOT</version> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatCallback.java b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatCallback.java deleted file mode 100644 index 7d668052b2..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatCallback.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; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface ChatCallback { - void newMsg(String msg); -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatService.java b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatService.java deleted file mode 100644 index cc9d00ca4a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatService.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package sample; - -import javax.jws.Oneway; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Scope; - -@Remotable -@Scope("COMPOSITE") -@Callback(ChatCallback.class) -public interface ChatService { - - @Oneway - public void addMsg(String msg); -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java deleted file mode 100644 index d714ff82ed..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.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 sample; - -import org.osoa.sca.annotations.Callback; - -public class ChatServiceImpl implements ChatService { - - ChatCallback chatCallback; - - @Callback - public void setCallback(ChatCallback chatCallback) { - this.chatCallback = chatCallback; - } - - public void addMsg(String msg) { - chatCallback.newMsg(msg); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/resources/chat.composite b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/resources/chat.composite deleted file mode 100644 index 93a10d0fdf..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/resources/chat.composite +++ /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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Chat">
-
- <component name="webapp">
- <t:implementation.web war="." />
- <reference name="ChatService" target="ChatService">
- <t:binding.dwr/>
- </reference>
- </component>
-
- <component name="ChatService">
- <implementation.java class="sample.ChatServiceImpl"/>
- <service name="ChatService">
- <t:binding.dwr/>
- </service>
- </component>
-
-</composite>
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index 897849ff8d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/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://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://sample" - xmlns:sample="http://sample"> - <deployable composite="sample:Chat"/> -</contribution>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 6919372e87..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!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 AJAX/DWR Chat 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> - <welcome-file>chat.jsp</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/chat.html b/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/chat.html deleted file mode 100644 index a063e27f8e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/chat2-webapp/src/main/webapp/chat.html +++ /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. ---> -<html> - <head> - <title>Apache Tuscany Ajax/DWR Chat Sample</TITLE> - - <script type="text/javascript" src="org.apache.tuscany.sca.componentContext.js" /> - - <script language="JavaScript"> - - var chatService = componentContext.getService("ChatService"); - - chatService.callbacks.chatResponse = function(msg) { - var chatLog = document.getElementById('chatLog'); - chatLog.innerHTML = msg + '<br>' + chatLog.innerHTML; - } - - function sendChat() { - var chatText = document.getElementById("chatText"); - var nickName = document.getElementById("nickName").value; - var msg = nickName + ": " + chatText.value - chatText.value = ""; - chatText.focus(); - ChatService.addMsg(msg); - } - - function clickButton(e, buttonid){ - var evt = e ? e : window.event; - var bt = document.getElementById(buttonid); - if (bt){ - if (evt.keyCode == 13){ - bt.click(); - return false; - } - } - } - - </script> - - </head> - <body > - - <h2>Apache Tuscany Ajax/DWR Chat Sample</h2> - - A simple client to chat between multiple web browsers:<br><br> - - Nickname: <input type="text" id="nickName" size="10"/> - <br><br> - - Enter text: <input type="text" id="chatText" size="80" onkeypress="return clickButton(event,'Send')"/> - <input type="button" name="Send" value="Send" id="Send" onclick="sendChat()" /> - - <br><br> - <div id="chatLog" style="overflow:auto; height:400px; border:1px solid"></div> - - </body> -</html> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/README b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/README deleted file mode 100644 index 5c669f5da5..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/README +++ /dev/null @@ -1,151 +0,0 @@ -Hello World BPEL Webservices Sample
-======================================
-This sample demonstrates an SCA service implemented by a BPEL process, made available as a Web service.
-
-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/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/build.xml b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/build.xml deleted file mode 100644 index 3ad74393c9..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/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.1.1.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/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/helloworld-bpel.png b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/helloworld-bpel.png Binary files differdeleted file mode 100644 index 5f53a3c5d1..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/helloworld-bpel.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/helloworld-bpel.svg b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/helloworld-bpel.svg deleted file mode 100644 index 5a98f1a07c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/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/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/pom.xml deleted file mode 100644 index 310cc97f82..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/pom.xml +++ /dev/null @@ -1,205 +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>1.6-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-helloworld-bpel-ws</artifactId>
- <name>Apache Tuscany SCA HelloWorld BPEL as Webservice Sample</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-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-ode</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.2</version>
- <scope>test</scope>
- </dependency>
- <!-- dependencies that must be present in order that the build scripts work -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-wsdl2java</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-tools</artifactId>
- <version>1.1-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.7</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <!-- http://jira.codehaus.org/browse/SUREFIRE-322 -->
- <version>2.3.1</version>
- <configuration>
- <useFile>false</useFile>
- <trimStackTrace>false</trimStackTrace>
- <useSystemClassLoader>true</useSystemClassLoader>
- </configuration>
- </plugin>
- <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.1</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.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1-incubating</version>
- <executions>
- <execution>
- <id>generate-bpel-helloworld</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/helloworld.wsdl</schemaFile>
- <targetDirectory>${basedir}/target/wsdl2java-source</targetDirectory>
- <prefix>HelloWorld</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-wsdl2java</artifactId>
- <version>1.6-SNAPSHOT</version>
- <executions>
- <execution>
- <configuration>
- <wsdlFile>${basedir}/src/main/resources/helloworld.wsdl</wsdlFile>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/java/helloworld/BPELClient.java b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/java/helloworld/BPELClient.java deleted file mode 100644 index 971a5373e9..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/java/helloworld/BPELClient.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 helloworld;
-
-import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * Simple BPEL sample application invoking a helloworld
- *
- * @version $Rev: 613905 $ $Date: 2008-01-21 14:41:15 +0000 (Mon, 21 Jan 2008) $
- */
-public class BPELClient {
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("helloworld.composite");
- HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldComponent");
-
- String result = bpelService.hello("Hello");
- System.out.println(result);
-
- scaDomain.close();
-
- System.exit(0);
- }
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.bpel b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.bpel deleted file mode 100644 index a88aa7960c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/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 variable="myVar" part="TestPart"/>
- <to variable="tmpVar"/>
- </copy>
- <copy>
- <from>concat($tmpVar,' World')</from>
- <to variable="myVar" part="TestPart"/>
- </copy>
- </assign>
- <reply name="end"
- partnerLink="helloPartnerLink"
- portType="test:HelloPortType"
- operation="hello"
- variable="myVar"/>
- </sequence>
-</process>
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.composite b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.composite deleted file mode 100644 index 97262109e6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.composite +++ /dev/null @@ -1,33 +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"
- targetNamespace="http://bpel"
- xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- name="bpel">
-
- <component name="BPELHelloWorldComponent">
- <implementation.bpel process="hns:HelloWorld"/>
- <service name="helloPartnerLink">
- <interface.wsdl interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" />
- <binding.ws />
- </service>
- </component>
-
-</composite>
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.wsdl b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/helloworld.wsdl deleted file mode 100644 index 1cb338b283..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/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/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/log4j.properties b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/main/resources/log4j.properties deleted file mode 100644 index c1bc0a0b81..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/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/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/test/java/helloworld/BPELHelloWorldTestCase.java b/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/test/java/helloworld/BPELHelloWorldTestCase.java deleted file mode 100644 index 6ad63f87d9..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/helloworld-bpel-ws/src/test/java/helloworld/BPELHelloWorldTestCase.java +++ /dev/null @@ -1,59 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package helloworld;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * Tests the BPEL service
- *
- * @version $Rev: 636807 $ $Date: 2008-03-13 17:32:45 +0000 (Thu, 13 Mar 2008) $
- */
-public class BPELHelloWorldTestCase extends TestCase {
-
- private SCADomain scaDomain;
- HelloPortType bpelService = null;
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("helloworld.composite");
- bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldComponent");
-
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testInvoke() throws Exception {
- String response = bpelService.hello("Hello");
- assertEquals("Hello World", response);
- }
-}
diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/pom.xml index 9a9ac26731..e139cc8b3e 100644 --- a/sca-java-1.x/branches/sca-java-1.6/samples/pom.xml +++ b/sca-java-1.x/branches/sca-java-1.6/samples/pom.xml @@ -109,7 +109,6 @@ <module>store-dojo</module> <module>store-webapp</module> <module>store-secure</module> - <module>store-distributed</module> <module>supplychain</module> <module>web-resource</module> <!--module>zipcode-jaxws</module--> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.classpath b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.classpath deleted file mode 100644 index 79a84816b6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.project b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.project deleted file mode 100644 index be88b01c5a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>sample-store-android</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/AndroidManifest.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/AndroidManifest.xml deleted file mode 100644 index 4a26dd27c6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="store.android" - android:versionCode="1" - android:versionName="1.0.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> - <activity android:name=".catalog" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> - -<uses-permission android:name="android.permission.INTERNET"></uses-permission> - -</manifest>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/default.properties b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/default.properties deleted file mode 100644 index 0a007ab5e2..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/default.properties +++ /dev/null @@ -1,22 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-3 -# apk configurations. This property allows creation of APK files with limited -# resources. For example, if your application contains many locales and -# you wish to release multiple smaller apks instead of a large one, you can -# define configuration to create apks with limited language sets. -# Format is a comma separated list of configuration names. For each -# configuration, a property will declare the resource configurations to -# include. Example: -# apk-configurations=european,northamerica -# apk-config-european=en,fr,it,de,es -# apk-config-northamerica=en,es -apk-configurations= diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/gen/store/android/R.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/gen/store/android/R.java deleted file mode 100644 index 2484da82dc..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/gen/store/android/R.java +++ /dev/null @@ -1,60 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package store.android; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int addc=0x7f020000; - public static final int icon=0x7f020001; - public static final int rems=0x7f020002; - } - public static final class id { - public static final int ListView01=0x7f050001; - public static final int ListView02=0x7f050007; - public static final int btnClean=0x7f050006; - public static final int tab02=0x7f050002; - public static final int txtEmpty=0x7f050004; - public static final int txtItemC=0x7f050000; - public static final int txtItemS=0x7f050008; - public static final int txtThx=0x7f050003; - public static final int txtTotal=0x7f050005; - } - public static final class layout { - public static final int cat_row=0x7f030000; - public static final int main=0x7f030001; - public static final int shop_row=0x7f030002; - } - public static final class string { - public static final int add_entry_ko=0x7f04000f; - public static final int add_entry_ok=0x7f04000e; - public static final int alert_cancel=0x7f040013; - public static final int alert_yes=0x7f040012; - public static final int app_name=0x7f040001; - public static final int app_tag=0x7f040002; - public static final int btn_add_del1=0x7f040004; - public static final int btn_add_del2=0x7f040005; - public static final int btn_clean=0x7f040003; - public static final int del_all_ok=0x7f040014; - public static final int del_entry_ko=0x7f040011; - public static final int del_entry_ok=0x7f040010; - public static final int get_tag=0x7f04000b; - public static final int hello=0x7f040000; - public static final int howto_del=0x7f040017; - public static final int start_tag=0x7f04000c; - public static final int tab_catalog=0x7f040007; - public static final int tab_shop=0x7f040008; - public static final int title_catalog=0x7f040009; - public static final int title_order=0x7f040016; - public static final int title_shop=0x7f04000a; - public static final int title_thx=0x7f040015; - public static final int txt_empty=0x7f040006; - public static final int txt_total=0x7f04000d; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/addc.png b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/addc.png Binary files differdeleted file mode 100644 index 17259450d8..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/addc.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/icon.png b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/icon.png Binary files differdeleted file mode 100644 index 75024841d3..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/icon.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/rems.png b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/rems.png Binary files differdeleted file mode 100644 index 378690fad4..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/drawable/rems.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/cat_row.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/cat_row.xml deleted file mode 100644 index e7f71cb0b6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/cat_row.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="horizontal" - android:layout_width="fill_parent" - android:padding="10px" - android:layout_height="50px"> - <TextView - android:id="@+id/txtItemC" - android:layout_width="250px" - android:layout_height="30px" - android:textSize="20px" - - /> - - <ImageView android:src="@drawable/addc" - android:layout_width="30px" - android:layout_height="30px" - /> -</LinearLayout>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/main.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/main.xml deleted file mode 100644 index 7f296e9ac0..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/main.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TabHost xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/tabhost" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <LinearLayout - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <TabWidget - android:id="@android:id/tabs" - android:layout_width="fill_parent" - android:layout_height="wrap_content" /> - <FrameLayout - android:id="@android:id/tabcontent" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - - - <ListView android:id="@+id/ListView01" - android:layout_width="fill_parent" - android:layout_height="wrap_content" /> - - <LinearLayout - android:id="@+id/tab02" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - - <TextView - android:id="@+id/txtThx" - android:layout_width="fill_parent" - android:layout_height="30px" - android:text="@string/title_thx" - /> - <TextView - android:id="@+id/txtEmpty" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - <LinearLayout - android:orientation="horizontal" - android:layout_width="fill_parent" - android:layout_height="41px"> - - <TextView - android:id="@+id/txtTotal" - android:layout_width="200px" - android:layout_height="30px" - android:text="@string/title_order" - /> - - <Button android:id="@+id/btnClean" - android:layout_width="100px" - android:layout_height="40px" - /> - </LinearLayout> - - <ListView android:id="@+id/ListView02" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - - </LinearLayout> - </FrameLayout> - </LinearLayout> - -</TabHost> - diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/shop_row.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/shop_row.xml deleted file mode 100644 index a2ffeea56f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/layout/shop_row.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="horizontal" - android:layout_width="fill_parent" - android:layout_height="50px" - android:padding="10px"> - <TextView - android:id="@+id/txtItemS" - android:layout_width="250px" - android:layout_height="30px" - android:textSize="20px" - - /> - - <ImageView android:src="@drawable/rems" - android:layout_width="30px" - android:layout_height="30px" - - /> -</LinearLayout>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/values/strings.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/values/strings.xml deleted file mode 100644 index 33f936b510..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/res/values/strings.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World, catalog</string> - <string name="app_name">store</string> - <string name="app_tag">Tuscany</string> - <string name="btn_clean">Erase cart</string> - <string name="btn_add_del1">Delete</string> - <string name="btn_add_del2">Add</string> - <string name="txt_empty">Nothing to display. The cart is currently empty</string> - <string name="tab_catalog">catalog_tab</string> - <string name="tab_shop">shopping_cart_tab</string> - <string name="title_catalog">Catalog Items</string> - <string name="title_shop">Shopping Cart</string> - <string name="get_tag">Catalog GET!!</string> - <string name="start_tag">Activity started</string> - <string name="txt_total">Total: </string> - <string name="add_entry_ok">Entry added: </string> - <string name="add_entry_ko">Unable to add entry: </string> - <string name="del_entry_ok">Entry removed: </string> - <string name="del_entry_ko">Unable to delete item: </string> - <string name="alert_yes">Yes</string> - <string name="alert_cancel">Cancel</string> - <string name="del_all_ok">All entries have been removed</string> - <string name="title_thx">Thanks for Shopping With Us!</string> - <string name="title_order">Your order</string> - <string name="howto_del">Click on an item below to remove it</string> - -</resources> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Catalog.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Catalog.java deleted file mode 100644 index 9105f1047c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Catalog.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 interface Catalog { - Item[] get(); -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/CatalogProxy.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/CatalogProxy.java deleted file mode 100644 index 7851ac6713..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/CatalogProxy.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 services; - -import java.util.ArrayList; -import java.util.List; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import services.json.rpc.JSONRpc; - -public class CatalogProxy implements Catalog { - // see http://developer.android.com/guide/developing/tools/emulator.html - private static final String jsonRPCServiceURI = "http://10.0.2.2:8080/Catalog"; - private static final String jsonRPCRequest = "{\"id\": 3, \"method\": \"Service.get\", \"params\": []}"; - - private List<Item> catalog = new ArrayList<Item>(); - - public CatalogProxy() { - initialize(); - } - - public void initialize() { - JSONObject json = null; - - try { - json = JSONRpc.invoke(jsonRPCServiceURI, jsonRPCRequest); - - if(json == null) { - return; - } - - JSONArray result = json.getJSONArray("result"); - for(int i = 0; i < result.length(); i++) { - Item item = new Item(); - item.setName(result.getJSONObject(i).getString("name")); - item.setPrice(result.getJSONObject(i).getString("price")); - - catalog.add(item); - } - - } catch (JSONException e) { - e.printStackTrace(); - } - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Commons.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Commons.java deleted file mode 100644 index 9da89c8fec..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Commons.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 services; - -/** - * - */ -public class Commons { - - public static final String TAG="Tuscany"; - public static final String DEL="HTTP DELETE "; - public static final String PST="HTTP POST "; - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Item.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Item.java deleted file mode 100644 index 1881dd4d11..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/Item.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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; - private String key; - - /** - * @return the key - */ - public String getKey() { - return key; - } - - /** - * @param key the key to set - */ - public void setKey(String key) { - this.key = key; - } - - - - - - - - - - public Item() { - } - - - - - - - - - - /** - * Parses a string entry to an Item object - * @param s - * @return Item - */ - public static Item parseItem(String s) - { - Item i=new Item(); - i.setName(s.split("-")[0].trim()); - i.setPrice(s.split("-")[1].trim()); - return i; - - } - - 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 Item(String name, String price, String key) { - super(); - this.name = name; - this.price = price; - this.key = key; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String toString() - { - return name + " - " + price; - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/ShoppingCartProxy.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/ShoppingCartProxy.java deleted file mode 100644 index c01edfbe2f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/ShoppingCartProxy.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.json.JSONException; -import org.json.JSONObject; - -import services.atom.xml.AtomXML; -import services.json.rpc.JSONRpc; -import android.util.Log; - -public class ShoppingCartProxy { - private static final String jsonRPCTotalServiceURI = "http://10.0.2.2:8080/ShoppingCart/Total"; - private static final String jsonRPCTotalRequest = "{\"id\": 4, \"method\": \"Service.getTotal\", \"params\": []}"; - private static final String atomXMLCartServiceURI="http://10.0.2.2:8080/ShoppingCart/Cart"; - - - public Item[] getItems() { - return AtomXML.getItems(atomXMLCartServiceURI); - } - - public boolean addItem(Item item) { - String content="<entry xmlns=\"http://www.w3.org/2005/Atom\">" + - "<title>item</title>" + - "<content type=\"text/xml\">" + - "<Item xmlns=\"http://services/\">" + - "<name xmlns=\"\">" + item.getName()+ "</name>" + - "<price xmlns=\"\">" +item.getPrice()+"</price>" + - "</Item></content></entry>"; - - String key =AtomXML.postItem(atomXMLCartServiceURI, content); - if(key==null) { - return false; - } - item.setKey(key); - Log.i("TUSCANY shopping cart proxy", key); - return true; - } - - public boolean removeItem(Item item) { - Log.e("Sent key",item.getKey()); - String uri=atomXMLCartServiceURI+"/"+item.getKey(); - return AtomXML.performdelete(uri); - } - - public boolean clearCartContent() { - return AtomXML.performdelete(atomXMLCartServiceURI); - } - - public void checkOut() { - - } - - public String getTotal() { - String total = ""; - JSONObject json = null; - Log.e("TUSC", "getting total"); - - try { - json = JSONRpc.invoke(jsonRPCTotalServiceURI, jsonRPCTotalRequest); - Log.e("TUSC", "Request OK"); - - if (json != null) { - total = json.getString("result"); - Log.e("TUSC", "Total: " + total); - } - } catch (JSONException e) { - Log.e("TUSC", e.getMessage()); - } - return total; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/AtomXML.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/AtomXML.java deleted file mode 100644 index 69f4409ed9..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/AtomXML.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.atom.xml; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.apache.http.Header; -import org.apache.http.HeaderElement; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.ParseException; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.DefaultHttpClient; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - -import services.Commons; -import services.Item; -import android.util.Log; - -/** - * - */ -public class AtomXML { - - public static String postItem(String ServiceURI, final String content) - { - DefaultHttpClient client=new DefaultHttpClient(); - HttpPost httpost = new HttpPost(ServiceURI); - - httpost.setEntity(new HttpEntity(){ - - String entry=content; - - class mHeader implements Header - { - public HeaderElement[] getElements() throws ParseException { - // TODO Auto-generated method stub - return null; - } - - public String getName() { - // TODO Auto-generated method stub - return "Content-type"; - } - - public String getValue() { - // TODO Auto-generated method stub - return "application/atom+xml;type=entry"; - } - } - - public void consumeContent() throws IOException { - // TODO Auto-generated method stub - - } - - public InputStream getContent() throws IOException, - IllegalStateException { - // TODO Auto-generated method stub - return new InputStream(){ - - public int read() throws IOException { - // TODO Auto-generated method stub - return this.available(); - } - - }; - } - - public Header getContentEncoding() { - // TODO Auto-generated method stub - return new mHeader(); - } - - public long getContentLength() { - // TODO Auto-generated method stub - return entry.length(); - } - - public Header getContentType() { - // TODO Auto-generated method stub - return new mHeader(); - } - - public boolean isChunked() { - // TODO Auto-generated method stub - return false; - } - - public boolean isRepeatable() { - // TODO Auto-generated method stub - return true; - } - - public boolean isStreaming() { - // TODO Auto-generated method stub - return false; - } - - public void writeTo(OutputStream arg0) throws IOException { - // TODO Auto-generated method stub - - arg0.write(entry.getBytes()); - arg0.flush(); - //Log.i("Tuscany", "Entry posted via atom/xml"); - } - - }); - - try { - HttpResponse response = client.execute(httpost); - InputStream is =response.getEntity().getContent(); - - //Human readable atom response from servlet - int read; - StringBuffer sb=new StringBuffer(); - while((read=is.read())>0) - { - sb.append((char)read); - } - Log.i("Tuscany", "Atom entry post status: "+response.getStatusLine().toString()); - //Log.i("Tuscany", "Response: "+sb.toString()); - //Try now to parse the consumed data - try { - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp; - sp = spf.newSAXParser(); - XMLReader xr = sp.getXMLReader(); - CartItemHandler cih=new CartItemHandler(); - xr.setContentHandler(cih); - - xr.parse(new InputSource(new ByteArrayInputStream(sb.toString().getBytes()))); - is.close(); - - return cih.getCurrentKey(); - - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (SAXException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getLocalizedMessage()); - } - - } catch (ClientProtocolException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (IOException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } - - return null; - } - - public static boolean performdelete(String uri) - { - DefaultHttpClient client=new DefaultHttpClient(); - Log.i(Commons.TAG,Commons.DEL+uri); - HttpDelete del=new HttpDelete(uri); - - try { - client.execute(del); - return true; - } catch (ClientProtocolException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (IOException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } - - return false; - - - } - - public static Item[] getItems(String uri) - { - DefaultHttpClient client=new DefaultHttpClient(); - HttpGet hg=new HttpGet(uri); - HttpResponse hr; - HttpEntity he; - try { - hr=client.execute(hg); - InputStream is =hr.getEntity().getContent(); - - //Human readable atom response from servlet - int read; - StringBuffer sb=new StringBuffer(); - while((read=is.read())>0) - { - sb.append((char)read); - } - Log.i("Tuscany", "Atom get content: "+sb.toString()); - - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp; - sp = spf.newSAXParser(); - XMLReader xr = sp.getXMLReader(); - CartItemHandler cih=new CartItemHandler(); - xr.setContentHandler(cih); - - xr.parse(new InputSource(new ByteArrayInputStream(sb.toString().getBytes()))); - is.close(); - Log.e(Commons.TAG,String.valueOf(cih.getItemsCollection().length)); - return cih.getItemsCollection(); - - - } catch (ClientProtocolException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (IOException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } catch (SAXException e) { - // TODO Auto-generated catch block - Log.e(Commons.TAG,e.getMessage()); - } - return null; - } - - - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/CartItemHandler.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/CartItemHandler.java deleted file mode 100644 index ed29839795..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/atom/xml/CartItemHandler.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.atom.xml; - -import java.util.ArrayList; -import java.util.List; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import android.util.Log; - -import services.Item; - - -/** - * @author Lookouster - * - */ -public class CartItemHandler extends DefaultHandler { - - private boolean in_entry = false; - private boolean in_id = false; - private boolean in_title = false; - private boolean in_content=false; - private boolean in_item=false; - private boolean in_link=false; - private boolean in_name=false; - private boolean in_price=false; - private String currentKey,currentName,currentPrice; - private List<Item> items=new ArrayList<Item>(); - - /** - * @return the currentName - */ - public String getCurrentName() { - return currentName; - } - - - /** - * @return the currentPrice - */ - public String getCurrentPrice() { - return currentPrice; - } - - - public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { - if (localName.equalsIgnoreCase("entry")) { - this.in_entry = true; - } else if (localName.equalsIgnoreCase("id")) { - this.in_id = true; - } else if (localName.equalsIgnoreCase("title")) { - this.in_title = true; - } else if (localName.equalsIgnoreCase("content")) { - this.in_content = true; - } else if (localName.equalsIgnoreCase("item")) { - this.in_item = true; - } else if (localName.equals("link")) { - this.in_link = true; - } else if (localName.equalsIgnoreCase("name")) { - this.in_name = true; - } else if (localName.equalsIgnoreCase("price")) { - this.in_price = true; - } - } - - - public void endElement(String namespaceURI, String localName, String qName) throws SAXException { - if (localName.equalsIgnoreCase("id")) - this.in_id = false; - if (localName.equalsIgnoreCase("entry")) { - this.in_entry = false; - } else if (localName.equalsIgnoreCase("id")) { - this.in_id = false; - } else if (localName.equalsIgnoreCase("title")) { - this.in_title = false; - } else if (localName.equalsIgnoreCase("content")) { - this.in_content = false; - } else if (localName.equalsIgnoreCase("item")) { - this.in_item = false; - items.add(new Item(currentName, currentPrice, currentKey)); - } else if (localName.equalsIgnoreCase("link")) { - this.in_link = false; - } else if (localName.equalsIgnoreCase("name")) { - this.in_name = false; - } else if (localName.equalsIgnoreCase("price")) { - this.in_price = false; - } - } - - - public void characters(char ch[], int start, int length) { - if (this.in_id) { - if (this.in_entry) { - currentKey = new String(ch, start, length); - Log.e("kjhkh", currentKey); - } - - } - if (this.in_name) { - currentName = new String(ch, start, length); - } - if (this.in_price) { - currentPrice = new String(ch, start, length); - } - - } - - /** - * @return the key - */ - public String getCurrentKey() { - return currentKey; - } - - public Item[] getItemsCollection() - { - return items.toArray(new Item[items.size()]); - } - - - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/json/rpc/JSONRpc.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/json/rpc/JSONRpc.java deleted file mode 100644 index b803ac6470..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/services/json/rpc/JSONRpc.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 services.json.rpc; - -import java.io.IOException; - -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.JSONException; -import org.json.JSONObject; - -public class JSONRpc { - - protected JSONRpc() { - - } - - public static JSONObject invoke(String serviceURI, String rpcRequest) throws JSONException{ - HttpClient httpClient = new DefaultHttpClient(); - HttpPost httpPost = new HttpPost(serviceURI); - - JSONObject result = null; - try { - httpPost.setHeader("Content-Type", "text/xml"); - httpPost.setEntity(new StringEntity(rpcRequest)); - - HttpResponse httpResponse = httpClient.execute(httpPost); - if (httpResponse.getStatusLine().getStatusCode() == 200) { - String jsonResult = EntityUtils.toString(httpResponse.getEntity()); - result = new JSONObject(jsonResult); - } else { - String errorMessage = httpResponse.getStatusLine() - .getReasonPhrase(); - System.out.println(errorMessage); - } - } catch (IOException e) { - e.printStackTrace(); - } - - return result; - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/store/android/catalog.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/store/android/catalog.java deleted file mode 100644 index 834362352a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-android/src/store/android/catalog.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package store.android; - -import java.util.ArrayList; -import java.util.List; - -import services.Catalog; -import services.CatalogProxy; -import services.Item; -import services.ShoppingCartProxy; -import android.app.AlertDialog; -import android.app.TabActivity; -import android.content.DialogInterface; -import android.graphics.Typeface; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.ListView; -import android.widget.TabHost; -import android.widget.TextView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.TabHost.OnTabChangeListener; -import android.widget.TabHost.TabSpec; - - - -public class catalog extends TabActivity { - private Catalog catalogProxy = new CatalogProxy(); - private ShoppingCartProxy shoppingCartProxy = new ShoppingCartProxy(); - - private TabHost mTabHost; - private ListView itemsList, cartList; - private TextView txtTotal,txtEmpty; - private TabSpec catalogTab, cartTab; - private Button btnClean; - private Item[] items; - private List<Item> cartItems=new ArrayList<Item>(); - - - private void getCatalogItems() { - items=catalogProxy.get(); - } - - private void getCartItems() { - Item[] i = shoppingCartProxy.getItems(); - if (i != null) { - for (Item item : i) { - cartItems.add(item); - } - } - Log.e(getString(R.string.app_tag), String.valueOf(cartItems.size()) + " cart items retrieved"); - } - - /** Called when the activity is first created. */ - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Log.e(getString(R.string.app_tag), getString(R.string.start_tag)); - // Load UI from layout file - setContentView(R.layout.main); - - findViews(); - - // Get data to be loaded to UI - getCatalogItems(); - getCartItems(); - - // Load UI with data - itemsList.setAdapter(new ArrayAdapter<Item>(this, R.layout.cat_row, R.id.txtItemC, items)); - itemsList.setChoiceMode(ListView.CHOICE_MODE_SINGLE); - itemsList.setClickable(true); - reloadShoppingCart(); - - // Set Listeners - listen(); - } - - - - /** - * Retrieve UI Content - */ - public void findViews() - { - mTabHost = getTabHost(); - mTabHost.addTab(mTabHost.newTabSpec(getString(R.string.tab_catalog)).setIndicator(getString(R.string.title_catalog)).setContent(R.id.ListView01)); - mTabHost.addTab(mTabHost.newTabSpec(getString(R.string.tab_shop)).setIndicator(getString(R.string.title_shop)).setContent(R.id.tab02)); - mTabHost.setCurrentTab(0); - itemsList=(ListView)findViewById(R.id.ListView01); - cartList=(ListView)findViewById(R.id.ListView02); - btnClean=(Button)findViewById(R.id.btnClean); - btnClean.setText(R.string.btn_clean); - txtTotal=(TextView)findViewById(R.id.txtTotal); - txtTotal.setTextSize((float) 15.0); - txtTotal.setTypeface(Typeface.DEFAULT_BOLD); - txtEmpty=(TextView)findViewById(R.id.txtEmpty); - txtEmpty.setTypeface(null, Typeface.ITALIC); - - } - - /** - * Implements all needed listeners for the UI - */ - public void listen() { - // Handles total display between tab switching - mTabHost.setOnTabChangedListener(new OnTabChangeListener() { - - public void onTabChanged(String tabId) { - // TODO Auto-generated method stub - if (tabId.compareTo("shopping_cart_tab") == 0) { - reloadShoppingCart(); - } - } - }); - - btnClean.setOnClickListener(new OnClickListener(){ - public void onClick(View arg0) { - // TODO Auto-generated method stub - new AlertDialog.Builder(catalog.this) - .setTitle("Tuscany Android Store") - .setMessage("You're about to erase all items. Proceed ?") - .setIcon(R.drawable.icon) - .setPositiveButton(R.string.alert_yes, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - if(shoppingCartProxy.clearCartContent()) - { - cartItems.clear(); - Log.i(getString(R.string.app_tag), getString(R.string.del_all_ok)); - reloadShoppingCart(); - } - }}) - .setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener(){ - - public void onClick(DialogInterface dialog, int which) { - // TODO Auto-generated method stub - } - }) - .show(); - - - - } - - }); - - itemsList.setOnItemClickListener(new OnItemClickListener(){ - - public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, - long arg3) { - // TODO Auto-generated method stub - addItemAction(items[(int)arg3]); - - } - - }); - - cartList.setOnItemClickListener(new OnItemClickListener(){ - - - public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, - long arg3) { - // TODO Auto-generated method stub - removeItemAction(cartItems.get((int)arg3)); - } - - }); - - } - - public void addItemAction(Item item) - { - //add item to shopping cart. - Item tmp=new Item(item.getName(), item.getPrice()); - if(shoppingCartProxy.addItem(tmp)) - { - cartItems.add(tmp); - Log.i(getString(R.string.app_tag), getString(R.string.add_entry_ok)+item); - } - - else - Log.e(getString(R.string.app_tag), getString(R.string.add_entry_ko)+item); - - } - - public void removeItemAction(Item item) - { - if(shoppingCartProxy.removeItem(item) && cartItems.remove(item)) - { - Log.i(getString(R.string.app_tag), getString(R.string.del_entry_ok)+item); - } - else - Log.i(getString(R.string.app_tag), getString(R.string.del_entry_ko)+item); - reloadShoppingCart(); - - } - - /** - * Refreshes the Shopping cart list when the adapter behind is updated - */ - public void reloadShoppingCart() - { - Item[] cartArray=new Item[cartItems.size()]; - cartList.setChoiceMode(ListView.CHOICE_MODE_SINGLE); - cartList.setClickable(true); - cartList.setAdapter(new ArrayAdapter<Item>(this, - R.layout.shop_row, R.id.txtItemS, cartItems.toArray(cartArray))); - if(!cartList.getAdapter().isEmpty()) - { - txtTotal.setVisibility(TextView.VISIBLE); - txtEmpty.setText("Click on an item below to remove it"); - btnClean.setVisibility(Button.VISIBLE); - } - else - { - txtTotal.setVisibility(TextView.INVISIBLE); - txtEmpty.setVisibility(TextView.VISIBLE); - txtEmpty.setText(R.string.txt_empty); - btnClean.setVisibility(Button.INVISIBLE); - } - String tt=shoppingCartProxy.getTotal(); - txtTotal.setText(getString(R.string.title_order)+": "+(tt.length()>5?tt.substring(0,5):tt)); - - } - - - -}
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/README b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/build.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/build.xml deleted file mode 100644 index 04ba1c7752..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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-distributed" default="compile"> - <property name="test.class" value="node.LaunchDomain" /> - <property name="test.jar" value="sample-store-distributed.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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/cloud.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/cloud.composite deleted file mode 100644 index 7bd13d5b6f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/cloud.composite +++ /dev/null @@ -1,27 +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 name="cloud.composite" - targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0"> - <include name="ns2:NodeA" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> - <include name="ns2:NodeB" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> - <include name="ns2:NodeC" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/domain.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/domain.composite deleted file mode 100644 index 6898c454af..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/domain.composite +++ /dev/null @@ -1,27 +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 name="domain.composite" - targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0"> - <include name="ns2:storeA" uri="nodeA" xmlns:ns2="http://store"/> - <include name="ns2:storeB" uri="nodeB" xmlns:ns2="http://store"/> - <include name="ns2:storeC" uri="nodeC" xmlns:ns2="http://store"/> -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/pom.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/pom.xml deleted file mode 100644 index 53786cfd25..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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>1.6-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-distributed</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Distributed 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-api</artifactId> - <version>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher</artifactId> - <version>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-domain-manager</artifactId> - <version>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.6-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.6-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>1.6-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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchDomain.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchDomain.java deleted file mode 100644 index dd19f6b49b..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchDomain.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 node; - -import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher; - -/** - * This server program that loads a composite to provide simple registry function. - * This server can be replaced with any registry that is appropriate but the components - * in each node that talk to the registry should be replaced also. - */ -public class LaunchDomain { - public static void main(String[] args) throws Exception { - DomainManagerLauncher.main(args); - } - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java deleted file mode 100644 index 9016e515fb..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.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 node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeA { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeA"}); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java deleted file mode 100644 index 2b387aec82..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.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 node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeB { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeB"}); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java deleted file mode 100644 index fb138e484f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.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 node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeC { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeC"}); - } -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Cart.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Catalog.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/CurrencyConverter.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Item.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Total.java b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeA.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeA.composite deleted file mode 100644 index f7bfd0fcb6..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeA.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://www.osoa.org/xmlns/sca/1.0" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store/cloud" - xmlns:store="http://store" - name="NodeA"> - - <component name="NodeA"> - <t:implementation.node uri="nodeA" composite="store:storeA"/> - <service name="Node"> - <binding.sca uri="http://localhost:8100"/> - <t:binding.jsonrpc uri="http://localhost:8100"/> - <t:binding.atom uri="http://localhost:8100"/> - <t:binding.http uri="http://localhost:8100"/> - </service> - </component> - -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeB.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeB.composite deleted file mode 100644 index 187c5caf1c..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeB.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://www.osoa.org/xmlns/sca/1.0" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store/cloud" - xmlns:store="http://store" - name="NodeB"> - - <component name="NodeB"> - <t:implementation.node uri="nodeB" composite="store:storeB"/> - <service name="Node"> - <binding.sca uri="http://localhost:8200"/> - <t:binding.jsonrpc uri="http://localhost:8200"/> - <t:binding.atom uri="http://localhost:8200"/> - <t:binding.http uri="http://localhost:8200"/> - </service> - </component> - -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeC.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeC.composite deleted file mode 100644 index 98113a3576..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/cloud/NodeC.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://www.osoa.org/xmlns/sca/1.0" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store/cloud" - xmlns:store="http://store" - name="NodeC"> - - <component name="NodeC"> - <t:implementation.node uri="nodeC" composite="store:storeC"/> - <service name="Node"> - <binding.sca uri="http://localhost:8300"/> - <t:binding.jsonrpc uri="http://localhost:8300"/> - <t:binding.atom uri="http://localhost:8300"/> - <t:binding.http uri="http://localhost:8300"/> - </service> - </component> - -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml deleted file mode 100644 index f165ee0e29..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/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://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeA"/> -</contribution>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/store.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/store.composite deleted file mode 100644 index 2ac608d43f..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeA/store.composite +++ /dev/null @@ -1,38 +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:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store" - name="storeA"> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml deleted file mode 100644 index 0f8e76ccd7..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/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://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeB"/> -</contribution>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/store.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/store.composite deleted file mode 100644 index 062a7aa2cd..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeB/store.composite +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store" - name="storeB"> - - <component name="ShoppingCart"> - <implementation.java class="services.ShoppingCartImpl"/> - <service name="Cart"> - <t:binding.atom uri="/ShoppingCart/Cart"/> - </service> - <service name="Total"> - <t:binding.jsonrpc/> - </service> - </component> - -</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml deleted file mode 100644 index 15bab17c1a..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/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://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeC"/> -</contribution>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/store.composite b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/store.composite deleted file mode 100644 index 5de310128d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/store.composite +++ /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. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store" - name="storeC"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> -</composite> - diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/nodeC/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/uiservices/store.html b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/store.png b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/store.png +++ /dev/null diff --git a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/store.svg b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/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/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/workspace.xml b/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/workspace.xml deleted file mode 100644 index d6cb2bfc81..0000000000 --- a/sca-java-1.x/branches/sca-java-1.6/samples/store-distributed/workspace.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. ---> -<workspace xmlns="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:ns1="http://tuscany.apache.org/xmlns/sca/1.0"> - <contribution location="file:./src/main/resources/nodeA" uri="nodeA"/> - <contribution location="file:./src/main/resources/nodeB" uri="nodeB"/> - <contribution location="file:./src/main/resources/nodeC" uri="nodeC"/> - <contribution location="file:./src/main/resources/cloud" uri="http://tuscany.apache.org/cloud"/> -</workspace> |