package cn.amq.traffic;

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

import cn.amq.peas.TrafficEventAlarmPeas;

public class TrafficAlarmStateDataService {

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

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

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