package market.thread.mesRcdWgt;

import market.Mes.Rolling.Performance.service.MesRcmWgtService;

import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

class MesRcdWgtServletThread extends Thread implements Runnable {
	private static int runCopies = 0;
	WebApplicationContext _context;
	private MesRcmWgtService _service1;	  
	
	MesRcdWgtServletThread() {
		if (++runCopies == 1)
		{
			_context = ContextLoader
					.getCurrentWebApplicationContext();
			_service1 = (MesRcmWgtService) _context
					.getBean("MesRcmWgtService"); 
		}
	}

	public void run() {
		while (!MesRcdWgtServletMgt.getShouldStop()) {
			try {
				//_service1.doUpdateMesRcmDWgt();
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				try {
					Thread.sleep(5*1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
