package kr.ac.kaist.swrc.jhannanum.module;

import java.io.IOException;

public class ModuleThread extends Thread{
	private Module m = null;
	
	public ModuleThread(Module m) {
		this.m = m;
	}
	
	public void run() {
		try {
//			System.err.println("Module Thread '" + m.getName() + "' is started.");
			m.run();
			this.join();
		} catch (InterruptedException e) {
		} catch (IOException e) {
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
//			System.err.println("Module Thread '" + m.getName() + "' is closed.");
			m.shutdown();
		}
	}
}
