summaryrefslogtreecommitdiffstats
path: root/tags/java-M1-20060518/java/samples/sca/supplychain/src
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java-M1-20060518/java/samples/sca/supplychain/src')
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java31
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java44
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java26
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java39
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java26
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java39
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java57
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java26
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java39
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/logging.properties27
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/sca.module48
-rw-r--r--tags/java-M1-20060518/java/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java51
12 files changed, 0 insertions, 453 deletions
diff --git a/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Customer.java
deleted file mode 100644
index 5d35802833..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java
deleted file mode 100644
index 2ec01ebbc8..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Retailer.java
deleted file mode 100644
index 9496e730f5..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java
deleted file mode 100644
index 4079bd2aea..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Shipper.java
deleted file mode 100644
index 94d60d99a2..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java
deleted file mode 100644
index 4283bed795..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java
deleted file mode 100644
index de30da9428..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java
deleted file mode 100644
index de52e71c1e..0000000000
--- a/tags/java-M1-20060518/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-20060518/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java
deleted file mode 100644
index 96e0f2795b..0000000000
--- a/tags/java-M1-20060518/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");
- }
-
-}
diff --git a/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/logging.properties b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/logging.properties
deleted file mode 100644
index 58407bd5a9..0000000000
--- a/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/logging.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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
diff --git a/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/sca.module b/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/sca.module
deleted file mode 100644
index e44798b89f..0000000000
--- a/tags/java-M1-20060518/java/samples/sca/supplychain/src/main/resources/sca.module
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 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.
- -->
-<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="supplychain.CustomerComponentImpl"/>
- <references>
- <v:retailer>RetailerComponent</v:retailer>
- </references>
- </component>
-
- <component name="RetailerComponent">
- <implementation.java class="supplychain.RetailerComponentImpl"/>
- <references>
- <v:warehouse>WarehouseComponent</v:warehouse>
- </references>
- </component>
-
- <component name="WarehouseComponent">
- <implementation.java class="supplychain.WarehouseComponentImpl"/>
- <references>
- <v:shipper>ShipperComponent</v:shipper>
- </references>
- </component>
-
- <component name="ShipperComponent">
- <implementation.java class="supplychain.ShipperComponentImpl"/>
- <references>
- <v:customer>CustomerComponent</v:customer>
- </references>
- </component>
-
-</module>
diff --git a/tags/java-M1-20060518/java/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java b/tags/java-M1-20060518/java/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
deleted file mode 100644
index ecc3b17985..0000000000
--- a/tags/java-M1-20060518/java/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
+++ /dev/null
@@ -1,51 +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 junit.framework.TestCase;
-
-import org.apache.tuscany.core.client.TuscanyRuntime;
-import org.osoa.sca.CurrentModuleContext;
-import org.osoa.sca.ModuleContext;
-
-import supplychain.Customer;
-
-/**
- * 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();
-
- }
-}