diff options
Diffstat (limited to 'tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java')
9 files changed, 0 insertions, 327 deletions
diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java deleted file mode 100644 index 5d35802833..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * 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 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/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java deleted file mode 100644 index 2ec01ebbc8..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * 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 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); - } - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java deleted file mode 100644 index 9496e730f5..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * 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 supplychain; - -/** - * This is the business interface of the Retailer service component. - */ -public interface Retailer { - - public void submitOrder(String order); - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java deleted file mode 100644 index 4079bd2aea..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * 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 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"); - } - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java deleted file mode 100644 index 94d60d99a2..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * 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 supplychain; - -/** - * This is the business interface of the Shipper service component. - */ -public interface Shipper { - - public void processShipment(String order); - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java deleted file mode 100644 index 4283bed795..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * 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 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"); - } - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java deleted file mode 100644 index de30da9428..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * - * 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 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(); - - } -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java deleted file mode 100644 index de52e71c1e..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * 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 supplychain; - -/** - * This is the business interface of the Warehouse service component. - */ -public interface Warehouse { - - public void fulfillOrder(String order); - -} diff --git a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java deleted file mode 100644 index 96e0f2795b..0000000000 --- a/tags/java-M1-20060522/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * 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 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"); - } - -} |