From 752ec791ce3dec5b6212730f8188f5a472b4914a Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 15 Sep 2009 22:59:56 +0000 Subject: Removing store-distributed sample as it's still a work in progress git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@815551 13f79535-47bb-0310-9956-ffa450edef68 --- .../samples/store-distributed/README | 28 -- .../samples/store-distributed/build.xml | 79 ------ .../samples/store-distributed/cloud.composite | 27 -- .../samples/store-distributed/domain.composite | 27 -- .../samples/store-distributed/pom.xml | 119 -------- .../src/main/java/node/LaunchDomain.java | 33 --- .../src/main/java/node/LaunchStoreNodeA.java | 28 -- .../src/main/java/node/LaunchStoreNodeB.java | 28 -- .../src/main/java/node/LaunchStoreNodeC.java | 28 -- .../src/main/java/services/Cart.java | 28 -- .../src/main/java/services/Catalog.java | 27 -- .../src/main/java/services/CurrencyConverter.java | 29 -- .../main/java/services/CurrencyConverterImpl.java | 38 --- .../src/main/java/services/FruitsCatalogImpl.java | 52 ---- .../src/main/java/services/Item.java | 51 ---- .../src/main/java/services/ShoppingCartImpl.java | 112 -------- .../src/main/java/services/Total.java | 29 -- .../src/main/resources/cloud/NodeA.composite | 36 --- .../src/main/resources/cloud/NodeB.composite | 36 --- .../src/main/resources/cloud/NodeC.composite | 36 --- .../resources/nodeA/META-INF/sca-contribution.xml | 24 -- .../src/main/resources/nodeA/store.composite | 38 --- .../resources/nodeB/META-INF/sca-contribution.xml | 24 -- .../src/main/resources/nodeB/store.composite | 35 --- .../resources/nodeC/META-INF/sca-contribution.xml | 24 -- .../src/main/resources/nodeC/store.composite | 41 --- .../src/main/resources/nodeC/uiservices/store.html | 162 ----------- .../src/main/resources/uiservices/store.html | 162 ----------- .../samples/store-distributed/store.png | Bin 15670 -> 0 bytes .../samples/store-distributed/store.svg | 304 --------------------- .../samples/store-distributed/workspace.xml | 25 -- 31 files changed, 1710 deletions(-) delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/README delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/build.xml delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/cloud.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/domain.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/pom.xml delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchDomain.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Cart.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Catalog.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverter.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Item.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Total.java delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeA.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeB.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeC.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/store.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/store.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/store.composite delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/uiservices/store.html delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/store.png delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/store.svg delete mode 100644 branches/sca-java-1.5.1/samples/store-distributed/workspace.xml (limited to 'branches/sca-java-1.5.1/samples/store-distributed') diff --git a/branches/sca-java-1.5.1/samples/store-distributed/README b/branches/sca-java-1.5.1/samples/store-distributed/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/build.xml b/branches/sca-java-1.5.1/samples/store-distributed/build.xml deleted file mode 100644 index 04ba1c7752..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/build.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/cloud.composite b/branches/sca-java-1.5.1/samples/store-distributed/cloud.composite deleted file mode 100644 index 7bd13d5b6f..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/cloud.composite +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/domain.composite b/branches/sca-java-1.5.1/samples/store-distributed/domain.composite deleted file mode 100644 index 6898c454af..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/domain.composite +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/pom.xml b/branches/sca-java-1.5.1/samples/store-distributed/pom.xml deleted file mode 100644 index 5f81c24f20..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5.1-SNAPSHOT - ../pom.xml - - sample-store-distributed - Apache Tuscany SCA Sample Getting Started Online Distributed Store - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - - org.apache.tuscany.sca - tuscany-node-api - 1.5.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-launcher - 1.5.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-domain-manager - 1.5.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime-tuscany - 1.5.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-atom-abdera - 1.5.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.5.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 1.5.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-tomcat - 1.5.1-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchDomain.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchDomain.java deleted file mode 100644 index dd19f6b49b..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java deleted file mode 100644 index 9016e515fb..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java deleted file mode 100644 index 2b387aec82..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java deleted file mode 100644 index fb138e484f..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Cart.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5.1/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 { - -} diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Catalog.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5.1/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 catalog = new ArrayList(); - - @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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Item.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5.1/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 cart; - - @Init - public void init() { - cart = new HashMap(); - } - - public Entry[] getAll() { - Entry[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry e: cart.entrySet()) { - entries[i++] = new Entry(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[] query(String queryString) { - List> entries = new ArrayList>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry(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/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Total.java b/branches/sca-java-1.5.1/samples/store-distributed/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5.1/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/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeA.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeA.composite deleted file mode 100644 index f7bfd0fcb6..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeA.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeB.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeB.composite deleted file mode 100644 index 187c5caf1c..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeB.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeC.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeC.composite deleted file mode 100644 index 98113a3576..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/cloud/NodeC.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml deleted file mode 100644 index f165ee0e29..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/store.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/store.composite deleted file mode 100644 index 2ac608d43f..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeA/store.composite +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - USD - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml deleted file mode 100644 index 0f8e76ccd7..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/store.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/store.composite deleted file mode 100644 index 062a7aa2cd..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeB/store.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml deleted file mode 100644 index 15bab17c1a..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/store.composite b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/store.composite deleted file mode 100644 index 5de310128d..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/store.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ - - - -Store - - - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/uiservices/store.html b/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ - - - -Store - - - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/store.png b/branches/sca-java-1.5.1/samples/store-distributed/store.png deleted file mode 100644 index da413edeee..0000000000 Binary files a/branches/sca-java-1.5.1/samples/store-distributed/store.png and /dev/null differ diff --git a/branches/sca-java-1.5.1/samples/store-distributed/store.svg b/branches/sca-java-1.5.1/samples/store-distributed/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/store.svg +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - store - ufs - - ShoppingCart - - CurrencyConverter - - - - - - - - - - CurrenyCode HTTP JSONRPC Atom - - Catalog - - - - diff --git a/branches/sca-java-1.5.1/samples/store-distributed/workspace.xml b/branches/sca-java-1.5.1/samples/store-distributed/workspace.xml deleted file mode 100644 index d6cb2bfc81..0000000000 --- a/branches/sca-java-1.5.1/samples/store-distributed/workspace.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -- cgit v1.2.3