From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- tags/java/sca/1.2/tutorial/README | 29 ++ tags/java/sca/1.2/tutorial/Tutorial.pdf | Bin 0 -> 309524 bytes .../tutorial/assets/META-INF/sca-contribution.xml | 25 ++ tags/java/sca/1.2/tutorial/assets/pom.xml | 88 +++++++ .../sca/1.2/tutorial/assets/services/Cart.java | 28 ++ .../sca/1.2/tutorial/assets/services/Catalog.java | 27 ++ .../assets/services/CurrencyConverter.java | 29 ++ .../assets/services/CurrencyConverterImpl.java | 38 +++ .../assets/services/FruitsCatalogImpl.java | 52 ++++ .../sca/1.2/tutorial/assets/services/Item.java | 51 ++++ .../tutorial/assets/services/ShoppingCartImpl.java | 112 ++++++++ .../sca/1.2/tutorial/assets/services/Total.java | 29 ++ .../assets/services/VegetablesCatalogImpl.java | 42 +++ .../assets/services/db/ShoppingCartTableImpl.java | 159 +++++++++++ .../sca/1.2/tutorial/assets/services/db/cart.sql | 27 ++ .../assets/services/merger/MergedCatalogImpl.java | 66 +++++ tags/java/sca/1.2/tutorial/assets/tutorial.html | 35 +++ .../sca/1.2/tutorial/assets/uiservices/store.html | 141 ++++++++++ tags/java/sca/1.2/tutorial/catalog-ejb/pom.xml | 106 ++++++++ .../src/main/java/services/ejb/CatalogEJBHome.java | 28 ++ .../main/java/services/ejb/CatalogEJBRemote.java | 28 ++ .../src/main/java/services/ejb/Vegetable.java | 54 ++++ .../ejb/VegetablesCatalogEJBSessionBean.java | 58 ++++ .../src/main/resources/META-INF/ejb-jar.xml | 35 +++ .../src/main/resources/META-INF/openejb-jar.xml | 78 ++++++ .../main/resources/META-INF/sca-contribution.xml | 24 ++ .../resources/VegetablesCatalogEJB.componentType | 26 ++ .../src/main/resources/catalog-ejb.composite | 31 +++ .../test/java/client/CatalogEJBClientTestCase.java | 67 +++++ .../java/org/omg/stub/javax/ejb/_EJBHome_Stub.java | 223 ++++++++++++++++ .../org/omg/stub/javax/ejb/_EJBObject_Stub.java | 252 ++++++++++++++++++ .../java/org/omg/stub/javax/ejb/_Handle_Stub.java | 89 +++++++ .../org/omg/stub/javax/ejb/_HomeHandle_Stub.java | 89 +++++++ .../java/services/ejb/_CatalogEJBHome_Stub.java | 269 +++++++++++++++++++ .../java/services/ejb/_CatalogEJBRemote_Stub.java | 292 +++++++++++++++++++++ .../META-INF/sca-contribution.xml | 25 ++ .../catalog-mediation/catalog-mediation.composite | 34 +++ .../sca/1.2/tutorial/catalog-mediation/pom.xml | 90 +++++++ .../mediation/VegetablesCatalogMediationImpl.java | 51 ++++ .../tutorial/catalog-webapp/catalog-web.composite | 43 +++ tags/java/sca/1.2/tutorial/catalog-webapp/pom.xml | 109 ++++++++ .../webapp/META-INF/sca-contribution.xml | 24 ++ .../tutorial/catalog-webapp/webapp/WEB-INF/web.xml | 41 +++ .../1.2/tutorial/catalog-webapp/webapp/catalog.jsp | 52 ++++ tags/java/sca/1.2/tutorial/domain/cloud.composite | 33 +++ .../tutorial/domain/cloud/CatalogEJBNode.composite | 33 +++ .../domain/cloud/CatalogMediationNode.composite | 33 +++ .../domain/cloud/CatalogWebAppNode.composite | 36 +++ .../tutorial/domain/cloud/CatalogsNode.composite | 33 +++ .../tutorial/domain/cloud/CurrencyNode.composite | 33 +++ .../tutorial/domain/cloud/StoreDBNode.composite | 35 +++ .../tutorial/domain/cloud/StoreEUNode.composite | 36 +++ .../domain/cloud/StoreMergerNode.composite | 35 +++ .../1.2/tutorial/domain/cloud/StoreNode.composite | 35 +++ .../domain/cloud/StoreSupplierNode.composite | 36 +++ tags/java/sca/1.2/tutorial/domain/domain.composite | 33 +++ .../domain/launch/LaunchCatalogMediationNode.java | 28 ++ .../tutorial/domain/launch/LaunchCatalogsNode.java | 28 ++ .../tutorial/domain/launch/LaunchCurrencyNode.java | 28 ++ .../tutorial/domain/launch/LaunchStoreDBNode.java | 28 ++ .../tutorial/domain/launch/LaunchStoreEUNode.java | 28 ++ .../domain/launch/LaunchStoreMergerNode.java | 28 ++ .../tutorial/domain/launch/LaunchStoreNode.java | 28 ++ .../domain/launch/LaunchStoreSupplierNode.java | 28 ++ .../domain/launch/LaunchTutorialDomainManager.java | 33 +++ tags/java/sca/1.2/tutorial/domain/pom.xml | 164 ++++++++++++ tags/java/sca/1.2/tutorial/domain/workspace.xml | 32 +++ tags/java/sca/1.2/tutorial/pom.xml | 55 ++++ .../store-db/META-INF/sca-contribution.xml | 27 ++ tags/java/sca/1.2/tutorial/store-db/pom.xml | 110 ++++++++ .../sca/1.2/tutorial/store-db/store-db.composite | 75 ++++++ .../store-eu/META-INF/sca-contribution.xml | 26 ++ tags/java/sca/1.2/tutorial/store-eu/pom.xml | 110 ++++++++ .../sca/1.2/tutorial/store-eu/store-eu.composite | 70 +++++ .../1.2/tutorial/store-eu/uiservices/store-eu.html | 142 ++++++++++ .../store-merger/META-INF/sca-contribution.xml | 26 ++ tags/java/sca/1.2/tutorial/store-merger/pom.xml | 76 ++++++ .../tutorial/store-merger/store-merger.composite | 75 ++++++ .../store-supplier/META-INF/sca-contribution.xml | 27 ++ tags/java/sca/1.2/tutorial/store-supplier/pom.xml | 110 ++++++++ .../store-supplier/store-supplier.composite | 76 ++++++ .../tutorial/store/META-INF/sca-contribution.xml | 25 ++ tags/java/sca/1.2/tutorial/store/pom.xml | 76 ++++++ tags/java/sca/1.2/tutorial/store/store.composite | 64 +++++ .../web-services/META-INF/sca-contribution.xml | 25 ++ .../1.2/tutorial/web-services/catalogs.composite | 43 +++ .../1.2/tutorial/web-services/currency.composite | 32 +++ tags/java/sca/1.2/tutorial/web-services/pom.xml | 76 ++++++ 88 files changed, 5406 insertions(+) create mode 100644 tags/java/sca/1.2/tutorial/README create mode 100644 tags/java/sca/1.2/tutorial/Tutorial.pdf create mode 100644 tags/java/sca/1.2/tutorial/assets/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/assets/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/assets/services/Cart.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/Catalog.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/CurrencyConverter.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/CurrencyConverterImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/FruitsCatalogImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/Item.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/ShoppingCartImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/Total.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/VegetablesCatalogImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/db/ShoppingCartTableImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/services/db/cart.sql create mode 100644 tags/java/sca/1.2/tutorial/assets/services/merger/MergedCatalogImpl.java create mode 100644 tags/java/sca/1.2/tutorial/assets/tutorial.html create mode 100644 tags/java/sca/1.2/tutorial/assets/uiservices/store.html create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/Vegetable.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/client/CatalogEJBClientTestCase.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBHome_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBObject_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_Handle_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_HomeHandle_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBHome_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBRemote_Stub.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-mediation/catalog-mediation.composite create mode 100644 tags/java/sca/1.2/tutorial/catalog-mediation/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java create mode 100644 tags/java/sca/1.2/tutorial/catalog-webapp/catalog-web.composite create mode 100644 tags/java/sca/1.2/tutorial/catalog-webapp/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-webapp/webapp/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-webapp/webapp/WEB-INF/web.xml create mode 100644 tags/java/sca/1.2/tutorial/catalog-webapp/webapp/catalog.jsp create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/CatalogEJBNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/CatalogMediationNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/CatalogWebAppNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/CatalogsNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/CurrencyNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/StoreDBNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/StoreEUNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/StoreMergerNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/StoreNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/cloud/StoreSupplierNode.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/domain.composite create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogMediationNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogsNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchCurrencyNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreDBNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreEUNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreMergerNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreSupplierNode.java create mode 100644 tags/java/sca/1.2/tutorial/domain/launch/LaunchTutorialDomainManager.java create mode 100644 tags/java/sca/1.2/tutorial/domain/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/domain/workspace.xml create mode 100644 tags/java/sca/1.2/tutorial/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store-db/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/store-db/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store-db/store-db.composite create mode 100644 tags/java/sca/1.2/tutorial/store-eu/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/store-eu/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store-eu/store-eu.composite create mode 100644 tags/java/sca/1.2/tutorial/store-eu/uiservices/store-eu.html create mode 100644 tags/java/sca/1.2/tutorial/store-merger/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/store-merger/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store-merger/store-merger.composite create mode 100644 tags/java/sca/1.2/tutorial/store-supplier/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/store-supplier/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store-supplier/store-supplier.composite create mode 100644 tags/java/sca/1.2/tutorial/store/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/store/pom.xml create mode 100644 tags/java/sca/1.2/tutorial/store/store.composite create mode 100644 tags/java/sca/1.2/tutorial/web-services/META-INF/sca-contribution.xml create mode 100644 tags/java/sca/1.2/tutorial/web-services/catalogs.composite create mode 100644 tags/java/sca/1.2/tutorial/web-services/currency.composite create mode 100644 tags/java/sca/1.2/tutorial/web-services/pom.xml (limited to 'tags/java/sca/1.2/tutorial') diff --git a/tags/java/sca/1.2/tutorial/README b/tags/java/sca/1.2/tutorial/README new file mode 100644 index 0000000000..6169a05292 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/README @@ -0,0 +1,29 @@ +Store Tutorial +====================================== + +This is a tutorial that shows how to use SCA and Tuscany to build multiple +variations of an online Store application. + +For an overview of the scenarios covered here, please refer to Tutorial.pdf. + +For more detailed information, please see: + +http://incubator.apache.org/tuscany/sca-java-tutorial.html + + +Running The Tutorial Application +-------------------------------- + +Start the SCA Domain Manager: + cd domain + java -jar ../../modules/tuscany-node2-launcher-1.2-incubating.jar domain + +To access the SCA Manager application, point your Web browser to: + http://localhost:9990/ui/cloud/ + +Select the node you want to start (e.g StoreNode), then click the Start button. + +You should now be able to access the online Store application. Point your Web +browser to: + http://localhost:8100/ui/ + diff --git a/tags/java/sca/1.2/tutorial/Tutorial.pdf b/tags/java/sca/1.2/tutorial/Tutorial.pdf new file mode 100644 index 0000000000..e22f1b4c9d Binary files /dev/null and b/tags/java/sca/1.2/tutorial/Tutorial.pdf differ diff --git a/tags/java/sca/1.2/tutorial/assets/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/assets/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..07e5cebab8 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/assets/pom.xml b/tags/java/sca/1.2/tutorial/assets/pom.xml new file mode 100644 index 0000000000..b31d0d9af3 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/pom.xml @@ -0,0 +1,88 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-assets + Apache Tuscany SCA Tutorial Reusable Assets + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + org.apache.tuscany.sca + tuscany-implementation-data-api + 1.2-incubating + + + + org.apache.derby + derby + 10.1.2.1 + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/assets/services/Cart.java b/tags/java/sca/1.2/tutorial/assets/services/Cart.java new file mode 100644 index 0000000000..916b8b46d2 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/Cart.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import org.apache.tuscany.sca.implementation.data.collection.Collection; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Cart extends Collection { + +} diff --git a/tags/java/sca/1.2/tutorial/assets/services/Catalog.java b/tags/java/sca/1.2/tutorial/assets/services/Catalog.java new file mode 100644 index 0000000000..2c3b19f579 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/Catalog.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverter.java b/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverter.java new file mode 100644 index 0000000000..e104a0423a --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverter.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package 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/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverterImpl.java b/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverterImpl.java new file mode 100644 index 0000000000..c354aed447 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/CurrencyConverterImpl.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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/tags/java/sca/1.2/tutorial/assets/services/FruitsCatalogImpl.java b/tags/java/sca/1.2/tutorial/assets/services/FruitsCatalogImpl.java new file mode 100644 index 0000000000..377b3d7e59 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/FruitsCatalogImpl.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package 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/tags/java/sca/1.2/tutorial/assets/services/Item.java b/tags/java/sca/1.2/tutorial/assets/services/Item.java new file mode 100644 index 0000000000..27abd4f016 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/Item.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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/tags/java/sca/1.2/tutorial/assets/services/ShoppingCartImpl.java b/tags/java/sca/1.2/tutorial/assets/services/ShoppingCartImpl.java new file mode 100644 index 0000000000..d04fffe6f1 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/ShoppingCartImpl.java @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.implementation.data.collection.Entry; +import org.apache.tuscany.sca.implementation.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 + protected 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/tags/java/sca/1.2/tutorial/assets/services/Total.java b/tags/java/sca/1.2/tutorial/assets/services/Total.java new file mode 100644 index 0000000000..8f464e526f --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/Total.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Total { + + String getTotal(); + +} diff --git a/tags/java/sca/1.2/tutorial/assets/services/VegetablesCatalogImpl.java b/tags/java/sca/1.2/tutorial/assets/services/VegetablesCatalogImpl.java new file mode 100644 index 0000000000..8bfbc757db --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/VegetablesCatalogImpl.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; + +public class VegetablesCatalogImpl implements Catalog { + private List catalog = new ArrayList(); + + @Init + public void init() { + catalog.add(new Item("Broccoli", "$2.99")); + catalog.add(new Item("Asparagus", "$3.55")); + catalog.add(new Item("Cauliflower", "$1.55")); + } + + public Item[] get() { + Item[] catalogArray = new Item[catalog.size()]; + catalog.toArray(catalogArray); + return catalogArray; + } +} diff --git a/tags/java/sca/1.2/tutorial/assets/services/db/ShoppingCartTableImpl.java b/tags/java/sca/1.2/tutorial/assets/services/db/ShoppingCartTableImpl.java new file mode 100644 index 0000000000..7b81d1d32f --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/db/ShoppingCartTableImpl.java @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.db; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.apache.tuscany.sca.implementation.data.collection.Entry; +import org.apache.tuscany.sca.implementation.data.collection.NotFoundException; +import org.osoa.sca.ServiceRuntimeException; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Property; + +import services.Cart; +import services.Item; +import services.Total; + +public class ShoppingCartTableImpl implements Cart, Total { + + @Property + public String database; + + private Connection connection; + + @Init + public void init() throws Exception { + Class.forName("org.apache.derby.jdbc.EmbeddedDriver", true, getClass().getClassLoader()); + connection = DriverManager.getConnection("jdbc:derby:" + database, "", ""); + } + + public Entry[] getAll() { + try { + Statement statement = connection.createStatement(); + ResultSet results = statement.executeQuery("select * from Cart"); + List> entries = new ArrayList>(); + while (results.next()) { + Item item = new Item(results.getString("name"), results.getString("price")); + entries.add(new Entry(results.getString("id"), item)); + } + return entries.toArray(new Entry[entries.size()]); + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + } + + public Item get(String key) throws NotFoundException { + try { + Statement statement = connection.createStatement(); + ResultSet results = statement.executeQuery("select * from Cart where id = '" + key + "'"); + if (results.next()) { + return new Item(results.getString("name"), results.getString("price")); + } else { + throw new NotFoundException(key); + } + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + } + + public String post(String key, Item item) { + if (key == null) { + key = "cart-" + UUID.randomUUID().toString(); + } + try { + Statement statement = connection.createStatement(); + String query = "insert into Cart values ('" + key + "', '" + item.getName() + "', '" + item.getPrice() + "')"; + System.out.println(query); + statement.executeUpdate(query); + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + return key; + } + + public void put(String key, Item item) throws NotFoundException { + try { + Statement statement = connection.createStatement(); + String query = "update into Cart set name = '" + item.getName() + "', price = '" + item.getPrice() + "' where id = '" + key + "'"; + System.out.println(query); + int count = statement.executeUpdate(query); + if (count == 0) + throw new NotFoundException(key); + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + } + + public void delete(String key) throws NotFoundException { + try { + Statement statement = connection.createStatement(); + if (key == null || key.equals("")) { + String query = "delete from Cart"; + System.out.println(query); + statement.executeUpdate(query); + } else { + String query = "delete from Cart where id = '" + key + "'"; + System.out.println(query); + int count = statement.executeUpdate(query); + if (count == 0) + throw new NotFoundException(key); + } + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + } + + public Entry[] query(String queryString) { + try { + Statement statement = connection.createStatement(); + ResultSet results = statement.executeQuery("select * from Cart where " + queryString); + List> entries = new ArrayList>(); + while (results.next()) { + Item item = new Item(results.getString("name"), results.getString("price")); + entries.add(new Entry(results.getString("id"), item)); + } + return entries.toArray(new Entry[entries.size()]); + } catch (SQLException e) { + throw new ServiceRuntimeException(e); + } + } + + public String getTotal() { + Entry[] entries = getAll(); + double total = 0; + String currencySymbol = ""; + if (entries.length > 0) { + Item item = entries[0].getData(); + currencySymbol = item.getPrice().substring(0, 1); + } + for (Entry entry : entries) { + Item item = entry.getData(); + total += Double.valueOf(item.getPrice().substring(1)); + } + return currencySymbol + total; + } +} diff --git a/tags/java/sca/1.2/tutorial/assets/services/db/cart.sql b/tags/java/sca/1.2/tutorial/assets/services/db/cart.sql new file mode 100644 index 0000000000..25f16cb36b --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/db/cart.sql @@ -0,0 +1,27 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + +DROP TABLE CART; + +CREATE TABLE CART( + id VARCHAR(50) NOT NULL, + name VARCHAR(50), + price VARCHAR(10), + primary key (id) +); diff --git a/tags/java/sca/1.2/tutorial/assets/services/merger/MergedCatalogImpl.java b/tags/java/sca/1.2/tutorial/assets/services/merger/MergedCatalogImpl.java new file mode 100644 index 0000000000..c02b4e821e --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/services/merger/MergedCatalogImpl.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services.merger; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; + +import services.Catalog; +import services.CurrencyConverter; +import services.Item; + +public class MergedCatalogImpl implements Catalog { + + @Property + public String currencyCode = "USD"; + + @Reference + public CurrencyConverter currencyConverter; + + @Reference + public Catalog fruitsCatalog; + + @Reference + public Catalog vegetablesCatalog; + + public Item[] get() { + String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); + + Item[] fruits = fruitsCatalog.get(); + Item[] vegetables = vegetablesCatalog.get(); + + Item[] catalog = new Item[fruits.length + vegetables.length]; + int i =0; + for (Item item: fruits) { + double price = Double.valueOf(item.getPrice().substring(1)); + price = currencyConverter.getConversion("USD", currencyCode, price); + catalog[i++] = new Item(item.getName(), currencySymbol + price); + } + + for (Item item: vegetables) { + double price = Double.valueOf(item.getPrice().substring(1)); + price = currencyConverter.getConversion("USD", currencyCode, price); + catalog[i++] = new Item(item.getName(), currencySymbol + price); + } + + return catalog; + } + +} diff --git a/tags/java/sca/1.2/tutorial/assets/tutorial.html b/tags/java/sca/1.2/tutorial/assets/tutorial.html new file mode 100644 index 0000000000..0b5fcadc71 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/tutorial.html @@ -0,0 +1,35 @@ + + + +Apache Tuscany - Online Store Tutorial + + + +

