Author: slaws
Date: Mon Dec  3 06:10:57 2007
New Revision: 600541

URL: http://svn.apache.org/viewvc?rev=600541&view=rev
Log:
Add a launcher for the distributed version of the store sample

Added:
    incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
    incubator/tuscany/java/sca/tutorial/store/store-distributed.composite

Added: 
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java?rev=600541&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java 
(added)
+++ 
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java 
Mon Dec  3 06:10:57 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.apache.tuscany.sca.node.util.SCAContributionUtil;
+
+public class LaunchStoreDistributed {
+    public static void main(String[] args) throws Exception {
+        System.out.println("Starting ...");
+        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
+        SCANode node = nodeFactory.createSCANode("http://localhost:8101";, 
"http://localhost:9999";);
+        
+        URL contribution = 
SCAContributionUtil.findContributionFromClass(LaunchStoreDistributed.class);
+        node.addContribution("http://store";, contribution);
+        
+        node.addToDomainLevelComposite(new QName("http://store";, 
"store-distributed"));
+        node.start();
+
+        System.out.println("store-distributed.composite ready for big business 
!!!");
+        System.in.read();
+        
+        System.out.println("Stopping ...");
+        node.stop();
+        node.destroy();
+        System.out.println();
+    }
+}

Added: incubator/tuscany/java/sca/tutorial/store/store-distributed.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/store-distributed.composite?rev=600541&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/store-distributed.composite 
(added)
+++ incubator/tuscany/java/sca/tutorial/store/store-distributed.composite Mon 
Dec  3 06:10:57 2007
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite     xmlns="http://www.osoa.org/xmlns/sca/1.0";
+               xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";
+               targetNamespace="http://store";
+               name="store-distributed">
+               
+    <component name="Store">
+        <t:implementation.widget location="uiservices/store.html"/>
+        <service name="Widget">
+               <t:binding.http uri="/ui"/> 
+        </service>
+               <reference name="catalog" target="Catalog">
+                       <t:binding.jsonrpc/>
+                </reference>
+                <reference name="shoppingCart" target="ShoppingCart/Cart">
+                       <t:binding.atom/>
+                </reference>
+                <reference name="shoppingTotal" target="ShoppingCart/Total">
+                       <t:binding.jsonrpc/>
+                </reference>
+    </component>
+    
+       <component name="Catalog">
+               <implementation.java 
class="services.merger.MergedCatalogImpl"/> 
+               <property name="currencyCode">USD</property>
+               <service name="Catalog">
+                       <t:binding.jsonrpc/>
+                       <binding.ws uri="/CatalogWebService"/>
+               </service>
+               <reference name="fruitsCatalog" target="JSEFruitsCatalog"/>     
+               <reference name="vegetablesCatalog" 
target="CloudVegetablesCatalog"/>   
+               <reference name="currencyConverter" 
target="CurrencyConverter"/>        
+       </component>
+               
+       <component name="ShoppingCart">
+               <implementation.java class="services.ShoppingCartImpl"/>
+               <service name="Cart">
+                       <t:binding.atom/>
+               </service>      
+               <service name="Total">
+                       <t:binding.jsonrpc/>
+               </service>      
+       </component>
+    
+       <component name="CurrencyConverter">
+               <implementation.java class="services.CurrencyConverterImpl"/>
+       </component>     
+
+</composite>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to