You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2008/08/19 18:26:36 UTC

svn commit: r687088 - in /tuscany/java/sca/samples: simple-bigbank-spring/ simple-bigbank-spring/src/main/java/bigbank/account/feed/ simple-bigbank-spring/src/main/java/bigbank/client/ simple-bigbank-spring/src/main/java/bigbank/server/ simple-bigbank-...

Author: slaws
Date: Tue Aug 19 09:26:34 2008
New Revision: 687088

URL: http://svn.apache.org/viewvc?rev=687088&view=rev
Log:
TUSCANY-2550 - Adding more bindings to the spring bigbank sample. Convert the sample from SCADomain to Node APIs. Thanks for the patch Ram

Added:
    tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml   (with props)
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java   (with props)
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css   (with props)
Modified:
    tuscany/java/sca/samples/simple-bigbank-spring/pom.xml
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java
    tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/BigBank.composite
    tuscany/java/sca/samples/spring-bigbank-calculator/pom.xml
    tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
    tuscany/java/sca/samples/spring-bigbank-checkaccount/pom.xml
    tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
    tuscany/java/sca/samples/spring-bigbank-stockquote/pom.xml
    tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java

Added: tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml?rev=687088&view=auto
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml (added)
+++ tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml Tue Aug 19 09:26:34 2008
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="DojoZipInstaller">
+	
+
+    <property name="dojo.version" value="1.0.0"/>
+    <property name="unpack.location" value="${basedir}/samples/simple-bigbank-spring/src/main/resources/web/dojo"/>
+	
+
+    <target name="check-dojo-installed">
+        <condition property="already.installed" >
+            <available file="${localRepository}/dojo/dojo/${dojo.version}/dojo-${dojo.version}.zip"/>
+        </condition>
+        <condition property="maven.suffix" value="">
+            <os family="unix"/>
+        </condition>
+        <condition property="maven.suffix" value=".bat">
+            <os family="windows"/>
+        </condition>
+    </target>
+	
+
+    <target name="check-dojo-unpacked">
+        <condition property="already.unpacked" >
+            <available file="${unpack.location}"/>
+        </condition>
+    </target>
+
+    <target name="install-dojo" depends="check-dojo-installed" unless="already.installed">
+        <mkdir dir="${basedir}/target/dojo-download/"/>
+        <get src="http://download.dojotoolkit.org/release-${dojo.version}/dojo-release-${dojo.version}.zip"
+            dest="${basedir}/target/dojo-download/dojo-release-${dojo.version}.zip"
+            verbose="true"
+            usetimestamp="true"/>
+        <exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="false">
+            <arg line="install:install-file -DgroupId=dojo  -DartifactId=dojo -Dversion=${dojo.version} -Dpackaging=zip -DgeneratePom=true -Dfile=${basedir}/target/dojo-download/dojo-release-${dojo.version}.zip"/>
+        </exec>
+    </target>
+
+    <target name="install-dojo-nomaven" depends="check-dojo-installed" unless="already.installed">
+        <mkdir dir="${basedir}/target/dojo-download/"/>
+        <get src="http://download.dojotoolkit.org/release-${dojo.version}/dojo-release-${dojo.version}.zip"
+            dest="${basedir}/target/dojo-download/dojo-release-${dojo.version}.zip"
+            verbose="true"
+            usetimestamp="true"/>
+        <copy file="${basedir}/target/dojo-download/dojo-release-${dojo.version}.zip" 
+              tofile="${localRepository}/dojo/dojo/${dojo.version}/dojo-${dojo.version}.zip"/>
+    </target>
+	
+
+    <target name="unpack-dojo-files" depends="check-dojo-installed, check-dojo-unpacked" unless="already.unpacked">
+        <fail message="dojo zip file not installed in local repository: ${localRepository}" unless="already.installed"/>
+        <mkdir dir="${basedir}/target/dojo-unpack-temp/"/>
+        <unzip src="${localRepository}/dojo/dojo/${dojo.version}/dojo-${dojo.version}.zip"
+               dest="${basedir}/target/dojo-unpack-temp/"
+               overwrite="false">
+            <patternset>
+                <include name="dojo-release-${dojo.version}/dojo/**"/>
+                <exclude name="dojo-release-${dojo.version}/dojo/tests/**"/>
+                <include name="dojo-release-${dojo.version}/dijit/**"/>
+                <exclude name="dojo-release-${dojo.version}/dojox/**"/>
+                <exclude name="dojo-release-${dojo.version}/util/**"/>
+            </patternset>
+        </unzip>
+        <move file="${basedir}/target/dojo-unpack-temp/dojo-release-${dojo.version}"
+              tofile="${unpack.location}"
+              verbose="true"/>
+        <delete dir="${basedir}/target/dojo-unpack-temp/"/>
+    </target>
+	
+
+    <target name="clean-dojo-files">
+        <delete dir="${unpack.location}"/>
+    </target>
+</project>

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/build-dojo.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: tuscany/java/sca/samples/simple-bigbank-spring/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/pom.xml?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/pom.xml (original)
+++ tuscany/java/sca/samples/simple-bigbank-spring/pom.xml Tue Aug 19 09:26:34 2008
@@ -38,9 +38,58 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-host-embedded</artifactId>
             <version>1.4-SNAPSHOT</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-spi</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.ws.security</groupId>