Apache Tuscany - Online Store Tutorial +

Online Store - SCA Domain +

Online Store - Fruits +

Vegetables Catalog Web Service +

Merger - Fruits and Vegetables +

Online Store - Cart Database +

Online Store - Supplier +

Merged Catalog Web Service +

EU Online Store + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/assets/uiservices/store.html b/tags/java/sca/1.2/tutorial/assets/uiservices/store.html new file mode 100644 index 0000000000..095570f949 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/assets/uiservices/store.html @@ -0,0 +1,141 @@ + + + +Store + + + + + + + + +

Store

+
+

Catalog

+
+
+
+ +
+ +
+ +

Your Shopping Cart

+
+
+
+
+
+ + + (feed) +
+
+ + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/pom.xml b/tags/java/sca/1.2/tutorial/catalog-ejb/pom.xml new file mode 100644 index 0000000000..abb2965169 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/pom.xml @@ -0,0 +1,106 @@ + + + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + + tutorial-catalog-ejb + Apache Tuscany SCA Tutorial Catalog EJB + jar + + + + org.apache.geronimo.specs + geronimo-ejb_3.0_spec + 1.0 + provided + + + + junit + junit + 4.2 + test + + + + org.apache.geronimo.modules + geronimo-openejb + 2.0.2 + test + + + org.apache.geronimo.modules + geronimo-connector + + + org.apache.geronimo.modules + geronimo-persistence-jpa10 + + + org.apache.openejb + openejb-ejbd + + + org.apache.openejb + openejb-server + + + org.apache.openejb + openejb-loader + + + org.apache.openejb + openejb-jee + + + org.apache.openejb + openejb-ejbd + + + org.apache.openejb + openejb-javaagent + + + + + + + + ${artifactId} + + + ${pom.basedir}/src/main/resources + true + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java new file mode 100644 index 0000000000..c7ad31b682 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services.ejb; + +import javax.ejb.EJBHome; + +public interface CatalogEJBHome extends EJBHome { + + CatalogEJBRemote create() throws javax.ejb.CreateException, java.rmi.RemoteException; + +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java new file mode 100644 index 0000000000..7e79fc8b9d --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services.ejb; + +import java.rmi.RemoteException; + +import javax.ejb.EJBObject; + +public interface CatalogEJBRemote extends EJBObject { + Vegetable[] get() throws RemoteException; +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/Vegetable.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/Vegetable.java new file mode 100644 index 0000000000..aab567a82e --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/Vegetable.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ejb; + +import java.io.Serializable; + +public class Vegetable implements Serializable { + private static final long serialVersionUID = -5847326138627338217L; + + private String name; + private String price; + + public Vegetable() { + } + + public Vegetable(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/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java new file mode 100644 index 0000000000..74b7e407ef --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ejb; + +import java.rmi.RemoteException; +import java.util.ArrayList; +import java.util.List; + +import javax.ejb.EJBException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; + +public class VegetablesCatalogEJBSessionBean implements SessionBean { + private static final long serialVersionUID = -7421020241291271838L; + + private List catalog = new ArrayList(); + + public VegetablesCatalogEJBSessionBean() { + catalog.add(new Vegetable("Broccoli", "$2.99")); + catalog.add(new Vegetable("Asparagus", "$3.55")); + catalog.add(new Vegetable("Cauliflower", "$1.55")); + } + + public Vegetable[] get() { + Vegetable[] catalogArray = new Vegetable[catalog.size()]; + catalog.toArray(catalogArray); + return catalogArray; + } + + public void ejbActivate() throws EJBException, RemoteException { + } + + public void ejbPassivate() throws EJBException, RemoteException { + } + + public void ejbRemove() throws EJBException, RemoteException { + } + + public void setSessionContext(SessionContext arg0) throws EJBException, RemoteException { + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 0000000000..a0a7adf6fa --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,35 @@ + + + + + Apache Tuscany SCA Tutorial Catalog EJB + + + VegetablesCatalogEJB + services.ejb.CatalogEJBHome + services.ejb.CatalogEJBRemote + services.ejb.VegetablesCatalogEJBSessionBean + Stateless + Container + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml new file mode 100644 index 0000000000..bc1c3d5fce --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml @@ -0,0 +1,78 @@ + + + + + + ${pom.groupId} + ${pom.artifactId} + ${version} + jar + + + + org.apache.geronimo.configs + j2ee-corba-yoko + + car + + + + + + + + + VegetablesCatalogEJB + VegetablesCatalogEJB + IdentityTokenNoSecurity + + + + + + IdentityTokenNoSecurity + + UnprotectedServer + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..85e14d652c --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType new file mode 100644 index 0000000000..bc57b35e79 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite new file mode 100644 index 0000000000..d8ca5c87e4 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/client/CatalogEJBClientTestCase.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/client/CatalogEJBClientTestCase.java new file mode 100644 index 0000000000..f9bd16f050 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/client/CatalogEJBClientTestCase.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package client; + +import javax.naming.InitialContext; +import javax.rmi.PortableRemoteObject; + +import org.junit.Ignore; +import org.junit.Test; + +import services.ejb.CatalogEJBHome; +import services.ejb.CatalogEJBRemote; +import services.ejb.Vegetable; + +/** + * A test client for the catalog EJB. + * + * @version $Rev$ $Date$ + */ +public class CatalogEJBClientTestCase { + + @Test + @Ignore // Ignore the test case for maven build, remove it if you want to run + public void testCatalogEJB() throws Exception { + InitialContext context = new InitialContext(); + + Object o = context.lookup("corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJB"); + + // The narrow(...) call requires generated EJB stubs. Tuscany binding.ejb doesn't the stubs + CatalogEJBHome home = (CatalogEJBHome)PortableRemoteObject.narrow(o, CatalogEJBHome.class); + + // The following call will hang with SUN jdk1.6.0_05, please use SUN or IBM jdk 1.5.x instead + CatalogEJBRemote catalog = home.create(); + + Vegetable items[] = catalog.get(); + for (Vegetable item : items) { + System.out.println(item.getName() + " " + item.getPrice()); + } + } + + public static void main(String args[]) throws Exception { + String javaVersion = System.getProperty("java.version"); + String javaVendor = System.getProperty("java.vendor"); + + if (javaVendor.toUpperCase().contains("SUN") && javaVersion.startsWith("1.6.")) { + System.err.println("The EJB invocation may hang due to a bug in " + javaVendor + ":" + javaVersion); + } + new CatalogEJBClientTestCase().testCatalogEJB(); + } + +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBHome_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBHome_Stub.java new file mode 100644 index 0000000000..6930093042 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBHome_Stub.java @@ -0,0 +1,223 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package org.omg.stub.javax.ejb; + +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.EJBHome; +import javax.ejb.EJBMetaData; +import javax.ejb.Handle; +import javax.ejb.HomeHandle; +import javax.ejb.RemoveException; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; +import org.omg.CORBA_2_3.portable.InputStream; + +public class _EJBHome_Stub extends Stub implements EJBHome { + + private static final String[] _type_ids = { + "RMI:javax.ejb.EJBHome:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBMetaData getEJBMetaData() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBMetaData", true); + in = (InputStream)_invoke(out); + return (EJBMetaData) in.read_value(EJBMetaData.class); + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBMetaData",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + EJBMetaData result = ((javax.ejb.EJBHome)so.servant).getEJBMetaData(); + return (EJBMetaData)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public HomeHandle getHomeHandle() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_homeHandle", true); + in = (InputStream)_invoke(out); + return (HomeHandle) in.read_abstract_interface(HomeHandle.class); + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_homeHandle",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + HomeHandle result = ((javax.ejb.EJBHome)so.servant).getHomeHandle(); + return (HomeHandle)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove(Handle arg0) throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("remove__javax_ejb_Handle", true); + Util.writeAbstractObject(out,arg0); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove__javax_ejb_Handle",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + Handle arg0Copy = (Handle) Util.copyObject(arg0,_orb()); + ((javax.ejb.EJBHome)so.servant).remove(arg0Copy); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove(Object arg0) throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("remove__java_lang_Object", true); + Util.writeAny(out,arg0); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove__java_lang_Object",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + Object arg0Copy = (Object) Util.copyObject(arg0,_orb()); + ((javax.ejb.EJBHome)so.servant).remove(arg0Copy); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBObject_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBObject_Stub.java new file mode 100644 index 0000000000..3482ebb9ec --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_EJBObject_Stub.java @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package org.omg.stub.javax.ejb; + +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.EJBHome; +import javax.ejb.EJBObject; +import javax.ejb.Handle; +import javax.ejb.RemoveException; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; + +public class _EJBObject_Stub extends Stub implements EJBObject { + + private static final String[] _type_ids = { + "RMI:javax.ejb.EJBObject:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBHome getEJBHome() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBHome", true); + in = _invoke(out); + return (EJBHome) in.read_Object(EJBHome.class); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBHome",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + EJBHome result = ((javax.ejb.EJBObject)so.servant).getEJBHome(); + return (EJBHome)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public Handle getHandle() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + org.omg.CORBA_2_3.portable.InputStream in = null; + try { + try { + OutputStream out = _request("_get_handle", true); + in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out); + return (Handle) in.read_abstract_interface(Handle.class); + } catch (ApplicationException ex) { + in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_handle",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + Handle result = ((javax.ejb.EJBObject)so.servant).getHandle(); + return (Handle)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public Object getPrimaryKey() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_primaryKey", true); + in = _invoke(out); + return Util.readAny(in); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_primaryKey",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + Object result = ((javax.ejb.EJBObject)so.servant).getPrimaryKey(); + return (Object)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public boolean isIdentical(EJBObject arg0) throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("isIdentical", true); + Util.writeRemoteObject(out,arg0); + in = _invoke(out); + return in.read_boolean(); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("isIdentical",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + EJBObject arg0Copy = (EJBObject) Util.copyObject(arg0,_orb()); + return ((javax.ejb.EJBObject)so.servant).isIdentical(arg0Copy); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove() throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + org.omg.CORBA_2_3.portable.InputStream in = null; + try { + try { + OutputStream out = _request("remove", true); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + ((javax.ejb.EJBObject)so.servant).remove(); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_Handle_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_Handle_Stub.java new file mode 100644 index 0000000000..d848fbb280 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_Handle_Stub.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package org.omg.stub.javax.ejb; + +import java.rmi.Remote; +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.EJBObject; +import javax.ejb.Handle; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; + +public class _Handle_Stub extends Stub implements Handle, +Remote { + + private static final String[] _type_ids = { + "RMI:javax.ejb.Handle:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBObject getEJBObject() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBObject", true); + in = _invoke(out); + return (EJBObject) in.read_Object(EJBObject.class); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBObject",javax.ejb.Handle.class); + if (so == null) { + continue; + } + try { + EJBObject result = ((javax.ejb.Handle)so.servant).getEJBObject(); + return (EJBObject)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_HomeHandle_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_HomeHandle_Stub.java new file mode 100644 index 0000000000..6efc86b608 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/org/omg/stub/javax/ejb/_HomeHandle_Stub.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package org.omg.stub.javax.ejb; + +import java.rmi.Remote; +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.EJBHome; +import javax.ejb.HomeHandle; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; + +public class _HomeHandle_Stub extends Stub implements HomeHandle, +Remote { + + private static final String[] _type_ids = { + "RMI:javax.ejb.HomeHandle:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBHome getEJBHome() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBHome", true); + in = _invoke(out); + return (EJBHome) in.read_Object(EJBHome.class); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBHome",javax.ejb.HomeHandle.class); + if (so == null) { + continue; + } + try { + EJBHome result = ((javax.ejb.HomeHandle)so.servant).getEJBHome(); + return (EJBHome)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBHome_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBHome_Stub.java new file mode 100644 index 0000000000..bdc1a5cfd5 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBHome_Stub.java @@ -0,0 +1,269 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package services.ejb; + +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.CreateException; +import javax.ejb.EJBMetaData; +import javax.ejb.Handle; +import javax.ejb.HomeHandle; +import javax.ejb.RemoveException; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; +import org.omg.CORBA_2_3.portable.InputStream; + +public class _CatalogEJBHome_Stub extends Stub implements CatalogEJBHome { + + private static final String[] _type_ids = { + "RMI:services.ejb.CatalogEJBHome:0000000000000000", + "RMI:javax.ejb.EJBHome:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBMetaData getEJBMetaData() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBMetaData", true); + in = (InputStream)_invoke(out); + return (EJBMetaData) in.read_value(EJBMetaData.class); + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBMetaData",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + EJBMetaData result = ((javax.ejb.EJBHome)so.servant).getEJBMetaData(); + return (EJBMetaData)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public HomeHandle getHomeHandle() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_homeHandle", true); + in = (InputStream)_invoke(out); + return (HomeHandle) in.read_abstract_interface(HomeHandle.class); + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_homeHandle",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + HomeHandle result = ((javax.ejb.EJBHome)so.servant).getHomeHandle(); + return (HomeHandle)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove(Handle arg0) throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("remove__javax_ejb_Handle", true); + Util.writeAbstractObject(out,arg0); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove__javax_ejb_Handle",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + Handle arg0Copy = (Handle) Util.copyObject(arg0,_orb()); + ((javax.ejb.EJBHome)so.servant).remove(arg0Copy); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove(Object arg0) throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("remove__java_lang_Object", true); + Util.writeAny(out,arg0); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove__java_lang_Object",javax.ejb.EJBHome.class); + if (so == null) { + continue; + } + try { + Object arg0Copy = (Object) Util.copyObject(arg0,_orb()); + ((javax.ejb.EJBHome)so.servant).remove(arg0Copy); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public CatalogEJBRemote create() throws CreateException, RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("create", true); + in = (InputStream)_invoke(out); + return (CatalogEJBRemote) in.read_Object(CatalogEJBRemote.class); + } catch (ApplicationException ex) { + in = (InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/CreateEx:1.0")) { + throw (CreateException) in.read_value(CreateException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("create",services.ejb.CatalogEJBHome.class); + if (so == null) { + continue; + } + try { + CatalogEJBRemote result = ((services.ejb.CatalogEJBHome)so.servant).create(); + return (CatalogEJBRemote)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof CreateException) { + throw (CreateException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBRemote_Stub.java b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBRemote_Stub.java new file mode 100644 index 0000000000..a24108714e --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-ejb/src/test/java/services/ejb/_CatalogEJBRemote_Stub.java @@ -0,0 +1,292 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Stub class generated by rmic, do not edit. +// Contents subject to change without notice. + +package services.ejb; + +import java.rmi.RemoteException; +import java.rmi.UnexpectedException; + +import javax.ejb.EJBHome; +import javax.ejb.EJBObject; +import javax.ejb.Handle; +import javax.ejb.RemoveException; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.Util; + +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; + +public class _CatalogEJBRemote_Stub extends Stub implements CatalogEJBRemote { + + private static final String[] _type_ids = { + "RMI:services.ejb.CatalogEJBRemote:0000000000000000", + "RMI:javax.ejb.EJBObject:0000000000000000" + }; + + public String[] _ids() { + return _type_ids; + } + + public EJBHome getEJBHome() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_EJBHome", true); + in = _invoke(out); + return (EJBHome) in.read_Object(EJBHome.class); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_EJBHome",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + EJBHome result = ((javax.ejb.EJBObject)so.servant).getEJBHome(); + return (EJBHome)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public Handle getHandle() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + org.omg.CORBA_2_3.portable.InputStream in = null; + try { + try { + OutputStream out = _request("_get_handle", true); + in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out); + return (Handle) in.read_abstract_interface(Handle.class); + } catch (ApplicationException ex) { + in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_handle",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + Handle result = ((javax.ejb.EJBObject)so.servant).getHandle(); + return (Handle)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public Object getPrimaryKey() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("_get_primaryKey", true); + in = _invoke(out); + return Util.readAny(in); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("_get_primaryKey",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + Object result = ((javax.ejb.EJBObject)so.servant).getPrimaryKey(); + return (Object)Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public boolean isIdentical(EJBObject arg0) throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + InputStream in = null; + try { + try { + OutputStream out = _request("isIdentical", true); + Util.writeRemoteObject(out,arg0); + in = _invoke(out); + return in.read_boolean(); + } catch (ApplicationException ex) { + in = ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("isIdentical",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + EJBObject arg0Copy = (EJBObject) Util.copyObject(arg0,_orb()); + return ((javax.ejb.EJBObject)so.servant).isIdentical(arg0Copy); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public void remove() throws RemoteException, RemoveException { + while(true) { + if (!Util.isLocal(this)) { + org.omg.CORBA_2_3.portable.InputStream in = null; + try { + try { + OutputStream out = _request("remove", true); + _invoke(out); + return; + } catch (ApplicationException ex) { + in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream(); + String id = in.read_string(); + if (id.equals("IDL:javax/ejb/RemoveEx:1.0")) { + throw (RemoveException) in.read_value(RemoveException.class); + } + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("remove",javax.ejb.EJBObject.class); + if (so == null) { + continue; + } + try { + ((javax.ejb.EJBObject)so.servant).remove(); + return; + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + if (exCopy instanceof RemoveException) { + throw (RemoveException)exCopy; + } + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } + + public Vegetable[] get() throws RemoteException { + while(true) { + if (!Util.isLocal(this)) { + org.omg.CORBA_2_3.portable.InputStream in = null; + try { + try { + OutputStream out = _request("get", true); + in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out); + return (Vegetable[]) in.read_value(Vegetable[].class); + } catch (ApplicationException ex) { + in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream(); + String id = in.read_string(); + throw new UnexpectedException(id); + } catch (RemarshalException ex) { + continue; + } + } catch (SystemException ex) { + throw Util.mapSystemException(ex); + } finally { + _releaseReply(in); + } + } else { + ServantObject so = _servant_preinvoke("get",services.ejb.CatalogEJBRemote.class); + if (so == null) { + continue; + } + try { + Vegetable[] result = ((services.ejb.CatalogEJBRemote)so.servant).get(); + return (Vegetable[])Util.copyObject(result,_orb()); + } catch (Throwable ex) { + Throwable exCopy = (Throwable)Util.copyObject(ex,_orb()); + throw Util.wrapException(exCopy); + } finally { + _servant_postinvoke(so); + } + } + } + } +} diff --git a/tags/java/sca/1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..6a3673f04a --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/catalog-mediation/catalog-mediation.composite b/tags/java/sca/1.2/tutorial/catalog-mediation/catalog-mediation.composite new file mode 100644 index 0000000000..d832e88acc --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-mediation/catalog-mediation.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-mediation/pom.xml b/tags/java/sca/1.2/tutorial/catalog-mediation/pom.xml new file mode 100644 index 0000000000..a5177fdbc6 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-mediation/pom.xml @@ -0,0 +1,90 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-catalog-mediation + Apache Tuscany SCA Tutorial Catalog Mediation + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tutorial-assets + 1.2-incubating + + + + org.apache.tuscany.sca + tutorial-catalog-ejb + 1.2-incubating + + + + org.apache.geronimo.specs + geronimo-ejb_3.0_spec + 1.0 + provided + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java b/tags/java/sca/1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java new file mode 100644 index 0000000000..6cfa54e9de --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.mediation; + +import java.rmi.RemoteException; + +import org.osoa.sca.ServiceRuntimeException; +import org.osoa.sca.annotations.Reference; + +import services.Catalog; +import services.Item; +import services.ejb.CatalogEJBRemote; +import services.ejb.Vegetable; + +public class VegetablesCatalogMediationImpl implements Catalog { + + @Reference + public CatalogEJBRemote catalog; + + public Item[] get() { + Vegetable[] vegetables; + try { + vegetables = catalog.get(); + } catch (RemoteException e) { + throw new ServiceRuntimeException(e); + } + Item[] items = new Item[vegetables.length]; + for (int i = 0; i < vegetables.length; i++) { + items[i] = new Item(vegetables[i].getName(), vegetables[i].getPrice()); + } + return items; + } + +} diff --git a/tags/java/sca/1.2/tutorial/catalog-webapp/catalog-web.composite b/tags/java/sca/1.2/tutorial/catalog-webapp/catalog-web.composite new file mode 100644 index 0000000000..3ba76da078 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-webapp/catalog-web.composite @@ -0,0 +1,43 @@ + + + + + + + + + + USD + + + + + + + + USD + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-webapp/pom.xml b/tags/java/sca/1.2/tutorial/catalog-webapp/pom.xml new file mode 100644 index 0000000000..f732fbb830 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-webapp/pom.xml @@ -0,0 +1,109 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-catalog-webapp + Apache Tuscany SCA Tutorial Catalog WAR Contribution + war + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-node2-api + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tutorial-assets + 1.2-incubating + + + + org.apache.tuscany.sca + tuscany-node2-launcher + 1.2-incubating + runtime + + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + webapp/** + + + + + + + org.apache.maven.plugins + maven-war-plugin + + webapp + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..71e7b8d511 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/WEB-INF/web.xml b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..1a4d84909c --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/WEB-INF/web.xml @@ -0,0 +1,41 @@ + + + + + + + Fruit Catalog + + + tuscany + org.apache.tuscany.sca.node.launcher.NodeServletFilter + + + + tuscany + /* + + + + catalog.jsp + + + diff --git a/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/catalog.jsp b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/catalog.jsp new file mode 100644 index 0000000000..fe51e854a5 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/catalog-webapp/webapp/catalog.jsp @@ -0,0 +1,52 @@ +<%-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--%> + +<%@ page import="org.apache.tuscany.sca.node.SCAClient"%> +<%@ page import="services.Catalog" %> +<%@page import="services.Item"%> + +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + +<% + + SCAClient client = (SCAClient) application.getAttribute("org.apache.tuscany.sca.node.SCAClient"); + + Catalog catalog = (Catalog)client.getService(Catalog.class, "LocalFruitsCatalog"); + Item[] items = catalog.get(); + +%> + + +Catalog + + +

Catalog

+ + + +<% for (int i = 0, n = items.length; i < n; i++) { %> + + + +<% } %> + +
<%=items[i].getName() %><%=items[i].getPrice() %>
+ + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud.composite b/tags/java/sca/1.2/tutorial/domain/cloud.composite new file mode 100644 index 0000000000..993b634c9f --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/CatalogEJBNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogEJBNode.composite new file mode 100644 index 0000000000..b495b45ebd --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogEJBNode.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/CatalogMediationNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogMediationNode.composite new file mode 100644 index 0000000000..bac96d9781 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogMediationNode.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/CatalogWebAppNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogWebAppNode.composite new file mode 100644 index 0000000000..f3ed2dfdd5 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogWebAppNode.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/CatalogsNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogsNode.composite new file mode 100644 index 0000000000..3a5ec770cb --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/CatalogsNode.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/CurrencyNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/CurrencyNode.composite new file mode 100644 index 0000000000..ed80268f22 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/CurrencyNode.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/StoreDBNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/StoreDBNode.composite new file mode 100644 index 0000000000..9b09bd7344 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/StoreDBNode.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/StoreEUNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/StoreEUNode.composite new file mode 100644 index 0000000000..6a50de56d5 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/StoreEUNode.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/StoreMergerNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/StoreMergerNode.composite new file mode 100644 index 0000000000..0ce6e6a231 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/StoreMergerNode.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/StoreNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/StoreNode.composite new file mode 100644 index 0000000000..e2b61a98e1 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/StoreNode.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/cloud/StoreSupplierNode.composite b/tags/java/sca/1.2/tutorial/domain/cloud/StoreSupplierNode.composite new file mode 100644 index 0000000000..df46bb8813 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/cloud/StoreSupplierNode.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/domain.composite b/tags/java/sca/1.2/tutorial/domain/domain.composite new file mode 100644 index 0000000000..ff4dde969c --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/domain.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogMediationNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogMediationNode.java new file mode 100644 index 0000000000..442b1b6a05 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogMediationNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchCatalogMediationNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/CatalogMediationNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogsNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogsNode.java new file mode 100644 index 0000000000..8a23433012 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCatalogsNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchCatalogsNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/CatalogsNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchCurrencyNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCurrencyNode.java new file mode 100644 index 0000000000..fae521547d --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchCurrencyNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchCurrencyNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/CurrencyNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreDBNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreDBNode.java new file mode 100644 index 0000000000..480088b46a --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreDBNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreDBNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/StoreDBNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreEUNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreEUNode.java new file mode 100644 index 0000000000..cdc7eb824b --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreEUNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreEUNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/StoreEUNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreMergerNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreMergerNode.java new file mode 100644 index 0000000000..26452b231b --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreMergerNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreMergerNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/StoreMergerNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreNode.java new file mode 100644 index 0000000000..d15ee0e9d2 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/StoreNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreSupplierNode.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreSupplierNode.java new file mode 100644 index 0000000000..4210108aa5 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchStoreSupplierNode.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreSupplierNode { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-image/StoreSupplierNode"}); + } +} diff --git a/tags/java/sca/1.2/tutorial/domain/launch/LaunchTutorialDomainManager.java b/tags/java/sca/1.2/tutorial/domain/launch/LaunchTutorialDomainManager.java new file mode 100644 index 0000000000..7408e99c63 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/launch/LaunchTutorialDomainManager.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package launch; + +/** + * Launches the domain manager from this module. + * + * @version $Rev$ $Date$ + */ +public class LaunchTutorialDomainManager { + + public static void main(String[] args) throws Exception { + org.apache.tuscany.sca.node.launcher.DomainManagerLauncher.main(args); + } + +} diff --git a/tags/java/sca/1.2/tutorial/domain/pom.xml b/tags/java/sca/1.2/tutorial/domain/pom.xml new file mode 100644 index 0000000000..904a437d01 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/pom.xml @@ -0,0 +1,164 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-domain + Apache Tuscany SCA Tutorial Domain + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-node2-launcher + 1.2-incubating + + + + org.apache.tuscany.sca + tuscany-workspace-admin + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb + 1.2-incubating + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-ejb-xml + 1.2-incubating + runtime + + + + org.apache.derby + derby + 10.1.2.1 + runtime + + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + launch.LaunchTutorialAdmin + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/domain/workspace.xml b/tags/java/sca/1.2/tutorial/domain/workspace.xml new file mode 100644 index 0000000000..e405dea03a --- /dev/null +++ b/tags/java/sca/1.2/tutorial/domain/workspace.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/pom.xml b/tags/java/sca/1.2/tutorial/pom.xml new file mode 100644 index 0000000000..47f4294dfb --- /dev/null +++ b/tags/java/sca/1.2/tutorial/pom.xml @@ -0,0 +1,55 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.2-incubating + ../pom.xml + + tuscany-tutorial + pom + Apache Tuscany SCA Tutorial + + + + default + + true + + + domain + assets + store + store-merger + store-db + store-supplier + store-eu + web-services + catalog-webapp + catalog-ejb + catalog-mediation + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-db/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/store-db/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7a5d5613be --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-db/META-INF/sca-contribution.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/store-db/pom.xml b/tags/java/sca/1.2/tutorial/store-db/pom.xml new file mode 100644 index 0000000000..3b2d2de992 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-db/pom.xml @@ -0,0 +1,110 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-store-db + Apache Tuscany SCA Tutorial Online Store Using DB + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + org.codehaus.mojo + sql-maven-plugin + 1.0 + + + + org.apache.derby + derby + 10.1.2.1 + + + + + + create-db + generate-resources + + execute + + + org.apache.derby.jdbc.EmbeddedDriver + jdbc:derby:${basedir}/target/cart-db;create=true + true + continue + ; + + ${basedir}/../assets/services/db/cart.sql + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-db/store-db.composite b/tags/java/sca/1.2/tutorial/store-db/store-db.composite new file mode 100644 index 0000000000..03094be5ad --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-db/store-db.composite @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + USD + + + + + + + + + + + + + USD + + + + + + ../store-db/target/cart-db + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-eu/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/store-eu/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..552932b0e7 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-eu/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/store-eu/pom.xml b/tags/java/sca/1.2/tutorial/store-eu/pom.xml new file mode 100644 index 0000000000..3eab1445ec --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-eu/pom.xml @@ -0,0 +1,110 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-store-eu + Apache Tuscany SCA Tutorial EU Online Store + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + org.codehaus.mojo + sql-maven-plugin + 1.0 + + + + org.apache.derby + derby + 10.1.2.1 + + + + + + create-db + generate-resources + + execute + + + org.apache.derby.jdbc.EmbeddedDriver + jdbc:derby:${basedir}/target/cart-eu-db;create=true + true + continue + ; + + ${basedir}/../assets/services/db/cart.sql + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-eu/store-eu.composite b/tags/java/sca/1.2/tutorial/store-eu/store-eu.composite new file mode 100644 index 0000000000..a0b8b50975 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-eu/store-eu.composite @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + EUR + + + + + + + + + + + + + + + + + + ../store-eu/target/cart-eu-db + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-eu/uiservices/store-eu.html b/tags/java/sca/1.2/tutorial/store-eu/uiservices/store-eu.html new file mode 100644 index 0000000000..ec72d9b2a7 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-eu/uiservices/store-eu.html @@ -0,0 +1,142 @@ + + + +EU Store + + + + + + + + +

Store

+

Fruits and Vegetables - Fruits et Legumes - Obst und Gemuese +

+

Catalog

+
+
+
+ +
+ +
+ +

Your Shopping Cart

+
+
+
+
+
+ + + (feed) +
+
+ + diff --git a/tags/java/sca/1.2/tutorial/store-merger/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/store-merger/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..700a84736c --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-merger/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/store-merger/pom.xml b/tags/java/sca/1.2/tutorial/store-merger/pom.xml new file mode 100644 index 0000000000..0010b658d7 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-merger/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-store-merger + Apache Tuscany SCA Tutorial Merger Online Store + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-merger/store-merger.composite b/tags/java/sca/1.2/tutorial/store-merger/store-merger.composite new file mode 100644 index 0000000000..76d77dc693 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-merger/store-merger.composite @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + USD + + + + + + + + + + + + + + USD + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-supplier/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/store-supplier/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..a75087aca1 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-supplier/META-INF/sca-contribution.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/store-supplier/pom.xml b/tags/java/sca/1.2/tutorial/store-supplier/pom.xml new file mode 100644 index 0000000000..5e06fa6e80 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-supplier/pom.xml @@ -0,0 +1,110 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-store-supplier + Apache Tuscany SCA Tutorial Supplier Online Store + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + org.codehaus.mojo + sql-maven-plugin + 1.0 + + + + org.apache.derby + derby + 10.1.2.1 + + + + + + create-db + generate-resources + + execute + + + org.apache.derby.jdbc.EmbeddedDriver + jdbc:derby:${basedir}/target/cart-db;create=true + true + continue + ; + + ${basedir}/../assets/services/db/cart.sql + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store-supplier/store-supplier.composite b/tags/java/sca/1.2/tutorial/store-supplier/store-supplier.composite new file mode 100644 index 0000000000..eedae3bf7a --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store-supplier/store-supplier.composite @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + USD + + + + + + + + + + + + + + USD + + + + + + ../store-supplier/target/cart-db + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/store/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..3ed6e4a4ef --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/store/pom.xml b/tags/java/sca/1.2/tutorial/store/pom.xml new file mode 100644 index 0000000000..1bb9148f20 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-store + Apache Tuscany SCA Tutorial Online Store + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/store/store.composite b/tags/java/sca/1.2/tutorial/store/store.composite new file mode 100644 index 0000000000..95f61b57c0 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/store/store.composite @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + USD + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/web-services/META-INF/sca-contribution.xml b/tags/java/sca/1.2/tutorial/web-services/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8f773f0f21 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/web-services/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/tags/java/sca/1.2/tutorial/web-services/catalogs.composite b/tags/java/sca/1.2/tutorial/web-services/catalogs.composite new file mode 100644 index 0000000000..154d475165 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/web-services/catalogs.composite @@ -0,0 +1,43 @@ + + + + + + + + + + USD + + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/web-services/currency.composite b/tags/java/sca/1.2/tutorial/web-services/currency.composite new file mode 100644 index 0000000000..7a3f70e299 --- /dev/null +++ b/tags/java/sca/1.2/tutorial/web-services/currency.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/tags/java/sca/1.2/tutorial/web-services/pom.xml b/tags/java/sca/1.2/tutorial/web-services/pom.xml new file mode 100644 index 0000000000..1b324150eb --- /dev/null +++ b/tags/java/sca/1.2/tutorial/web-services/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-tutorial + 1.2-incubating + ../pom.xml + + tutorial-web-services + Apache Tuscany SCA Tutorial Web Services + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.2-incubating + + + + + ${artifactId} + ${basedir} + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.2-incubating + + + + generate + + + + + + + + -- cgit v1.2.3