package market.thread.slmContract;

import market.Slm.OrderManagement.service.IfSlmContractInfoService;

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

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

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