Newer
Older
CactusServer / src / main / java / framework / schedule / ScheduleManager.java
y-ota on 10 May 2018 745 bytes 初うp
package framework.schedule;

import java.util.Hashtable;

public class ScheduleManager {
	private static ScheduleManager theInstance = null;
	private Hashtable<String, TaskController> taskControllerTable = new Hashtable<String, TaskController>();
	
	private ScheduleManager() {
	}
	
	public static ScheduleManager getInstance() {
		if (theInstance == null) {
			theInstance = new ScheduleManager();
		}
		return theInstance;
	}
	
	public TaskController registerTask(String taskName) {
		TaskController controller = new TaskController();
		taskControllerTable.put(taskName, controller);
		return controller;
	}
	
	public TaskController getController(String taskName) {
		return taskControllerTable.get(taskName);
	}
}