+            <artifactId>wss4j</artifactId>
+            <version>1.5.3</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
@@ -79,22 +128,51 @@
         
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-tomcat</artifactId>
+            <artifactId>tuscany-binding-atom-abdera</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-rss-rome</artifactId>
             <version>1.4-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
         
         <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>apache-activemq</artifactId>
-            <version>4.1.1</version>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.activemq</groupId>
-                    <artifactId>activemq-web-demo</artifactId>
-                </exclusion>
-            </exclusions>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-resource-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-http-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-jetty</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
@@ -107,7 +185,68 @@
     </dependencies>
 
     <build>
-       <finalName>${artifactId}</finalName>
+            <finalName>${artifactId}</finalName>
+            <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                    
+                <dependencies>
+                    <dependency>
+                        <groupId>ant</groupId>
+                        <artifactId>ant-trax</artifactId>
+                        <version>1.6.5</version>
+                    </dependency>
+                </dependencies>
+                
+                    <executions>
+                        <execution> 
+                            <id>install-dojo</id>                       
+                            <phase>validate</phase>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                            <configuration>
+                                <tasks>
+                                    <ant antfile="./build-dojo.xml" target="install-dojo">
+                                        <property name="localRepository" value="${settings.localRepository}"/>
+                                    </ant>
+                                </tasks>
+                            </configuration>
+                        </execution>
+                        <execution> 
+                            <id>copy-dojo-files</id>                       
+                            <phase>generate-resources</phase>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                            <configuration>
+                                <tasks>
+                                    <ant antfile="./build-dojo.xml" target="unpack-dojo-files">
+                                        <property name="localRepository" value="${settings.localRepository}"/>
+                                        <property name="artifactId" value="${artifactId}"/>
+                                    </ant>
+                                </tasks>
+                            </configuration>
+                        </execution>
+                        <execution> 
+                            <id>clean-dojo-files</id>                       
+                            <phase>clean</phase>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                            <configuration>
+                                <tasks>
+                                    <ant antfile="./build-dojo.xml" target="clean-dojo-files">
+                                        <property name="localRepository" value="${settings.localRepository}"/>
+                                        <property name="artifactId" value="${artifactId}"/>
+                                    </ant>
+                                </tasks>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>            
+                </plugins>
     </build>
 
 </project>

