public void start() {
Executors.newSingleThreadExecutor().execute(new Runnable() {
public void run() {
while (true) {
switch (type) {
case COMMON:
commonService();
break;
case EXPRESS:
expressService();
break;
case VIP:
vipService();
break;
}
}
}
});
}
public void commonService() {
String windowName = "第" + windowId + "号" + type + "窗口";
Integer number = NumberMachine.getInstance().getCommonManage()
.fetchServiceNumber();
System.out.println(windowName + "开始获取服务任务");
if (number != null) {
System.out.println(windowName + "为第" + number + "个" + "普通"
+ "客户服务");
long beginTime = System.currentTimeMillis();
int maxRand = Constants.MAX_SERVICE_TIME
- Constants.MIN_SERVICE_TIME;