From 5559ef5edbf8d3616f7a4b497b2a459b0ee4082b Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:07 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835122 13f79535-47bb-0310-9956-ffa450edef68 --- branches/sca-java-1.0/samples/supplychain/README | 101 --------- .../sca-java-1.0/samples/supplychain/build.xml | 72 ------- branches/sca-java-1.0/samples/supplychain/pom.xml | 65 ------ .../src/main/java/supplychain/Customer.java | 33 --- .../java/supplychain/CustomerComponentImpl.java | 44 ---- .../src/main/java/supplychain/Retailer.java | 28 --- .../java/supplychain/RetailerComponentImpl.java | 39 ---- .../src/main/java/supplychain/Shipper.java | 28 --- .../java/supplychain/ShipperComponentImpl.java | 39 ---- .../main/java/supplychain/SupplyChainClient.java | 40 ---- .../src/main/java/supplychain/Warehouse.java | 28 --- .../java/supplychain/WarehouseComponentImpl.java | 39 ---- .../src/main/resources/supplychain.composite | 45 ---- .../supplychain/SupplyChainClientTestCase.java | 52 ----- .../samples/supplychain/supplychain.png | Bin 3898 -> 0 bytes .../samples/supplychain/supplychain.svg | 228 --------------------- 16 files changed, 881 deletions(-) delete mode 100644 branches/sca-java-1.0/samples/supplychain/README delete mode 100644 branches/sca-java-1.0/samples/supplychain/build.xml delete mode 100644 branches/sca-java-1.0/samples/supplychain/pom.xml delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Customer.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Retailer.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Shipper.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Warehouse.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/main/resources/supplychain.composite delete mode 100644 branches/sca-java-1.0/samples/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java delete mode 100644 branches/sca-java-1.0/samples/supplychain/supplychain.png delete mode 100644 branches/sca-java-1.0/samples/supplychain/supplychain.svg (limited to 'branches/sca-java-1.0/samples/supplychain') diff --git a/branches/sca-java-1.0/samples/supplychain/README b/branches/sca-java-1.0/samples/supplychain/README deleted file mode 100644 index ea4493fdd4..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/README +++ /dev/null @@ -1,101 +0,0 @@ -SupplyChain Sample -================== - -This sample demonstrates SCA components using the asynchronous API. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -If you just want to run it to see what happens open a command prompt, navigate -to this sample directory and do: - -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-supplychain.jar supplychain.SupplyChainClient - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-supplychain.jar supplychain.SupplyChainClient - - -Sample Overview ---------------- - -The sample provides a Customer service with a purchaseGoods operation -and a notifyShipment operation annotated with the SCA @OneWay annotation. -The SupplyChainClient exercises this interface by calling the -purchaseGoods operation. This results in messages passing to -the Retailer, Warehouse, and Shipper components and the result returned -to the Customer service on a separate callback thread. - -supplychain/ - src/ - main/ - java/ - supplychain/ - Customer.java - Defines the Java interface implemented - by the Customer component - CustomerComponentImpl.java - Implements the SCA Customer component - Retailer.java - Defines the Java interface implemented - by the Retailer component - RetailerComponentImpl.java - Implements the SCA RetailerComponent component - Shipper.java - Defines the Java interface implemented - by the Shipper component - ShipperComponentImpl.java - Implements the SCA ShipperComponent component - SupplyChainClient.java - SupplyChainClient.java loads SCA runtime - Warehouse.java - Defines the Java interface implemented - by the Warehouse component - WarehouseComponentImpl.java - Implements the SCA WarehouseComponent component - - resources/ - supplychain.composite - the SCA assembly for this sample - test/ - java/ - supplychain/ - SupplyChainClientTestCase.java - JUnit test case - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant as -follows - -cd supplychain -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] Main thread Thread[main,5,main] - [java] Main thread sleeping ... - [java] Work thread Thread[pool-1-thread-1,5,main] - Order, submitted, fulfilled, shipped - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd supplychain -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running supplychain.SupplyChainClientTestCase -Main thread Thread[main,5,main] -Sleeping ... -Work thread Thread[pool-1-thread-1,5,main] - Order, submitted, fulfilled, shipped -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.625 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. \ No newline at end of file diff --git a/branches/sca-java-1.0/samples/supplychain/build.xml b/branches/sca-java-1.0/samples/supplychain/build.xml deleted file mode 100644 index 506180b8b1..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/build.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.0/samples/supplychain/pom.xml b/branches/sca-java-1.0/samples/supplychain/pom.xml deleted file mode 100644 index c6f1b22ac5..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.0-incubating-SNAPSHOT - ../../pom.xml - - sample-supplychain - Apache Tuscany SCA Supply Chain Sample - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.0-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.0-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - - - ${artifactId} - - - diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Customer.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Customer.java deleted file mode 100644 index 8088001898..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Customer.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package 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); - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java deleted file mode 100644 index 7a1e8553ec..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import org.osoa.sca.annotations.Reference; - -/** - * This class implements the Customer service component. - */ -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); - } - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Retailer.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Retailer.java deleted file mode 100644 index 1add63fb4e..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Retailer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -/** - * This is the business interface of the Retailer service component. - */ -public interface Retailer { - - public void submitOrder(String order); - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java deleted file mode 100644 index f622052cf8..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import org.osoa.sca.annotations.Reference; - -/** - * This class implements the Customer service component. - */ -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"); - } - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Shipper.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Shipper.java deleted file mode 100644 index d4d49a922b..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Shipper.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -/** - * This is the business interface of the Shipper service component. - */ -public interface Shipper { - - public void processShipment(String order); - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java deleted file mode 100644 index 4ae52a12a2..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import org.osoa.sca.annotations.Reference; - -/** - * This class implements the Warehouse service component. - */ -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"); - } - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java deleted file mode 100644 index 7072f582d1..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * 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 { - SCADomain scaDomain = SCADomain.newInstance("supplychain.composite"); - Customer customer = scaDomain.getService(Customer.class, "CustomerComponent"); - - System.out.println("Main thread " + Thread.currentThread()); - customer.purchaseGoods(); - System.out.println("Main thread sleeping ..."); - Thread.sleep(1000); - - scaDomain.close(); - } -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Warehouse.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Warehouse.java deleted file mode 100644 index 0be499f569..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/Warehouse.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -/** - * This is the business interface of the Warehouse service component. - */ -public interface Warehouse { - - public void fulfillOrder(String order); - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java deleted file mode 100644 index b5e256a1e0..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import org.osoa.sca.annotations.Reference; - -/** - * This class implements the Warehouse service component. - */ -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"); - } - -} diff --git a/branches/sca-java-1.0/samples/supplychain/src/main/resources/supplychain.composite b/branches/sca-java-1.0/samples/supplychain/src/main/resources/supplychain.composite deleted file mode 100644 index 301efcaf1f..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/main/resources/supplychain.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.0/samples/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java b/branches/sca-java-1.0/samples/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java deleted file mode 100644 index 88e0eb7ab8..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package supplychain; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate a the Customer service component and invoke it. - */ -public class SupplyChainClientTestCase extends TestCase { - - private SCADomain scaDomain; - private Customer customer; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("supplychain.composite"); - customer = scaDomain.getService(Customer.class, "CustomerComponent"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void test() throws Exception { - - System.out.println("Main thread " + Thread.currentThread()); - customer.purchaseGoods(); - System.out.println("Sleeping ..."); - Thread.sleep(1000); - } -} diff --git a/branches/sca-java-1.0/samples/supplychain/supplychain.png b/branches/sca-java-1.0/samples/supplychain/supplychain.png deleted file mode 100644 index 51a384e827..0000000000 Binary files a/branches/sca-java-1.0/samples/supplychain/supplychain.png and /dev/null differ diff --git a/branches/sca-java-1.0/samples/supplychain/supplychain.svg b/branches/sca-java-1.0/samples/supplychain/supplychain.svg deleted file mode 100644 index f72e77acab..0000000000 --- a/branches/sca-java-1.0/samples/supplychain/supplychain.svg +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - supplychain - - CustomerComponent - - - RetailerComponent - - - WharehouseComponent - - - ShipperComponent - - - - - - - -- cgit v1.2.3