Newer
Older
CactusServer / src / main / java / framework / schedule / ScheduleManager.java
y-ota on 10 May 2018 745 bytes 初うp
  1. package framework.schedule;
  2.  
  3. import java.util.Hashtable;
  4.  
  5. public class ScheduleManager {
  6. private static ScheduleManager theInstance = null;
  7. private Hashtable<String, TaskController> taskControllerTable = new Hashtable<String, TaskController>();
  8. private ScheduleManager() {
  9. }
  10. public static ScheduleManager getInstance() {
  11. if (theInstance == null) {
  12. theInstance = new ScheduleManager();
  13. }
  14. return theInstance;
  15. }
  16. public TaskController registerTask(String taskName) {
  17. TaskController controller = new TaskController();
  18. taskControllerTable.put(taskName, controller);
  19. return controller;
  20. }
  21. public TaskController getController(String taskName) {
  22. return taskControllerTable.get(taskName);
  23. }
  24. }