From ba7e2b2cbc0277a5cb79f5960400f37adcc97198 Mon Sep 17 00:00:00 2001 From: nash Date: Sat, 8 May 2010 10:51:58 +0000 Subject: Make outstandingOrders list synchronized (TUSCANY-3550) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@942356 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/supplychain/customer/JavaCustomerComponentImpl.java | 4 +++- .../src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java | 4 +++- .../src/main/java/supplychain/customer/OSGiCustomerImpl.java | 4 +++- .../java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java | 4 +++- .../src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java | 4 +++- .../src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java index 80346311b1..28353267aa 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java @@ -19,6 +19,8 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import org.osoa.sca.annotations.Reference; import org.osoa.sca.annotations.Scope; @@ -39,7 +41,7 @@ public class JavaCustomerComponentImpl implements Customer { private Retailer retailer3; - private static ArrayList outstandingOrders = new ArrayList(); + private static List outstandingOrders = Collections.synchronizedList(new ArrayList()); @Reference public void setRetailer1(Retailer retailer1) { diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java index a879505610..c273f7b174 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerComponentImpl.java @@ -20,6 +20,8 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import org.osgi.service.component.ComponentContext; @@ -36,7 +38,7 @@ public class OSGiCustomerComponentImpl implements Customer { private Retailer retailer2; private Retailer retailer3; - private static ArrayList outstandingOrders = new ArrayList(); + private static List outstandingOrders = Collections.synchronizedList(new ArrayList()); public OSGiCustomerComponentImpl() { System.out.println("Created OSGiCustomerComponentImpl " + this); diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java index 546971860e..6d9b03a94d 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerImpl.java @@ -20,6 +20,8 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import org.osoa.sca.annotations.AllowsPassByReference; @@ -32,7 +34,7 @@ import supplychain.retailer.Retailer; @AllowsPassByReference public class OSGiCustomerImpl extends OSGiBundleImpl implements Customer { - private ArrayList outstandingOrders = new ArrayList(); + private List outstandingOrders = Collections.synchronizedList(new ArrayList()); private Retailer retailer1; private Retailer retailer2; diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java index 593e55f3f5..606f6b9684 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryComponentImpl.java @@ -20,6 +20,8 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import org.osgi.service.component.ComponentContext; @@ -36,7 +38,7 @@ public class OSGiCustomerWithQueryComponentImpl implements Customer { private Retailer retailer; private RetailerQuery retailerQuery; - private static ArrayList outstandingOrders = new ArrayList(); + private static List outstandingOrders = Collections.synchronizedList(new ArrayList()); public OSGiCustomerWithQueryComponentImpl() { System.out.println("Created OSGiCustomerWithQueryComponentImpl " + this); diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java index 18483817ad..ef9dc8c16a 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiCustomerWithQueryImpl.java @@ -20,6 +20,8 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import supplychain.OSGiBundleImpl; import supplychain.retailer.Retailer; @@ -30,7 +32,7 @@ import supplychain.retailer.RetailerQuery; */ public class OSGiCustomerWithQueryImpl extends OSGiBundleImpl implements Customer { - private static ArrayList outstandingOrders = new ArrayList(); + private static List outstandingOrders = Collections.synchronizedList(new ArrayList()); private Retailer retailer; private RetailerQuery retailerQuery; diff --git a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java index 599ab51a50..ebb9bc56ef 100644 --- a/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java +++ b/sca-java-1.x/trunk/itest/osgi-implementation/src/main/java/supplychain/customer/OSGiVersionedCustomerImpl.java @@ -20,7 +20,9 @@ package supplychain.customer; import java.util.ArrayList; +import java.util.Collections; import java.util.Hashtable; +import java.util.List; import org.osgi.framework.BundleContext; @@ -32,7 +34,7 @@ import supplychain.retailer.Retailer; */ public class OSGiVersionedCustomerImpl extends OSGiBundleImpl implements Customer { - private static ArrayList outstandingOrders = new ArrayList(); + private static List outstandingOrders = Collections.synchronizedList(new ArrayList()); private Retailer retailer1; private Retailer retailer2; -- cgit v1.2.3