diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-12 00:43:48 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-12 00:43:48 +0000 |
commit | 9425990f532b1152c2d73db96c0f07ef5216a3d1 (patch) | |
tree | a8986fc31f96eb02484a0ae9d1c14cfa788e30ac /java/sca-contrib/samples/supplychain/src/main | |
parent | 40523f9c6cb1f7a785c2dbd2466dc410ae6ddf66 (diff) |
Moving 2.x contribs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835178 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca-contrib/samples/supplychain/src/main')
10 files changed, 0 insertions, 363 deletions
diff --git a/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Customer.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Customer.java deleted file mode 100644 index 6c19a1108e..0000000000 --- a/java/sca-contrib/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.oasisopen.sca.annotation.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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/CustomerComponentImpl.java deleted file mode 100644 index 0323cebe11..0000000000 --- a/java/sca-contrib/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.oasisopen.sca.annotation.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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Retailer.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Retailer.java deleted file mode 100644 index 1add63fb4e..0000000000 --- a/java/sca-contrib/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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/RetailerComponentImpl.java deleted file mode 100644 index 809e2b7b89..0000000000 --- a/java/sca-contrib/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.oasisopen.sca.annotation.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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Shipper.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Shipper.java deleted file mode 100644 index d4d49a922b..0000000000 --- a/java/sca-contrib/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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/ShipperComponentImpl.java deleted file mode 100644 index 59513eca5d..0000000000 --- a/java/sca-contrib/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.oasisopen.sca.annotation.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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/SupplyChainClient.java deleted file mode 100644 index 7072f582d1..0000000000 --- a/java/sca-contrib/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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Warehouse.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/Warehouse.java deleted file mode 100644 index 0be499f569..0000000000 --- a/java/sca-contrib/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/java/sca-contrib/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/java/sca-contrib/samples/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java deleted file mode 100644 index ff4f5e62eb..0000000000 --- a/java/sca-contrib/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.oasisopen.sca.annotation.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/java/sca-contrib/samples/supplychain/src/main/resources/supplychain.composite b/java/sca-contrib/samples/supplychain/src/main/resources/supplychain.composite deleted file mode 100644 index 301efcaf1f..0000000000 --- a/java/sca-contrib/samples/supplychain/src/main/resources/supplychain.composite +++ /dev/null @@ -1,45 +0,0 @@ -<?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" - targetNamespace="http://supplychain" - xmlns:sp="http://supplychain" - name="supplychain"> - - <component name="CustomerComponent"> - <implementation.java class="supplychain.CustomerComponentImpl" /> - <reference name="retailer" target="RetailerComponent"/> - </component> - - <component name="RetailerComponent"> - <implementation.java class="supplychain.RetailerComponentImpl" /> - <reference name="warehouse" target="WarehouseComponent"/> - </component> - - <component name="WarehouseComponent"> - <implementation.java class="supplychain.WarehouseComponentImpl" /> - <reference name="shipper" target="ShipperComponent"/> - </component> - - <component name="ShipperComponent"> - <implementation.java class="supplychain.ShipperComponentImpl" /> - <reference name="customer" target="CustomerComponent"/> - </component> - -</composite> |