From 6fadbc9cd1fcf03d0b3630f772d91df149b70428 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:19 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835123 13f79535-47bb-0310-9956-ffa450edef68 --- .../warehouse/JavaWarehouseComponentImpl.java | 48 --------------- .../JavaWarehouseWithQueryComponentImpl.java | 52 ----------------- .../warehouse/OSGiWarehouseComponentImpl.java | 57 ------------------ .../supplychain/warehouse/OSGiWarehouseImpl.java | 68 ---------------------- .../warehouse/OSGiWarehouseServiceImpl.java | 62 -------------------- .../main/java/supplychain/warehouse/Warehouse.java | 28 --------- .../java/supplychain/warehouse/WarehouseQuery.java | 28 --------- 7 files changed, 343 deletions(-) delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java delete mode 100644 branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java (limited to 'branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse') diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java deleted file mode 100644 index 9edf3567e5..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java +++ /dev/null @@ -1,48 +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.warehouse; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import supplychain.shipper.Shipper; - -/** - * This class implements the Warehouse service component. - */ -@Service(Warehouse.class) -@Scope("STATELESS") -public class JavaWarehouseComponentImpl implements Warehouse { - - private Shipper shipper; - - @Reference - public void setShipper(Shipper shipper) { - this.shipper = shipper; - } - - public void fulfillOrder(String order) { - System.out.println("JavaWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); - - shipper.processShipment(order + ", fulfilled"); - } - - -} diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.java deleted file mode 100644 index 659f16be7f..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/JavaWarehouseWithQueryComponentImpl.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.warehouse; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import supplychain.shipper.Shipper; - -/** - * This class implements the Warehouse service component. - */ -@Service(interfaces={Warehouse.class, WarehouseQuery.class}) -@Scope("COMPOSITE") -public class JavaWarehouseWithQueryComponentImpl implements Warehouse, WarehouseQuery { - - private Shipper shipper; - - @Reference - public void setShipper(Shipper shipper) { - this.shipper = shipper; - } - - public void fulfillOrder(String order) { - System.out.println("JavaWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); - - shipper.processShipment(order + ", fulfilled"); - } - - public boolean isAvailable(String order) { - return true; - } - - -} diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java deleted file mode 100644 index dd283bf779..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseComponentImpl.java +++ /dev/null @@ -1,57 +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.warehouse; - - -import org.osgi.service.component.ComponentContext; - -import supplychain.shipper.Shipper; - -/** - * This class implements the Warehouse service component. - */ - -public class OSGiWarehouseComponentImpl implements Warehouse { - - private Shipper shipper; - - protected void setShipper(Shipper shipper) { - this.shipper = shipper; - } - - protected void unsetShipper(Shipper shipper) { - this.shipper = null; - } - - public void fulfillOrder(String order) { - System.out.println("OSGiWarehouseComponentImpl.fulfillOrder : shipper is " + shipper); - - shipper.processShipment(order + ", fulfilled"); - - } - - protected void activate(ComponentContext context){ - System.out.println("Activated OSGiWarehouseComponentImpl "); - } - - protected void deactivate(ComponentContext context){ - System.out.println("Deactivated OSGiWarehouseComponentImpl "); - } - -} diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java deleted file mode 100644 index bb04ff42e0..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseImpl.java +++ /dev/null @@ -1,68 +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.warehouse; - - -import java.util.Hashtable; - -import org.osgi.framework.BundleContext; - -import supplychain.OSGiBundleImpl; -import supplychain.shipper.Shipper; - -/** - * This class implements the Warehouse service component. - */ - -public class OSGiWarehouseImpl extends OSGiBundleImpl implements Warehouse { - - protected Shipper shipper; - private OSGiWarehouseServiceImpl warehouseService1; - private OSGiWarehouseServiceImpl warehouseService2; - - public OSGiWarehouseImpl() { - super(new String[]{"shipper"}, null); - - Hashtable props1 = new Hashtable(); - props1.put("component.name", "WarehouseComponent1"); - warehouseService1 = new OSGiWarehouseServiceImpl(this, 2); - registerService(warehouseService1, - "supplychain.warehouse.Warehouse", props1); - - Hashtable props2 = new Hashtable(); - props2.put("component.name", "WarehouseComponent2"); - warehouseService2 = new OSGiWarehouseServiceImpl(this, 1); - registerService(warehouseService2, - "supplychain.warehouse.Warehouse", props2); - } - - protected void started(BundleContext bc) { - warehouseService1.started(bc); - warehouseService2.started(bc); - } - - public void fulfillOrder(String order) { - System.out.println("OSGiWarehouseImpl.fulfillOrder : shipper is " + shipper); - - shipper.processShipment(order + ", fulfilled"); - - } - - -} diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java deleted file mode 100644 index 3317816557..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/OSGiWarehouseServiceImpl.java +++ /dev/null @@ -1,62 +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.warehouse; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; - -import supplychain.shipper.Shipper; - - -/** - * This class implements the Warehouse service. - */ -public class OSGiWarehouseServiceImpl implements Warehouse { - - private OSGiWarehouseImpl warehouseImpl; - private Shipper shipper; - private int shipperNum; - - - OSGiWarehouseServiceImpl(OSGiWarehouseImpl warehouseImpl, int shipperNum) { - this.warehouseImpl = warehouseImpl; - this.shipperNum = shipperNum; - } - - - protected void started(BundleContext bc) { - try { - ServiceReference[] refs = bc.getServiceReferences(Shipper.class.getName(), - "(component.service.name=ShipperComponent" + shipperNum + "/Shipper)"); - if (refs != null && refs.length > 0) { - shipper = (Shipper) bc.getService(refs[0]); - } - } catch (InvalidSyntaxException e) { - } - } - - public void fulfillOrder(String order) { - System.out.println("OSGiWarehouseImpl.fulfillOrder : shipper is " + warehouseImpl.shipper); - - shipper.processShipment(order + ", fulfilled"); - - } - -} diff --git a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/Warehouse.java deleted file mode 100644 index 6f1f6b8730..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/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.warehouse; - -/** - * 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.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java b/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.java deleted file mode 100644 index 6d1ad76796..0000000000 --- a/branches/sca-java-1.0.1/itest/osgi-implementation/src/main/java/supplychain/warehouse/WarehouseQuery.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.warehouse; - -/** - * This is the business interface of the RetailerQuery service. - */ -public interface WarehouseQuery { - - public boolean isAvailable(String order); - -} -- cgit v1.2.3