You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/03/10 10:52:17 UTC

svn commit: r635504 - in /incubator/tuscany/java/sca/tutorial: assets/ nodes/launch/ store-db/ store-eu/ store-merger/ store-supplier/ store/

Author: jsdelfino
Date: Mon Mar 10 02:52:13 2008
New Revision: 635504

URL: http://svn.apache.org/viewvc?rev=635504&view=rev
Log:
Added a program to launch all nodes of the tutorial. Fixed hrefs to shopping cart feeds.

Added:
    incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java   (with props)
Modified:
    incubator/tuscany/java/sca/tutorial/assets/tutorial.html
    incubator/tuscany/java/sca/tutorial/store-db/store-db.composite
    incubator/tuscany/java/sca/tutorial/store-eu/store-eu.composite
    incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite
    incubator/tuscany/java/sca/tutorial/store-supplier/store-supplier.composite
    incubator/tuscany/java/sca/tutorial/store/store.composite

Modified: incubator/tuscany/java/sca/tutorial/assets/tutorial.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/assets/tutorial.html?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/assets/tutorial.html (original)
+++ incubator/tuscany/java/sca/tutorial/assets/tutorial.html Mon Mar 10 02:52:13 2008
@@ -23,6 +23,7 @@
 
 <body>
 <h1>Apache Tuscany - Online Store Tutorial
+<h2><a href="http://localhost:9990/ui/home">Online Store - SCA Domain</a>
 <h2><a href="http://localhost:8100/ui/store.html">Online Store - Fruits</a>
 <h2><a href="http://localhost:8200/CloudVegetablesCatalog?wsdl">Vegetables Catalog Web Service</a>
 <h2><a href="http://localhost:8101/ui/store.html">Merger - Fruits and Vegetables</a>

Added: incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java?rev=635504&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java (added)
+++ incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java Mon Mar 10 02:52:13 2008
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.launch.SCANode2Launcher;
+
+public class LaunchAllTutorialNodes {
+    public static void main(String[] args) throws Exception {
+        launch("http://localhost:9990/composite-image/?composite=composite:cloud;http://cloud;catalogs");
+        launch("http://localhost:9990/composite-image/?composite=composite:cloud;http://cloud;currency");
+        launch("http://localhost:9990/composite-image/?composite=composite:store-db;http://store;store-db");
+        launch("http://localhost:9990/composite-image/?composite=composite:store-eu;http://store;store-eu");
+        launch("http://localhost:9990/composite-image/?composite=composite:store-merger;http://store;store-merger");
+        launch("http://localhost:9990/composite-image/?composite=composite:store;http://store;store");
+        launch("http://localhost:9990/composite-image/?composite=composite:store-supplier;http://store;store-supplier");
+        System.out.println("All SCA Nodes started...");
+        System.out.println("Press enter to shutdown.");
+        System.in.read();
+        System.exit(0);
+    }
+    
+    /**
+     * Launch a node in a child process
+     * @param url
+     */
+    private static void launch(final String url) {
+        Properties props = System.getProperties();
+        String java = props.getProperty("java.home") + "/bin/java";
+        String cp = props.getProperty("java.class.path");
+        String main = SCANode2Launcher.class.getName();
+        final String[] command = new String[]{ java, "-cp", cp, main , url};
+        Thread thread = new Thread(new Runnable() {
+            public void run() {
+                
+                try {
+                    ProcessBuilder builder = new ProcessBuilder(command);
+                    builder.redirectErrorStream(true);
+                    Process process = builder.start();
+                    InputStream is = process.getInputStream();
+                    for (;;) {
+                        int c = is.read();
+                        if (c != -1) {
+                            System.out.write(c);
+                        } else {
+                            break;
+                        }
+                    }
+                    int rc = process.waitFor();
+                    System.out.println("Process ended rc = " + rc);
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+        thread.start();
+    }
+}

Propchange: incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/tutorial/nodes/launch/LaunchAllTutorialNodes.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/tutorial/store-db/store-db.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-db/store-db.composite?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-db/store-db.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store-db/store-db.composite Mon Mar 10 02:52:13 2008
@@ -61,7 +61,7 @@
 		<implementation.java class="services.db.ShoppingCartTableImpl"/>
 		<property name="database">../store-db/target/cart-db</property>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
 			<t:binding.jsonrpc/>

Modified: incubator/tuscany/java/sca/tutorial/store-eu/store-eu.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-eu/store-eu.composite?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-eu/store-eu.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store-eu/store-eu.composite Mon Mar 10 02:52:13 2008
@@ -60,7 +60,7 @@
 		<implementation.java class="services.db.ShoppingCartTableImpl"/>
 		<property name="database">../store-eu/target/cart-eu-db</property>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
 			<t:binding.jsonrpc/>

Modified: incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite Mon Mar 10 02:52:13 2008
@@ -60,7 +60,7 @@
 	<component name="StoreMergerShoppingCart">
 		<implementation.java class="services.ShoppingCartImpl"/>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
 			<t:binding.jsonrpc/>

Modified: incubator/tuscany/java/sca/tutorial/store-supplier/store-supplier.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-supplier/store-supplier.composite?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-supplier/store-supplier.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store-supplier/store-supplier.composite Mon Mar 10 02:52:13 2008
@@ -62,7 +62,7 @@
 		<implementation.java class="services.db.ShoppingCartTableImpl"/>
 		<property name="database">../store-supplier/target/cart-db</property>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
 			<t:binding.jsonrpc/>

Modified: incubator/tuscany/java/sca/tutorial/store/store.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/store.composite?rev=635504&r1=635503&r2=635504&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/store.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store/store.composite Mon Mar 10 02:52:13 2008
@@ -50,7 +50,7 @@
 	<component name="ShoppingCart">
 		<implementation.java class="services.ShoppingCartImpl"/>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
 			<t:binding.jsonrpc/>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org