From 6d685c8e138af8d18bc71181ec630ccb9a17bdd9 Mon Sep 17 00:00:00 2001 From: nash Date: Wed, 6 Apr 2011 22:03:35 +0000 Subject: Tag for 1.6.2-RC1 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1089647 13f79535-47bb-0310-9956-ffa450edef68 --- .../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 ++++++++++++++++++++++ 10 files changed, 363 insertions(+) create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Customer.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Retailer.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Shipper.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Warehouse.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java create mode 100644 sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/resources/supplychain.composite (limited to 'sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main') diff --git a/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Customer.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Customer.java new file mode 100644 index 0000000000..8088001898 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Customer.java @@ -0,0 +1,33 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java new file mode 100644 index 0000000000..7a1e8553ec --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Retailer.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Retailer.java new file mode 100644 index 0000000000..1add63fb4e --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Retailer.java @@ -0,0 +1,28 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java new file mode 100644 index 0000000000..f622052cf8 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java @@ -0,0 +1,39 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Shipper.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Shipper.java new file mode 100644 index 0000000000..d4d49a922b --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Shipper.java @@ -0,0 +1,28 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java new file mode 100644 index 0000000000..4ae52a12a2 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java @@ -0,0 +1,39 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java new file mode 100644 index 0000000000..7072f582d1 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java @@ -0,0 +1,40 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Warehouse.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Warehouse.java new file mode 100644 index 0000000000..0be499f569 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/Warehouse.java @@ -0,0 +1,28 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java new file mode 100644 index 0000000000..b5e256a1e0 --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java @@ -0,0 +1,39 @@ +/* + * 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/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/resources/supplychain.composite b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/resources/supplychain.composite new file mode 100644 index 0000000000..301efcaf1f --- /dev/null +++ b/sca-java-1.x/tags/1.6.2-RC1/samples/supplychain/src/main/resources/supplychain.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3