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 2007/02/17 11:04:14 UTC

svn commit: r508748 [1/2] - in /incubator/tuscany/branches/sca-java-integration: samples/sca/bigbank/src/main/resources/META-INF/sca/ samples/sca/bigbank/src/test/java/bigbank/ samples/sca/calculator/src/main/java/calculator/ samples/sca/echo.binding/s...

Author: jsdelfino
Date: Sat Feb 17 02:04:12 2007
New Revision: 508748

URL: http://svn.apache.org/viewvc?view=rev&rev=508748
Log:
Cleaned up the samples. Renamed TuscanyContainer to SCAContainer. Added client side and server side test cases to the WS samples, and made changes to run the WS test cases end to end (client connected to the server).

Added:
    incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/test/src/main/java/org/apache/tuscany/test/SCATestCaseRunner.java   (with props)
Removed:
    incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/default.scdl
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/server/
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/application.composite
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/webapp/
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldWSClient.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyContainer.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultTuscanyContainer.java
Modified:
    incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/test/java/bigbank/BigBankTestCase.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/java/echo/BootstrapTestCase.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/pom.xml
    incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/java/innercomposite/InnerCompositeClient.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/test/java/innercomposite/InnerCompositeTestCase.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/pom.xml
    incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/java/loanappconversation/LoanAppConversationClient.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/test/java/loanappconversation/LoanAppConversationTestCase.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/pom.xml
    incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java
    incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsOM/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/kernel/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml
    incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java
    incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/test/java/org/apache/tuscany/service/jetty/JettyServiceImplTestCase.java
    incubator/tuscany/branches/sca-java-integration/sca/test/src/main/java/org/apache/tuscany/test/SCATestCase.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/callBackBasicTest/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionTests/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,44 @@
+<?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"
+           name="BigBankComposite">
+
+    <service name="AccountService">
+        <interface.java interface="bigbank.account.AccountService"/>
+        <reference>AccountServiceComponent</reference>
+    </service>
+
+    <!--
+    <reference name="StockQuoteService">
+        <interface.java interface="bigbank.stock.StockQuoteService"/>
+    </reference>
+    -->
+
+
+    <component name="AccountServiceComponent">
+        <implementation.java class="bigbank.account.AccountServiceImpl"/>
+        <reference name="accountDataService">AccountDataServiceComponent</reference>
+    </component>
+
+    <component name="AccountDataServiceComponent">
+        <implementation.java class="bigbank.accountdata.AccountDataServiceImpl"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/test/java/bigbank/BigBankTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/test/java/bigbank/BigBankTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/test/java/bigbank/BigBankTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/bigbank/src/test/java/bigbank/BigBankTestCase.java Sat Feb 17 02:04:12 2007
@@ -29,7 +29,6 @@
     AccountService accountService;
 
     protected void setUp() throws Exception {
-        setApplicationSCDL(AccountService.class, "META-INF/sca/default.scdl");
         super.setUp();
 
         CompositeContext context = CurrentCompositeContext.getContext();

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java Sat Feb 17 02:04:12 2007
@@ -18,7 +18,7 @@
  */
 package calculator;
 
-import org.apache.tuscany.api.TuscanyContainer;
+import org.apache.tuscany.api.SCAContainer;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
@@ -29,7 +29,7 @@
 public class CalculatorClient {
     public static void main(String[] args) throws Exception {
     	
-    	TuscanyContainer.start();
+    	SCAContainer.start();
 
         CompositeContext context = CurrentCompositeContext.getContext();
         CalculatorService calculatorService =
@@ -41,6 +41,6 @@
         System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
         System.out.println("3 / 2=" + calculatorService.divide(3, 2));
 
-        TuscanyContainer.stop();
+        SCAContainer.stop();
     }
 }

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/java/echo/BootstrapTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/java/echo/BootstrapTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/java/echo/BootstrapTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/java/echo/BootstrapTestCase.java Sat Feb 17 02:04:12 2007
@@ -37,7 +37,6 @@
     }
 
     protected void setUp() throws Exception {
-        setApplicationSCDL(Client.class, "META-INF/sca/default.scdl");
         addExtension("echo.binding", getClass().getClassLoader().getResource("META-INF/sca/echo.system.scdl"));
         super.setUp();
         CompositeContext context = CurrentCompositeContext.getContext();

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,38 @@
+<?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" name="echo.sample">
+
+    <service name="ClientService">
+        <interface.java class="echo.Client"/>
+        <binding.echo/>
+        <reference>Client</reference>
+    </service>
+
+    <component name="Client">
+        <implementation.java class="echo.ClientImpl"/>
+        <reference name="echoReference">EchoReference</reference>
+    </component>
+    
+    <reference name="EchoReference">
+        <interface.java interface="echo.Echo"/>
+        <binding.echo/>
+    </reference>
+    
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.binding/src/test/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/java/echo/DataBindingIntegrationTestCase.java Sat Feb 17 02:04:12 2007
@@ -36,7 +36,6 @@
     }
 
     protected void setUp() throws Exception {
-        setApplicationSCDL(getClass(), "META-INF/sca/default.scdl");
         // addExtension("echo.binding", getClass().getClassLoader().getResource("META-INF/sca/echo.system.scdl"));
         // addExtension("test.extensions", getClass().getClassLoader().getResource("META-INF/tuscany/test-extensions.scdl"));
         super.setUp();

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,62 @@
+<?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:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:f="http://foo"
+    xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" name="echo.sample">
+
+    <service name="EchoService">
+        <interface.java class="echo.Interface1" />
+        <binding.echo />
+        <reference>ComponentB</reference>
+    </service>
+
+    <component name="ComponentA">
+        <implementation.java class="echo.ComponentAImpl" />
+        <reference name="componentBReference">ComponentB</reference>
+        <property name="prefix">ABC</property>
+        <property name="prefix1" source="$messagePrefix"></property>
+        <property name="bar" source="$complexProperty/*[local-name()='foo']/*[local-name()='bar']"></property>
+        <property name="omProperty"><a><b>XYZ</b></a></property>
+    </component>
+
+    <component name="ComponentB">
+        <implementation.java class="echo.ComponentBImpl" />
+        <reference name="echoReference">EchoReference</reference>
+    </component>
+
+    <reference name="EchoReference">
+        <!-- 
+            <interface.java interface="echo.Echo"/>
+        -->
+        <interface.wsdl interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)" wsdli:wsdlLocation="http://example.com/echo.wsdl wsdl/echo.wsdl">
+            <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement"/>
+        </interface.wsdl>
+        <binding.echo />
+    </reference>
+    
+    <property name="messagePrefix" type="xsd:string">ABC</property>
+    <property name="complexProperty" type="f:FooType">
+        <foo>
+            <bar attr="barAttr">BAR</bar>
+        </foo>
+    </property>
+
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/echo.databinding/src/test/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/pom.xml Sat Feb 17 02:04:12 2007
@@ -35,6 +35,12 @@
             <artifactId>sca-api-r1.0</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.tuscany.sca.kernel</groupId>