Added: tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java?rev=687088&view=auto
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java (added)
+++ tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java Tue Aug 19 09:26:34 2008
@@ -0,0 +1,71 @@
+/*
+ * 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 bigbank.account.feed;
+
+import org.apache.tuscany.sca.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import bigbank.account.AccountService;
+import bigbank.account.AccountReport;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+@Service(Collection.class)
+public class AccountFeedImpl implements Collection<String, String> {
+
+    @Reference
+    protected AccountService accountService;
+    
+    public Entry<String, String>[] getAll() {
+
+        // Add the Account report entry 
+        String report = get("1234");
+        Entry<String, String> entry = new Entry<String, String>("1234", report);
+
+        return new Entry[] { entry } ;
+    }
+
+    public String get(String id) {
+
+        // Get the account report for the specified customer ID
+        AccountReport accreport = accountService.getAccountReport(id);
+        String report = accreport.getCurrency();
+        
+        return report;
+    }
+
+    public void delete(String key) throws NotFoundException {
+    }
+
+    public String post(String key, String item) {
+        return null;
+    }
+
+    public void put(String key, String item) throws NotFoundException {
+    }
+
+    public Entry<String, String>[] query(String queryString) {
+        return null;
+    }
+}

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java (original)
+++ tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java Tue Aug 19 09:26:34 2008
@@ -19,7 +19,9 @@
 
 package bigbank.client;
 
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
 
 import bigbank.account.AccountService;
 
@@ -30,14 +32,15 @@
 public class BigBankClient {
     public static void main(String[] args) throws Exception {
 
-        SCADomain scaDomain = SCADomain.newInstance("BigBank.composite");
+        SCANode2Factory factory = SCANode2Factory.newInstance();
+        SCANode2 node = factory.createSCANodeFromClassLoader("BigBank.composite", BigBankClient.class.getClassLoader());
+        node.start();
         
-        AccountService accountService = scaDomain.getService(AccountService.class,
-                                                          "AccountServiceComponent");
+        AccountService accountService = ((SCAClient)node).getService(AccountService.class, "AccountServiceComponent");
 
         System.out.println("Account summary: " + accountService.getAccountReport("Customer_01") );
 
-        scaDomain.close();
+        node.stop();
     }  
 
 }

Modified: tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java (original)
+++ tuscany/java/sca/samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java Tue Aug 19 09:26:34 2008
@@ -1,99 +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 bigbank.server;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class BigBankServer {
-
-    public static void main(String[] args) throws Exception {
-        long timeout = -1L;
-        if (args.length > 0) {
-            timeout = Long.parseLong(args[0]);
-        }
-        
-        System.out.println("Starting the Spring SCA BigBank server...");
-        ClassLoader cl = BigBankServer.class.getClassLoader();
-        EmbeddedSCADomain domain = new EmbeddedSCADomain(cl, "http://localhost");
-
-        //Start the domain
-        domain.start();
-
-        // Contribute the SCA contribution
-        ContributionService contributionService = domain.getContributionService();
-        
-        URL bigbankContribUrl = getContributionURL(BigBankServer.class);
-        Contribution bigbankContribution = contributionService.contribute("http://bigbank", bigbankContribUrl, false);
-        for (Composite deployable : bigbankContribution.getDeployables()) {
-            domain.getDomainComposite().getIncludes().add(deployable);
-            domain.buildComposite(deployable);
-        }
-
-        //Start Components from  composite
-        for (Composite deployable : bigbankContribution.getDeployables()) {
-            domain.getCompositeActivator().activate(deployable);
-            domain.getCompositeActivator().start(deployable);
-        }
-        
-        if (timeout < 0) {
-            System.out.println("Press Enter to Exit...");
-            System.in.read();
-        } else {
-            Thread.sleep(timeout);
-        }
-        
-        contributionService.remove("http://bigbank");
-
-        // Stop Components from  composite
-        for (Composite deployable : bigbankContribution.getDeployables()) {
-            domain.getCompositeActivator().stop(deployable);
-            domain.getCompositeActivator().deactivate(deployable);
-        }
-
-        domain.stop();
-
-        domain.close();
-        
-        System.out.println("Bye");
-    }
-    
-    private static URL getContributionURL(Class<?> cls) throws MalformedURLException {
-        String flag = "/" + cls.getName().replace('.', '/') + ".class";
-        URL url = cls.getResource(flag);
-        String root = url.toExternalForm();
-        root = root.substring(0, root.length() - flag.length() + 1);
-        if (root.startsWith("jar:") && root.endsWith("!/")) {
-            root = root.substring(4, root.length() - 2);
-        }
-        url = new URL(root);
-        return url;
-    }
-
-}
+/*
+ * 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 bigbank.server;
+
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class BigBankServer {
+
+    public static void main(String[] args) throws Exception {
+        long timeout = -1L;
+        if (args.length > 0) {
+            timeout = Long.parseLong(args[0]);
+        }
+        
+        System.out.println("Starting the Sample SCA Spring BigBank server...");
+                
+        SCANode2Factory factory = SCANode2Factory.newInstance();
+        SCANode2 node = factory.createSCANodeFromClassLoader("BigBank.composite", BigBankServer.class.getClassLoader());
+        node.start();
+
+        if (timeout < 0) {
+            System.out.println("Press Enter to Exit...");
+            System.in.read();
+        } else {
+            Thread.sleep(timeout);
+        }
+
+        node.stop();
+        
+        System.out.println("Bye");
+    }
+}

Modified: tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/BigBank.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/BigBank.composite?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/BigBank.composite (original)
+++ tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/BigBank.composite Tue Aug 19 09:26:34 2008
@@ -33,6 +33,8 @@
         
         <service name="AccountService">
             <interface.java interface="bigbank.account.AccountService"/>
+            <tuscany:binding.jsonrpc uri="http://localhost:8085/SpringAccountJSONService"/>
+            <binding.sca/>
         </service>
 
         <reference name="savingsAccountService" target="SavingsAccountServiceComponent"/>
@@ -66,5 +68,21 @@
     <component name="StockAccountServiceComponent">
         <implementation.composite name="bbst:StockAccountDept"/>
     </component>
+    
+    <component name="AccountFeedComponent">
+        <implementation.java class="bigbank.account.feed.AccountFeedImpl"/>
+        <service name="Collection">
+            <tuscany:binding.rss uri="http://localhost:8085/rss"/>
+            <tuscany:binding.atom uri="http://localhost:8085/atom"/>
+        </service>
+        <reference name="accountService" target="AccountServiceComponent"/>
+    </component>
+    
+    <component name="WebResourceComponent">
+        <tuscany:implementation.resource location="web"/>
+        <service name="Resource">
+            <tuscany:binding.http uri="http://localhost:8085/"/>
+        </service>
+    </component>
 
 </composite>

Added: tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css?rev=687088&view=auto
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css (added)
+++ tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css Tue Aug 19 09:26:34 2008
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+* { font-family: arial; }
+
+table, th, td { border: 2px solid blue; border-collapse: collapse; }
+th { color: white; background-color: blue; }

Propchange: tuscany/java/sca/samples/simple-bigbank-spring/src/main/resources/web/style.css
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tuscany/java/sca/samples/spring-bigbank-calculator/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-calculator/pom.xml?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-calculator/pom.xml (original)
+++ tuscany/java/sca/samples/spring-bigbank-calculator/pom.xml Tue Aug 19 09:26:34 2008
@@ -1,85 +1,92 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    * Licensed to the Apache Software Foundation (ASF) under one
-    * or more contributor license agreements.  See the NOTICE file
-    * distributed with this work for additional information
-    * regarding copyright ownership.  The ASF licenses this file
-    * to you under the Apache License, Version 2.0 (the
-    * "License"); you may not use this file except in compliance
-    * with the License.  You may obtain a copy of the License at
-    * 
-    *   http://www.apache.org/licenses/LICENSE-2.0
-    * 
-    * Unless required by applicable law or agreed to in writing,
-    * software distributed under the License is distributed on an
-    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    * KIND, either express or implied.  See the License for the
-    * specific language governing permissions and limitations
-    * under the License.    
--->
-<project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-sca</artifactId>
-        <version>1.4-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <artifactId>sample-spring-bigbank-calculator</artifactId>
-    <name>Apache Tuscany SCA Spring-Based BigBank Calculator Sample</name>
-
-    <repositories>
-       <repository>
-          <id>apache.incubator</id>
-          <url>http://people.apache.org/repo/m2-incubating-repository</url>
-       </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-embedded</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-script</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-spring</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-rmi</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.2</version>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-       <finalName>${artifactId}</finalName>
-    </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-spring-bigbank-calculator</artifactId>
+    <name>Apache Tuscany SCA Spring-Based BigBank Calculator Sample</name>
+
+    <repositories>
+       <repository>
+          <id>apache.incubator</id>
+          <url>http://people.apache.org/repo/m2-incubating-repository</url>
+       </repository>
+    </repositories>
+
+    <dependencies>    
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-script</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-spring</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-rmi</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+</project>

Modified: tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java (original)
+++ tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java Tue Aug 19 09:26:34 2008
@@ -1,41 +1,44 @@
-/*
- * 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 bigbank.calculator.server;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CalculatorServer {
-
-    public static void main(String[] args) throws Exception {
-
-        System.out.println("Starting the Sample SCA Calculator...");
-
-        SCADomain domain = SCADomain.newInstance("Calculator.composite");
-
-        System.out.println("Press Enter to Exit...");
-        System.in.read();
-
-        domain.close();
-
-        System.out.println("Bye");
-        System.exit(0);
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package bigbank.calculator.server;
+
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+
+public class CalculatorServer {
+
+    public static void main(String[] args) throws Exception {
+
+        System.out.println("Starting the Sample SCA Calculator...");
+
+        SCANode2Factory factory = SCANode2Factory.newInstance();
+        SCANode2 node = factory.createSCANodeFromClassLoader("Calculator.composite", CalculatorServer.class.getClassLoader());
+        node.start();
+
+        System.out.println("Press Enter to Exit...");
+        System.in.read();
+
+        node.stop();
+
+        System.out.println("Bye");
+        System.exit(0);
+    }
+
+}

Modified: tuscany/java/sca/samples/spring-bigbank-checkaccount/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-checkaccount/pom.xml?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-checkaccount/pom.xml (original)
+++ tuscany/java/sca/samples/spring-bigbank-checkaccount/pom.xml Tue Aug 19 09:26:34 2008
@@ -1,101 +1,108 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    * Licensed to the Apache Software Foundation (ASF) under one
-    * or more contributor license agreements.  See the NOTICE file
-    * distributed with this work for additional information
-    * regarding copyright ownership.  The ASF licenses this file
-    * to you under the Apache License, Version 2.0 (the
-    * "License"); you may not use this file except in compliance
-    * with the License.  You may obtain a copy of the License at
-    * 
-    *   http://www.apache.org/licenses/LICENSE-2.0
-    * 
-    * Unless required by applicable law or agreed to in writing,
-    * software distributed under the License is distributed on an
-    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    * KIND, either express or implied.  See the License for the
-    * specific language governing permissions and limitations
-    * under the License.    
--->
-<project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-sca</artifactId>
-        <version>1.4-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <artifactId>sample-spring-bigbank-checkaccount</artifactId>
-    <name>Apache Tuscany SCA Spring-Based BigBank Checking Accounts Sample</name>
-
-    <repositories>
-        <repository>
-            <id>apache.incubator</id>
-            <url>http://people.apache.org/repo/m2-incubating-repository</url>
-        </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-embedded</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-core-spi</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-	    <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-spring</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-jms-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ws.security</groupId>
-            <artifactId>wss4j</artifactId>
-            <version>1.5.3</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.2</version>
-            <scope>test</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>apache-activemq</artifactId>
-            <version>4.1.1</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.activemq</groupId>
-                    <artifactId>activemq-web-demo</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>  
-
-    <build>
-       <finalName>${artifactId}</finalName>
-    </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-spring-bigbank-checkaccount</artifactId>
+    <name>Apache Tuscany SCA Spring-Based BigBank Checking Accounts Sample</name>
+
+    <repositories>
+        <repository>
+            <id>apache.incubator</id>
+            <url>http://people.apache.org/repo/m2-incubating-repository</url>
+        </repository>
+    </repositories>
+
+    <dependencies>     
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-spi</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+	    <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-spring</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-jms-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ws.security</groupId>
+            <artifactId>wss4j</artifactId>
+            <version>1.5.3</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>apache-activemq</artifactId>
+            <version>4.1.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.activemq</groupId>
+                    <artifactId>activemq-web-demo</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>  
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+</project>

Modified: tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java (original)
+++ tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java Tue Aug 19 09:26:34 2008
@@ -1,58 +1,61 @@
-/*
- * 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 bigbank.account.checking.server;
-
-import java.io.IOException;
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This server program shows how to create an SCA runtime, and start it which
- * activates the Spring BigBank CheckingsAccount JMS endpoint.
- */
-public class CheckingAccountServer {
-
-    public static void main(String[] args) {
-        try {
-            BrokerService jmsBroker;
-            jmsBroker = new BrokerService(); 
-            jmsBroker.setPersistent(false);
-            jmsBroker.setUseJmx(false);
-            jmsBroker.addConnector("tcp://localhost:61619");
-            jmsBroker.start();
-            
-            SCADomain scaDomain = SCADomain.newInstance("CheckingsAccount.composite");
-
-            System.out.println("CheckingsAccount server started (press enter to shutdown)");
-            System.in.read();
-
-            scaDomain.close();
-            
-            jmsBroker.stop();
-            System.out.println("CheckingsAccount server stopped");
-        
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-}
+/*
+ * 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 bigbank.account.checking.server;
+
+import java.io.IOException;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+
+/**
+ * This server program shows how to create an SCA runtime, and start it which
+ * activates the Spring BigBank CheckingsAccount JMS endpoint.
+ */
+public class CheckingAccountServer {
+
+    public static void main(String[] args) {
+        try {
+            BrokerService jmsBroker;
+            jmsBroker = new BrokerService(); 
+            jmsBroker.setPersistent(false);
+            jmsBroker.setUseJmx(false);
+            jmsBroker.addConnector("tcp://localhost:61619");
+            jmsBroker.start();
+            
+            SCANode2Factory factory = SCANode2Factory.newInstance();
+            SCANode2 node = factory.createSCANodeFromClassLoader("CheckingsAccount.composite", CheckingAccountServer.class.getClassLoader());
+            node.start();
+
+            System.out.println("CheckingsAccount server started (press enter to shutdown)");
+            System.in.read();
+
+            node.stop();
+            
+            jmsBroker.stop();
+            System.out.println("CheckingsAccount server stopped");
+        
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

Modified: tuscany/java/sca/samples/spring-bigbank-stockquote/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-stockquote/pom.xml?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-stockquote/pom.xml (original)
+++ tuscany/java/sca/samples/spring-bigbank-stockquote/pom.xml Tue Aug 19 09:26:34 2008
@@ -1,86 +1,93 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    * Licensed to the Apache Software Foundation (ASF) under one
-    * or more contributor license agreements.  See the NOTICE file
-    * distributed with this work for additional information
-    * regarding copyright ownership.  The ASF licenses this file
-    * to you under the Apache License, Version 2.0 (the
-    * "License"); you may not use this file except in compliance
-    * with the License.  You may obtain a copy of the License at
-    * 
-    *   http://www.apache.org/licenses/LICENSE-2.0
-    * 
-    * Unless required by applicable law or agreed to in writing,
-    * software distributed under the License is distributed on an
-    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    * KIND, either express or implied.  See the License for the
-    * specific language governing permissions and limitations
-    * under the License.    
--->
-<project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-sca</artifactId>
-        <version>1.4-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <artifactId>sample-spring-bigbank-stockquote</artifactId>
-    <name>Apache Tuscany SCA Spring-Based BigBank StockQuote Sample</name>
-
-    <repositories>
-       <repository>
-          <id>apache.incubator</id>
-          <url>http://people.apache.org/repo/m2-incubating-repository</url>
-       </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-embedded</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-spring</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-ws-axis2</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-tomcat</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.2</version>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-    
-    <build>
-       <finalName>${artifactId}</finalName>
-    </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-spring-bigbank-stockquote</artifactId>
+    <name>Apache Tuscany SCA Spring-Based BigBank StockQuote Sample</name>
+
+    <repositories>
+       <repository>
+          <id>apache.incubator</id>
+          <url>http://people.apache.org/repo/m2-incubating-repository</url>
+       </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-spring</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+
+</project>

Modified: tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java?rev=687088&r1=687087&r2=687088&view=diff
==============================================================================
--- tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java (original)
+++ tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java Tue Aug 19 09:26:34 2008
@@ -1,42 +1,45 @@
-/*
- * 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 bigbank.stockquote.server;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This server program shows how to bootstrap SCA from a simple J2SE program
- * and start it which activates the StockQuote Web service endpoint.
- */
-public class StockQuoteServer {
-
-    public static void main(String[] args) throws Exception {
-
-        System.out.println("Starting the Sample SCA StockQuote Service...");
-
-        SCADomain domain = SCADomain.newInstance("StockQuote.composite");
-
-        System.out.println("Press Enter to Exit...");
-        System.in.read();
-
-        domain.close();
-        System.out.println("Bye");
-    }
-
-}
+/*
+ * 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 bigbank.stockquote.server;
+
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+
+/**
+ * This server program shows how to bootstrap SCA from a simple J2SE program
+ * and start it which activates the StockQuote Web service endpoint.
+ */
+public class StockQuoteServer {
+
+    public static void main(String[] args) throws Exception {
+
+        System.out.println("Starting the Sample SCA StockQuote Service...");
+
+        SCANode2Factory factory = SCANode2Factory.newInstance();
+        SCANode2 node = factory.createSCANodeFromClassLoader("StockQuote.composite", StockQuoteServer.class.getClassLoader());
+        node.start();
+
+        System.out.println("Press Enter to Exit...");
+        System.in.read();
+
+        node.stop();
+        System.out.println("Bye");
+    }
+
+}