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 2006/05/04 09:59:03 UTC
svn commit: r399594 - in /incubator/tuscany/java: samples/helloworld/
samples/helloworld/helloworldasync/ sca/samples/ sca/samples/supplychain/
sca/samples/supplychain/src/ sca/samples/supplychain/src/main/
sca/samples/supplychain/src/main/java/ sca/sa...
Author: jsdelfino
Date: Thu May 4 00:58:52 2006
New Revision: 399594
URL: http://svn.apache.org/viewcvs?rev=399594&view=rev
Log:
Fix for TUSCANY-246 - added supplychain sample contributed by Ignacio
Added:
incubator/tuscany/java/sca/samples/supplychain/ (with props)
incubator/tuscany/java/sca/samples/supplychain/pom.xml (with props)
incubator/tuscany/java/sca/samples/supplychain/src/
incubator/tuscany/java/sca/samples/supplychain/src/main/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/resources/
incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties (with props)
incubator/tuscany/java/sca/samples/supplychain/src/main/resources/sca.module
incubator/tuscany/java/sca/samples/supplychain/src/test/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/
incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java (with props)
incubator/tuscany/java/sca/samples/supplychain/src/test/resources/
Removed:
incubator/tuscany/java/samples/helloworld/helloworldasync/
Modified:
incubator/tuscany/java/samples/helloworld/pom.xml
incubator/tuscany/java/sca/samples/pom.xml
Modified: incubator/tuscany/java/samples/helloworld/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/pom.xml?rev=399594&r1=399593&r2=399594&view=diff
==============================================================================
--- incubator/tuscany/java/samples/helloworld/pom.xml (original)
+++ incubator/tuscany/java/samples/helloworld/pom.xml Thu May 4 00:58:52 2006
@@ -29,7 +29,6 @@
<modules>
<module>helloworldmc</module>
- <module>helloworldasync</module>
<module>helloworldjsonrpc</module>
</modules>
</project>
Modified: incubator/tuscany/java/sca/samples/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/pom.xml?rev=399594&r1=399593&r2=399594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/pom.xml (original)
+++ incubator/tuscany/java/sca/samples/pom.xml Thu May 4 00:58:52 2006
@@ -32,5 +32,6 @@
<module>helloworldweb</module>
<module>helloworldws</module>
<module>helloworldwsclient</module>
+ <module>supplychain</module>
</modules>
</project>
Propchange: incubator/tuscany/java/sca/samples/supplychain/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May 4 00:58:52 2006
@@ -0,0 +1,13 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+.settings
+.deployables
+.wtpmodules
+
Added: incubator/tuscany/java/sca/samples/supplychain/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/pom.xml?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/pom.xml (added)
+++ incubator/tuscany/java/sca/samples/supplychain/pom.xml Thu May 4 00:58:52 2006
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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>
+ <parent>
+ <groupId>org.apache.tuscany.sca.samples</groupId>
+ <artifactId>tuscany-sca-samples</artifactId>
+ <version>SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>supplychain</artifactId>
+ <packaging>jar</packaging>
+ <name>Tuscany Supply Chain Sample</name>
+ <description>A sample implementation of an asynchronous supply chain application.</description>
+ <version>SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.containers</groupId>
+ <artifactId>tuscany-container-java</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: incubator/tuscany/java/sca/samples/supplychain/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java Thu May 4 00:58:52 2006
@@ -0,0 +1,31 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import org.osoa.sca.annotations.OneWay;
+
+/**
+ * This is the business interface of the Customer service component.
+ */
+public interface Customer {
+
+ public void purchaseGoods();
+
+ @OneWay
+ public void notifyShipment(String order);
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Customer.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java Thu May 4 00:58:52 2006
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Customer service component.
+ */
+@Service(Customer.class)
+public class CustomerComponentImpl implements Customer {
+
+ private Retailer retailer;
+
+ @Reference
+ public void setRetailer(Retailer retailer) {
+ this.retailer = retailer;
+ }
+
+ public void purchaseGoods() {
+ retailer.submitOrder("Order");
+ }
+
+ public void notifyShipment(String order) {
+ System.out.print("Work thread " + Thread.currentThread() + " - ");
+ System.out.println(order);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/CustomerComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java Thu May 4 00:58:52 2006
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+/**
+ * This is the business interface of the Retailer service component.
+ */
+public interface Retailer {
+
+ public void submitOrder(String order);
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Retailer.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java Thu May 4 00:58:52 2006
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Customer service component.
+ */
+@Service(Retailer.class)
+public class RetailerComponentImpl implements Retailer {
+
+ private Warehouse warehouse;
+
+ @Reference
+ public void setWarehouse(Warehouse warehouse) {
+ this.warehouse = warehouse;
+ }
+
+ public void submitOrder(String order) {
+ warehouse.fulfillOrder(order + ", submitted");
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/RetailerComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java Thu May 4 00:58:52 2006
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+/**
+ * This is the business interface of the Shipper service component.
+ */
+public interface Shipper {
+
+ public void processShipment(String order);
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Shipper.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java Thu May 4 00:58:52 2006
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Warehouse service component.
+ */
+@Service(Shipper.class)
+public class ShipperComponentImpl implements Shipper {
+
+ private Customer customer;
+
+ @Reference
+ public void setCustomer(Customer customer) {
+ this.customer = customer;
+ }
+
+ public void processShipment(String order) {
+ customer.notifyShipment(order + ", shipped");
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/ShipperComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java Thu May 4 00:58:52 2006
@@ -0,0 +1,57 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+
+import org.apache.tuscany.common.monitor.MonitorFactory;
+import org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory;
+import org.apache.tuscany.core.client.TuscanyRuntime;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ModuleContext;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * locate a Customer service component and invoke it.
+ */
+public class SupplyChainClient {
+
+ public static final void main(String[] args) throws Exception {
+
+ // Setup Tuscany monitoring to use java.util.logging
+ LogManager.getLogManager().readConfiguration(SupplyChainClient.class.getResourceAsStream("/logging.properties"));
+ Properties levels = new Properties();
+ MonitorFactory monitorFactory = new JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");
+
+ // Obtain Tuscany runtime
+ TuscanyRuntime tuscany = new TuscanyRuntime("supplychain", null, monitorFactory);
+
+ // Associate the application module component with this thread
+ tuscany.start();
+
+ // Obtain SCA module context.
+ ModuleContext moduleContext = CurrentModuleContext.getContext();
+
+ // Locate the HelloWorld service component and invoke it
+ Customer customer = (Customer) moduleContext.locateService("CustomerComponent");
+ System.out.println("Main thread " + Thread.currentThread());
+ customer.purchaseGoods();
+
+ }
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/SupplyChainClient.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java Thu May 4 00:58:52 2006
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+/**
+ * This is the business interface of the Warehouse service component.
+ */
+public interface Warehouse {
+
+ public void fulfillOrder(String order);
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/Warehouse.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java Thu May 4 00:58:52 2006
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Warehouse service component.
+ */
+@Service(Warehouse.class)
+public class WarehouseComponentImpl implements Warehouse {
+
+ private Shipper shipper;
+
+ @Reference
+ public void setShipper(Shipper shipper) {
+ this.shipper = shipper;
+ }
+
+ public void fulfillOrder(String order) {
+ shipper.processShipment(order + ", fulfilled");
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/java/org/apache/tuscany/samples/supplychain/WarehouseComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties Thu May 4 00:58:52 2006
@@ -0,0 +1,27 @@
+# Copyright (c) 2006 The Apache Software Foundation or its licensors, as applicable.
+#
+# Licensed 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.
+#
+# $Rev$ $Date$
+#
+
+# Custom logging configuration for Tuscany samples
+# By default, only INFO level logging is enabled and ALL messages get sent to the console
+# For more messages from the runtime, uncomment specific settings at the end of this file
+handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level = ALL
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+.level=INFO
+
+# Uncomment the next setting to get all Tuscany messages (this will be a lot)
+#org.apache.tuscany.level=FINEST
\ No newline at end of file
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/main/resources/logging.properties
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/samples/supplychain/src/main/resources/sca.module
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/main/resources/sca.module?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/main/resources/sca.module (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/main/resources/sca.module Thu May 4 00:58:52 2006
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 BEA Sytems Inc.
+ Copyright (c) 2005 International Business Machines
+
+ Licensed 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.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ name="SupplyChain">
+
+ <component name="CustomerComponent">
+ <implementation.java class="org.apache.tuscany.samples.supplychain.CustomerComponentImpl"/>
+ <references>
+ <v:retailer>RetailerComponent</v:retailer>
+ </references>
+ </component>
+
+ <component name="RetailerComponent">
+ <implementation.java class="org.apache.tuscany.samples.supplychain.RetailerComponentImpl"/>
+ <references>
+ <v:warehouse>WarehouseComponent</v:warehouse>
+ </references>
+ </component>
+
+ <component name="WarehouseComponent">
+ <implementation.java class="org.apache.tuscany.samples.supplychain.WarehouseComponentImpl"/>
+ <references>
+ <v:shipper>ShipperComponent</v:shipper>
+ </references>
+ </component>
+
+ <component name="ShipperComponent">
+ <implementation.java class="org.apache.tuscany.samples.supplychain.ShipperComponentImpl"/>
+ <references>
+ <v:customer>CustomerComponent</v:customer>
+ </references>
+ </component>
+
+</module>
Added: incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java?rev=399594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java (added)
+++ incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java Thu May 4 00:58:52 2006
@@ -0,0 +1,49 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.samples.supplychain;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.core.client.TuscanyRuntime;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ModuleContext;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * locate a simple HelloWorld service component and invoke it.
+ */
+public class SupplyChainClientTestCase extends TestCase {
+
+ public void test() throws Exception {
+
+ // Obtain Tuscany runtime
+ TuscanyRuntime tuscany = new TuscanyRuntime("hello", null);
+
+ // Associate the application module component with this thread
+ tuscany.start();
+
+ // Obtain SCA module context.
+ ModuleContext moduleContext = CurrentModuleContext.getContext();
+
+ // Locate the HelloWorld service component and invoke it
+ // Locate the CustomerComponent service component and invoke it
+ Customer customer = (Customer) moduleContext.locateService("CustomerComponent");
+ System.out.println("Main thread " + Thread.currentThread());
+ customer.purchaseGoods();
+
+ }
+}
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/supplychain/src/test/java/org/apache/tuscany/samples/supplychain/SupplyChainClientTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date