Make outstandingOrders list synchronized (TUSCANY-3550)

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@942356 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nash 2010-05-08 10:51:58 +00:00
parent 36e4e5cbb7
commit ba7e2b2cbc
6 changed files with 18 additions and 6 deletions

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private static List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
@Reference
public void setRetailer1(Retailer retailer1) {

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private static List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
public OSGiCustomerComponentImpl() {
System.out.println("Created OSGiCustomerComponentImpl " + this);

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
private Retailer retailer1;
private Retailer retailer2;

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private static List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
public OSGiCustomerWithQueryComponentImpl() {
System.out.println("Created OSGiCustomerWithQueryComponentImpl " + this);

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private static List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
private Retailer retailer;
private RetailerQuery retailerQuery;

View file

@ -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<String> outstandingOrders = new ArrayList<String>();
private static List<String> outstandingOrders = Collections.synchronizedList(new ArrayList<String>());
private Retailer retailer1;
private Retailer retailer2;