+            <artifactId>tuscany-api</artifactId>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-test</artifactId>
             <version>0.1-integration-incubating-SNAPSHOT</version>

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/java/innercomposite/InnerCompositeClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/java/innercomposite/InnerCompositeClient.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/java/innercomposite/InnerCompositeClient.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/java/innercomposite/InnerCompositeClient.java Sat Feb 17 02:04:12 2007
@@ -1,5 +1,6 @@
 package innercomposite;
 
+import org.apache.tuscany.api.SCAContainer;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
@@ -11,11 +12,15 @@
 public class InnerCompositeClient {
 
     public static void main(String[] args) throws Exception {
+    	SCAContainer.start();
+    	
         CompositeContext context = CurrentCompositeContext.getContext();
 
         Source source = context.locateService(Source.class, "SourceComponent/InnerSourceService");
         System.out.println("Main thread " + Thread.currentThread());
         source.clientMethod("Client.main");
         Thread.sleep(500);
+        
+        SCAContainer.stop();
     }
 }

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,37 @@
+<?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"
+           name="OuterComposite">
+
+    <component name="SourceComponent">
+        <implementation.composite name="InnerComposite" scdlLocation="InnerComposite.scdl"/>
+        <reference name="TargetComponentRef">TargetComponent</reference>
+        <reference name="TargetComponentRef2">TargetComponent2/InnerTargetService</reference>
+    </component>
+
+    <component name="TargetComponent">
+		<implementation.java class="innercomposite.TargetImpl"/>
+    </component>
+    
+    <component name="TargetComponent2">
+        <implementation.composite name="InnerComposite2" scdlLocation="InnerComposite2.scdl"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/test/java/innercomposite/InnerCompositeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/test/java/innercomposite/InnerCompositeTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/test/java/innercomposite/InnerCompositeTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/inner.composite/src/test/java/innercomposite/InnerCompositeTestCase.java Sat Feb 17 02:04:12 2007
@@ -27,7 +27,6 @@
     private Source source;
 
     protected void setUp() throws Exception {
-        setApplicationSCDL(Source.class, "META-INF/sca/default.scdl");
         super.setUp();
 
         CompositeContext context = CurrentCompositeContext.getContext();

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/pom.xml Sat Feb 17 02:04:12 2007
@@ -35,6 +35,12 @@
             <artifactId>sca-api-r1.0</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.tuscany.sca.kernel</groupId>
+            <artifactId>tuscany-api</artifactId>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-test</artifactId>
             <version>0.1-integration-incubating-SNAPSHOT</version>

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/java/loanappconversation/LoanAppConversationClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/java/loanappconversation/LoanAppConversationClient.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/java/loanappconversation/LoanAppConversationClient.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/java/loanappconversation/LoanAppConversationClient.java Sat Feb 17 02:04:12 2007
@@ -18,12 +18,15 @@
  */
 package loanappconversation;
 
+import org.apache.tuscany.api.SCAContainer;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
 public class LoanAppConversationClient {
 
     public static void main(String[] args) throws Exception {
+    	SCAContainer.start();
+    	
         // Locate the MyClient component and invoke it
         CompositeContext context = CurrentCompositeContext.getContext();
 
@@ -31,5 +34,7 @@
         loanClient.applyForLoan("John Doe", 1000.0f);
         System.out.println(loanClient.displayLoan());
         System.out.println("Loan approved: " + loanClient.isApproved());
+        
+        SCAContainer.stop();
     }
 }

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,31 @@
+<?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" name="simplecallback">
+
+    <component name="LoanClientComponent">
+        <implementation.java class="loanappconversation.LoanClientImpl"/>
+        <reference name="loanService">LoanServiceComponent</reference>
+    </component>
+    
+    <component name="LoanServiceComponent">
+        <implementation.java class="loanappconversation.LoanServiceImpl"/>
+    </component>
+    
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/test/java/loanappconversation/LoanAppConversationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/test/java/loanappconversation/LoanAppConversationTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/test/java/loanappconversation/LoanAppConversationTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/loanappconversation/src/test/java/loanappconversation/LoanAppConversationTestCase.java Sat Feb 17 02:04:12 2007
@@ -29,7 +29,6 @@
 
     protected void setUp() throws Exception {
         try {
-            setApplicationSCDL(LoanClient.class, "META-INF/sca/default.scdl");
             super.setUp();
     
             CompositeContext context = CurrentCompositeContext.getContext();

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/pom.xml Sat Feb 17 02:04:12 2007
@@ -35,6 +35,12 @@
             <artifactId>sca-api-r1.0</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.tuscany.sca.kernel</groupId>
+            <artifactId>tuscany-api</artifactId>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-test</artifactId>
             <version>0.1-integration-incubating-SNAPSHOT</version>

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java Sat Feb 17 02:04:12 2007
@@ -18,6 +18,7 @@
  */
 package supplychain;
 
+import org.apache.tuscany.api.SCAContainer;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
@@ -28,6 +29,7 @@
 public class SupplyChainClient {
 
     public static final void main(String[] args) throws Exception {
+    	SCAContainer.start();
         
         // Locate the Customer component and invoke it
         CompositeContext context = CurrentCompositeContext.getContext();
@@ -39,5 +41,6 @@
         System.out.println("Main thread sleeping ...");
         Thread.sleep(1000);
 
+        SCAContainer.stop();
     }
 }

Added: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,42 @@
+<?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" name="supplychain">
+
+    <component name="CustomerComponent">
+        <implementation.java class="supplychain.CustomerComponentImpl" />
+        <reference name="retailer">RetailerComponent</reference>
+    </component>
+
+    <component name="RetailerComponent">
+        <implementation.java class="supplychain.RetailerComponentImpl" />
+        <reference name="warehouse">WarehouseComponent</reference>
+    </component>
+
+    <component name="WarehouseComponent">
+        <implementation.java class="supplychain.WarehouseComponentImpl" />
+        <reference name="shipper">ShipperComponent</reference>
+    </component>
+
+    <component name="ShipperComponent">
+        <implementation.java class="supplychain.ShipperComponentImpl" />
+        <reference name="customer">CustomerComponent</reference>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/sca/application.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java Sat Feb 17 02:04:12 2007
@@ -32,7 +32,6 @@
     private Customer customer;
 
     protected void setUp() throws Exception {
-        setApplicationSCDL(SupplyChainClient.class, "META-INF/sca/default.scdl");
         super.setUp();
 
         CompositeContext context = CurrentCompositeContext.getContext();

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/pom.xml Sat Feb 17 02:04:12 2007
@@ -26,16 +26,25 @@
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>sample-helloworldws</artifactId>
-    <packaging>war</packaging>
+    <artifactId>tuscany-sample-helloworldws</artifactId>
+    <packaging>jar</packaging>
     <name>Tuscany HelloWorld Web Service Sample</name>
     <description>A sample HelloWorld Web Service.</description>
 
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tuscany.sca.services</groupId>
-            <artifactId>http-jetty</artifactId>
-        </dependency>        
-    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>helloworld.HelloWorldServer</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

Added: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,28 @@
+package helloworld;
+
+
+import java.io.IOException;
+
+import org.apache.tuscany.api.SCAContainer;
+
+public class HelloWorldServer {
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		
+		SCAContainer.start("META-INF/sca/helloworldws.composite");
+		
+		try {
+			System.out.println("HelloWorld server started");
+			System.in.read();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		SCAContainer.stop();
+		System.out.println("HelloWorld server stopped");
+	}
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/java/helloworld/HelloWorldServer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite Sat Feb 17 02:04:12 2007
@@ -0,0 +1,34 @@
+<?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:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+    name="helloworldws">
+    
+    <service name="HelloWorldWebService">
+        <interface.java class="helloworld.HelloWorldService" />
+        <!-- interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" / -->
+        <binding.ws endpoint="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)" location="wsdl/helloworld.wsdl" />
+        <reference>HelloWorldServiceComponent</reference>
+    </service>
+
+    <component name="HelloWorldServiceComponent">
+        <implementation.java class="helloworld.HelloWorldImpl" />
+    </component>
+
+</composite>

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/main/resources/META-INF/sca/helloworldws.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,43 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.tuscany.test.SCATestCase;
+
+public class HelloWorldServerTestCase extends SCATestCase {
+	
+	@Override
+	protected void setUp() throws Exception {
+		setApplicationSCDL("META-INF/sca/helloworldws.composite");
+		super.setUp();
+	}
+	
+	public void testPing() throws IOException {
+		new Socket("127.0.0.1", 8080);
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldws/src/test/java/helloworld/HelloWorldServerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsOM/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsOM/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsOM/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsOM/pom.xml Sat Feb 17 02:04:12 2007
@@ -27,7 +27,7 @@
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>sample-helloworldwsOM</artifactId>
-    <packaging>war</packaging>
+    <packaging>jar</packaging>
     <name>Tuscany HelloWorld Web Service Sample OM</name>
     <description>A sample HelloWorld Web Service OM.</description>
 

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/pom.xml Sat Feb 17 02:04:12 2007
@@ -26,14 +26,23 @@
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>sample-helloworldwsclient</artifactId>
+    <artifactId>tuscany-sample-helloworldwsclient</artifactId>
     <packaging>jar</packaging>
     <name>Tuscany HelloWorld Web Service Client Sample</name>
     <description>A sample client for a HelloWorld Web Service.</description>
 
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca.extensions.axis2.samples</groupId>
+            <artifactId>tuscany-sample-helloworldws</artifactId>
+            <scope>test</scope>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+        </dependency>
+
+    </dependencies>
+
     <build>
-        <finalName>sample-helloworldwsclient</finalName>
-        <defaultGoal>install</defaultGoal>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -42,15 +51,11 @@
                     <archive>
                         <manifest>
                             <mainClass>helloworld.HelloWorldClient</mainClass>
-                            <addClasspath>true</addClasspath>
-                            <classpathPrefix>../lib/</classpathPrefix>
                         </manifest>
                     </archive>
                 </configuration>
             </plugin>
-
         </plugins>
     </build>
-
 
 </project>

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/main/java/helloworld/HelloWorldClient.java Sat Feb 17 02:04:12 2007
@@ -18,7 +18,7 @@
  */
 package helloworld;
 
-import org.apache.tuscany.api.TuscanyContainer;
+import org.apache.tuscany.api.SCAContainer;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
@@ -29,13 +29,13 @@
 public class HelloWorldClient {
 
     public  final static void main(String[] args) throws Exception {
-    	TuscanyContainer.start();
+    	SCAContainer.start();
     	
         CompositeContext compositeContext = CurrentCompositeContext.getContext();
         HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
         String value = helloWorldService.getGreetings("World");
         System.out.println(value);
         
-        TuscanyContainer.stop();
+        SCAContainer.stop();
     }
 }

Added: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,64 @@
+/*
+ * 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 helloworld;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.test.SCATestCase;
+import org.apache.tuscany.test.SCATestCaseRunner;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * Test case for helloworld web service client 
+ */
+public class HelloWorldClientTestCase extends SCATestCase {
+
+    private HelloWorldService helloWorldService;
+    
+    private SCATestCaseRunner server;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        
+        CompositeContext compositeContext = CurrentCompositeContext.getContext();
+        helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
+
+        server =  new SCATestCaseRunner(HelloWorldServerTestCase.class);
+        server.setUp();
+    }
+    
+//    public void testPingServer() {
+//    	server.run("testPing");
+//    }
+
+    public void testWSClient() throws Exception {
+        String msg = helloWorldService.getGreetings("Smith");
+        Assert.assertEquals("Hello Smith", msg);
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+    	super.tearDown();
+    	server.tearDown();
+    }
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldClientTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,43 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.tuscany.test.SCATestCase;
+
+public class HelloWorldServerTestCase extends SCATestCase {
+	
+	@Override
+	protected void setUp() throws Exception {
+		setApplicationSCDL("META-INF/sca/helloworldws.composite");
+		super.setUp();
+	}
+	
+	public void testPing() throws IOException {
+		new Socket("127.0.0.1", 8080);
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/helloworldwsclient/src/test/java/helloworld/HelloWorldServerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml Sat Feb 17 02:04:12 2007
@@ -68,7 +68,7 @@
         <dependencies>
             <dependency>
                 <groupId>org.apache.tuscany.sca.services</groupId>
-                <artifactId>http-jetty</artifactId>
+                <artifactId>tuscany-http-jetty</artifactId>
                 <scope>test</scope>
                 <version>0.1-integration-incubating-SNAPSHOT</version>
             </dependency>        
@@ -83,17 +83,29 @@
             <version>0.1-integration-incubating-SNAPSHOT</version>
         </dependency>        
         <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-test</artifactId>
+            <groupId>org.apache.tuscany.sca.kernel</groupId>
+            <artifactId>tuscany-core</artifactId>
             <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.tuscany.sca.extensions.axis2</groupId>
             <artifactId>tuscany-axis2</artifactId>
-            <scope>test</scope>
+            <scope>provided</scope>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.apache.tuscany.sca.services</groupId>
+            <artifactId>tuscany-http-jetty</artifactId>
+            <scope>provided</scope>
             <version>0.1-integration-incubating-SNAPSHOT</version>
         </dependency>        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-test</artifactId>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,217 @@
+/*
+ * 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 org.apache.tuscany.api;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.osoa.sca.ComponentContext;
+
+/**
+ * The Tuscany container
+ */
+public abstract class SCAContainer {
+    public static final String SYSTEM_SCDL = "META-INF/tuscany/system.composite";
+    public static final String EXTENSION_SCDL = "META-INF/sca/extension.composite";
+    public static final String SERVICE_SCDL = "META-INF/sca/service.composite";
+    public static final String APPLICATION_SCDL = "META-INF/sca/application.composite";
+
+    private static SCAContainer instance;
+
+    /**
+     * Read the service name from a configuration file
+     * @param classLoader
+     * @param name
+     * @return
+     * @throws IOException
+     */
+    private static String getServiceName(ClassLoader classLoader, String name) throws IOException {
+        InputStream is = classLoader.getResourceAsStream("META-INF/services/" + name);
+        if (is == null) {
+            return null;
+        }
+        BufferedReader reader = null;
+        try {
+            reader = new BufferedReader(new InputStreamReader(is));
+            while (true) {
+                String line = reader.readLine();
+                if (line == null) {
+                    break;
+                } else if (!line.startsWith("#")) {
+                    return line.trim();
+                }
+            }
+        } finally {
+            if (reader != null) {
+                reader.close();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns a TuscanyContainer instance. If the system property
+     * "org.apache.tuscany.api.TuscanyContainer" is set, its value is used as
+     * the name of the implementation class. Otherwise, if the resource
+     * "META-INF/services/org.apache.tuscany.api.TuscanyContainer" can be loaded
+     * from the supplied classloader. Otherwise, it will use
+     * "org.apache.tuscany.core.bootstrap.DefaultSCAContainer" as the default.
+     * The named class is loaded from the supplied classloader and instantiated
+     * using its default (no-arg) constructor.
+     * 
+     * @return
+     */
+    private static SCAContainer newInstance(final ClassLoader classLoader) {
+
+        try {
+            final String name = SCAContainer.class.getName();
+            String className = AccessController.doPrivileged(new PrivilegedAction<String>() {
+                public String run() {
+                    return System.getProperty(name);
+                }
+            });
+
+            if (className == null) {
+                className = getServiceName(classLoader, name);
+            }
+            if (className == null) {
+                className = "org.apache.tuscany.core.bootstrap.DefaultSCAContainer";
+            }
+            Class cls = Class.forName(className, true, classLoader);
+            return (SCAContainer)cls.newInstance();
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Get an instance of Tuscany container
+     * 
+     * @return The instance
+     */
+    public synchronized static SCAContainer getInstance() {
+        if (instance != null) {
+            return instance;
+        }
+        ClassLoader classLoader = SCAContainer.class.getClassLoader();
+        instance = newInstance(classLoader);
+        return instance;
+    }
+
+    /**
+     * Start the Tuscany runtime using default SCDLs
+     */
+    public static void start() {
+        try {
+            getInstance().startup(null, null, null);
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Start the Tuscany container with the given SCDLs
+     * 
+     * @param system The URL for the system SCDL
+     * @param extensions An array of URLs for extensions
+     * @param application The URL for the application SCDL
+     */
+    public static void start(URL system, URL[] extensions, URL application) {
+        try {
+            getInstance().startup(system, extensions, application);
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Start the Tuscany container with the given SCDL
+     * 
+     * @param application The URL for the application SCDL
+     */
+    public static void start(URL application) {
+        try {
+            getInstance().startup(null, null, application);
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Start the Tuscany container with the given SCDL
+     * 
+     * @param application The path of the application SCDL
+     */
+    public static void start(String application) {
+        try {
+            getInstance().startup(null, null, SCAContainer.class.getClassLoader().getResource(application));
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Get the ComponentContext by name
+     * 
+     * @param componentName
+     * @return
+     */
+    public static ComponentContext getComponentContext(String componentName) {
+        return getInstance().getContext(componentName);
+    }
+
+    /**
+     * Stop the Tuscany container
+     */
+    public static void stop() {
+        try {
+            getInstance().shutdown();
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    /**
+     * Look up the ComponentContext by name
+     * @param componentName
+     * @return
+     */
+    protected abstract ComponentContext getContext(String componentName);
+
+    /**
+     * Start up the container
+     * @param system
+     * @param extensions
+     * @param application
+     * @throws Exception
+     */
+    protected abstract void startup(URL system, URL[] extensions, URL application) throws Exception;
+
+    /**
+     * Shutdown the container
+     * @throws Exception
+     */
+    protected abstract void shutdown() throws Exception;
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCAContainer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/pom.xml Sat Feb 17 02:04:12 2007
@@ -62,7 +62,6 @@
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
-            <version>1.0.1</version>
         </dependency>
         
         <dependency>

Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java?view=auto&rev=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java Sat Feb 17 02:04:12 2007
@@ -0,0 +1,160 @@
+/*
+ * 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 org.apache.tuscany.core.bootstrap;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.apache.tuscany.api.SCAContainer;
+import org.apache.tuscany.api.TuscanyException;
+import org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
+import org.apache.tuscany.core.launcher.CompositeContextImpl;
+import org.apache.tuscany.core.launcher.LauncherImpl;
+import org.apache.tuscany.core.monitor.JavaLoggingMonitorFactory;
+import org.apache.tuscany.host.MonitorFactory;
+import org.apache.tuscany.host.runtime.InitializationException;
+import org.apache.tuscany.spi.bootstrap.ComponentNames;
+import org.apache.tuscany.spi.builder.BuilderException;
+import org.apache.tuscany.spi.component.AtomicComponent;
+import org.apache.tuscany.spi.component.Component;
+import org.apache.tuscany.spi.component.ComponentException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.SCAObject;
+import org.apache.tuscany.spi.deployer.Deployer;
+import org.apache.tuscany.spi.deployer.DeploymentMonitor;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.model.ComponentDefinition;
+import org.apache.tuscany.spi.wire.WireService;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * Base class for JUnit tests that want to run in an SCA client environment.
+ * 
+ * @version $Rev$ $Date$
+ */
+@SuppressWarnings("deprecation")
+public class DefaultSCAContainer extends SCAContainer {
+    private CompositeComponent component;
+    private CompositeContextImpl context;
+    private LauncherImpl launcher;
+    private MonitorFactory monitorFactory;
+
+    protected void startup(URL system, URL[] exts, URL applicationSCDL) throws Exception {
+        if (monitorFactory == null) {
+            monitorFactory = new JavaLoggingMonitorFactory();
+        }
+        ClassLoader cl = getClass().getClassLoader();
+        launcher = new LauncherImpl();
+        launcher.setApplicationLoader(cl);
+
+        if (system == null) {
+            system = cl.getResource(SCAContainer.SYSTEM_SCDL);
+        }
+
+        try {
+            CompositeComponent composite = launcher.bootRuntime(system, monitorFactory);
+            List<URL> extensions = new ArrayList<URL>();
+            Enumeration<URL> urls = cl.getResources(SCAContainer.SERVICE_SCDL);
+            extensions.addAll(Collections.list(urls));
+            urls = cl.getResources(SCAContainer.EXTENSION_SCDL);
+            extensions.addAll(Collections.list(urls));
+            if (exts != null) {
+            	for (URL ext : exts) {
+            		if (!extensions.contains(ext))
+            			extensions.add(ext);
+            	}
+            }
+            int i = 0;
+            for (URL ext : extensions) {
+                deployExtension(composite, "tuscany.extension." + (i++), ext);
+            }
+
+            SCAObject wireServiceComponent = composite.getSystemChild(ComponentNames.TUSCANY_WIRE_SERVICE);
+            if (!(wireServiceComponent instanceof AtomicComponent)) {
+                throw new InitializationException("WireService must be an atomic component");
+            }
+
+            WireService wireService = (WireService)((AtomicComponent)wireServiceComponent).getTargetInstance();
+
+            if (applicationSCDL == null) {
+                applicationSCDL = cl.getResource(SCAContainer.APPLICATION_SCDL);
+                if (applicationSCDL == null) {
+                    throw new RuntimeException("application SCDL not found: " + SCAContainer.APPLICATION_SCDL);
+                }
+            }
+            component = launcher.bootApplication("application", applicationSCDL);
+            component.start();
+            context = new CompositeContextImpl(component, wireService);
+            CurrentCompositeContext.setContext(context);
+        } catch (TuscanyException e) {
+            DeploymentMonitor monitor = monitorFactory.getMonitor(DeploymentMonitor.class);
+            monitor.deploymentError(e);
+            throw e;
+        }
+
+    }
+
+    /**
+     * Sets the monitor factory to use
+     * 
+     * @param monitorFactory the monitor factory to use
+     */
+    protected void setMonitorFactory(MonitorFactory monitorFactory) {
+        this.monitorFactory = monitorFactory;
+    }
+
+    protected void deployExtension(CompositeComponent composite, String extensionName, URL scdlURL)
+        throws LoaderException, BuilderException, ComponentException, InitializationException {
+        SystemCompositeImplementation implementation = new SystemCompositeImplementation();
+        implementation.setScdlLocation(scdlURL);
+        implementation.setClassLoader(new URLClassLoader(new URL[] {scdlURL}, getClass().getClassLoader()));
+
+        ComponentDefinition<SystemCompositeImplementation> definition =
+            new ComponentDefinition<SystemCompositeImplementation>(extensionName, implementation);
+
+        SCAObject child = composite.getSystemChild(ComponentNames.TUSCANY_DEPLOYER);
+        if (!(child instanceof AtomicComponent)) {
+            throw new InitializationException("Deployer must be an atomic component");
+        }
+        Deployer deployer = (Deployer)((AtomicComponent)child).getTargetInstance();
+        Component component = deployer.deploy(composite, definition);
+        component.start();
+    }
+
+    protected void shutdown() throws Exception {
+        CurrentCompositeContext.setContext(null);
+        component.stop();
+        launcher.shutdownRuntime();
+    }
+
+    @Override
+    protected ComponentContext getContext(String componentName) {
+        // TODO
+        return null;
+    }
+
+    public CompositeComponent getCompsiteComponent() {
+        return component;
+    }
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCAContainer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/pom.xml Sat Feb 17 02:04:12 2007
@@ -80,6 +80,14 @@
                 <scope>provided</scope>
             </dependency>
 
+            <!-- javax.resource.spi.Work API -->
+            <dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+                <version>1.0.1</version>
+                <scope>provided</scope>
+            </dependency>
+
             <!-- java.xml.stream API -->
             <dependency>
                 <groupId>stax</groupId>

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml Sat Feb 17 02:04:12 2007
@@ -24,7 +24,7 @@
         <version>0.1-integration-incubating-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>http-jetty</artifactId>
+    <artifactId>tuscany-http-jetty</artifactId>
     <name>Apache Tuscany Jetty HTTP Service</name>
     <description>Tuscany Jetty HTTP Service</description>
 
@@ -50,10 +50,12 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
+            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java?view=diff&rev=508748&r1=508747&r2=508748
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java Sat Feb 17 02:04:12 2007
@@ -26,6 +26,7 @@
 
 import org.apache.tuscany.api.annotation.Monitor;
 import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.SCAObjectStartException;
 import org.apache.tuscany.spi.host.ServletHost;
 import org.apache.tuscany.spi.services.work.WorkScheduler;
 import org.mortbay.jetty.Connector;
@@ -102,17 +103,6 @@
         }
     }
 
-//    public JettyServiceImpl(TransportMonitor monitor) {
-//        this.monitor = monitor;
-//    }
-//
-//    public JettyServiceImpl(TransportMonitor monitor,
-//                            WorkScheduler scheduler,
-//                            Connector connector) {
-//        this(monitor, scheduler);
-//        this.connector = connector;
-//    }
-
     @Property
     public void setHttpPort(int httpPort) {
         this.httpPort = httpPort;
@@ -155,69 +145,75 @@
 
     @Init
     public void init() throws Exception {
-        try {
-            state = STARTING;
-            server = new Server();
-            if (scheduler == null) {
-                BoundedThreadPool threadPool = new BoundedThreadPool();
-                threadPool.setMaxThreads(100);
-                server.setThreadPool(threadPool);
-            } else {
-                server.setThreadPool(new TuscanyThreadPool());
-            }
-            if (connector == null) {
-                if (https) {
-                    Connector httpConnector = new SelectChannelConnector();
-                    httpConnector.setPort(httpPort);
-                    SslSocketConnector sslConnector = new SslSocketConnector();
-                    sslConnector.setPort(httpsPort);
-                    sslConnector.setKeystore(keystore);
-                    sslConnector.setPassword(certPassword);
-                    sslConnector.setKeyPassword(keyPassword);
-                    server.setConnectors(new Connector[]{httpConnector, sslConnector});
-                } else {
-                    SelectChannelConnector selectConnector = new SelectChannelConnector();
-                    selectConnector.setPort(httpPort);
-                    server.setConnectors(new Connector[]{selectConnector});
-                }
-            } else {
-                connector.setPort(httpPort);
-                server.setConnectors(new Connector[]{connector});
-            }
-
-            ContextHandler contextHandler = new ContextHandler();
-            contextHandler.setContextPath(ROOT);
-            server.setHandler(contextHandler);
-
-            SessionHandler sessionHandler = new SessionHandler();
-            servletHandler = new ServletHandler();
-            sessionHandler.addHandler(servletHandler);
-
-            contextHandler.setHandler(sessionHandler);
-
-            server.setStopAtShutdown(true);
-            server.setSendServerVersion(sendServerVersion);
-            //monitor.started();
-            server.start();
-            state = STARTED;
-        } catch (Exception e) {
-            state = ERROR;
-            throw e;
-        }
+        state = STARTING;
     }
 
     @Destroy
     public void destroy() throws Exception {
-        state = STOPPING;
-        synchronized (joinLock) {
-            joinLock.notifyAll();
-        }
-        server.stop();
-        state = STOPPED;
-        //monitor.shutdown();
+    	if (state == STARTED) {
+	        state = STOPPING;
+	        synchronized (joinLock) {
+	            joinLock.notifyAll();
+	        }
+	        server.stop();
+	        state = STOPPED;
+	        //monitor.shutdown();
+    	}
     }
 
     public void registerMapping(String path, Servlet servlet) {
+    	if (state == STARTING) {
+    		
+            try {
+                server = new Server();
+                if (scheduler == null) {
+                    BoundedThreadPool threadPool = new BoundedThreadPool();
+                    threadPool.setMaxThreads(100);
+                    server.setThreadPool(threadPool);
+                } else {
+                    server.setThreadPool(new TuscanyThreadPool());
+                }
+                if (connector == null) {
+                    if (https) {
+                        Connector httpConnector = new SelectChannelConnector();
+                        httpConnector.setPort(httpPort);
+                        SslSocketConnector sslConnector = new SslSocketConnector();
+                        sslConnector.setPort(httpsPort);
+                        sslConnector.setKeystore(keystore);
+                        sslConnector.setPassword(certPassword);
+                        sslConnector.setKeyPassword(keyPassword);
+                        server.setConnectors(new Connector[]{httpConnector, sslConnector});
+                    } else {
+                        SelectChannelConnector selectConnector = new SelectChannelConnector();
+                        selectConnector.setPort(httpPort);
+                        server.setConnectors(new Connector[]{selectConnector});
+                    }
+                } else {
+                    connector.setPort(httpPort);
+                    server.setConnectors(new Connector[]{connector});
+                }
+
+                ContextHandler contextHandler = new ContextHandler();
+                contextHandler.setContextPath(ROOT);
+                server.setHandler(contextHandler);
+
+                SessionHandler sessionHandler = new SessionHandler();
+                servletHandler = new ServletHandler();
+                sessionHandler.addHandler(servletHandler);
+
+                contextHandler.setHandler(sessionHandler);
+
+                server.setStopAtShutdown(true);
+                server.setSendServerVersion(sendServerVersion);
+                //monitor.started();
+                server.start();
+                state = STARTED;
+            } catch (Exception e) {
+                state = ERROR;
+                throw new SCAObjectStartException(e);
+            }
+    	}
+    	
         ServletHolder holder = new ServletHolder(servlet);
         servletHandler.addServlet(holder);
         ServletMapping mapping = new ServletMapping();



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