public static void main(String[] args) {
		boolean flag = false; //ʶ״̬

		//ȡ̵߳״̬
		LocalServiceBean localService = OnceClass.getOnce().getLocalServiceInfo();
		if(localService.getServiceState().equals("running")){
			//ʼ߳״̬
			flag = true;
		}else if(localService.getServiceState().equals("shutdown")){
			flag = false;
		}
		//ֱʵreceiveMmailThreadsendMailThreadʵ̶߳mail
		if(flag){
			//ʼ
			ReceiveMailService rms = new ReceiveMailService();
			Thread rmsTh = new Thread(rms);
			rmsTh.start();
			//ʼ
			SendMailService sms = new SendMailService();
			Thread smsTh = new Thread(sms);
			smsTh.start();
		}else{
			Util.saveLog("߳ɹSMTPPOPرաԱ¼ʱ:"+Util.getNowTime());
		}
		//ؽ̣ʱ̼ûϢϢ
		MonitorThread moni = new MonitorThread();
		Thread moniTh = new Thread(moni);
		moniTh.start();
		
		System.out.println("ʼɹʱ:"+Util.getNowTime());
		//ѭɨ
		OnceClass once = OnceClass.getOnce();
//		while(true){
//			//sleep();ѹ
//			if(once.getServerSocketMap().size() != 0){
//				if(stmpFlag){
//					try {
//						once.getServerSocketMap().get("sendMailServerSocket").close();
//						//ʼ
//						SendMailService sms = new SendMailService();
//						Thread smsTh = new Thread(sms);
//						smsTh.start();
//						
//						stmpFlag = false;
//					} catch (IOException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					}
//				}
//				if(pop3Flag){
//					try {
//						once.getServerSocketMap().get("receiveMailServerSocket").close();
//						//ʼ
//						ReceiveMailService rms = new ReceiveMailService();
//						Thread rmsTh = new Thread(rms);
//						rmsTh.start();
//						
//						pop3Flag = false;
//					} catch (IOException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					}
//				}
//			}
//		}
	}