package cn.amq.traffic;

import java.util.ArrayList;
import java.util.List;

import cn.amq.peas.TrafficEventAlarmPeas;

public class TrafficEventAlarmStateDataService {

	Object mutex = new Object();
	
	private List<TrafficEventAlarmPeas> trafficEventAlarmStateDataList = new ArrayList();

	public List<TrafficEventAlarmPeas> getTrafficEventAlarmStateList() {
		synchronized (mutex) {
			List<TrafficEventAlarmPeas> tempList = new ArrayList();
			tempList = trafficEventAlarmStateDataList;
			trafficEventAlarmStateDataList = new ArrayList();
			return tempList;
		}
	}

	public void setTrafficEventAlarmStateListAdd(List<TrafficEventAlarmPeas> ls) {
		synchronized (mutex) {
			if (trafficEventAlarmStateDataList != null) {
				trafficEventAlarmStateDataList.addAll(ls);
			}
		}
	}
}
