Changeset 539 for DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
- Timestamp:
- 10/31/12 13:52:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
r477 r539 2 2 3 3 4 import java.util.Map;5 4 import java.util.concurrent.ConcurrentHashMap; 6 5 … … 14 13 15 14 16 public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job> */implements JobRegistry, Cloneable{15 public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job>*/ implements JobRegistry, Cloneable{ 17 16 18 17 private static final long serialVersionUID = 8409060063583755824L; 18 19 19 20 private static Log log = LogFactory.getLog(AbstractJobRegistry.class); 21 22 protected static final ConcurrentHashMap<String, Job> jobs = new ConcurrentHashMap<String, Job>(); 20 protected static final ConcurrentHashMap<String, JobInterface<?>> jobs = new ConcurrentHashMap<String, JobInterface<?>>(); 23 21 24 22 protected AbstractJobRegistry(){ 25 //log.warn("Methods from JobRegistry interface are not implemented.");26 23 } 27 24 28 25 public boolean addJob(JobInterface<?> job) { 29 try { 30 jobs.put(job.getId(), (Job) job); 31 } catch (NoSuchFieldException e) { 32 log.error(e.getMessage()); 33 return false; 34 } 26 jobs.put(job.getId(), job); 35 27 return true; 36 28 } … … 38 30 public boolean addTask(TaskInterface<?> task) { 39 31 if(jobs.containsKey(task.getJobId())){ 40 jobs.get(task.getJobId()).add((Task)task);32 getJob(task.getJobId()).add((Task)task); 41 33 return true; 42 34 } else { … … 45 37 } 46 38 47 public Job get(String jobId){39 public JobInterface<?> getJobInfo(String jobId) { 48 40 return jobs.get(jobId); 49 41 } 50 51 public JobInterface<?> getJobInfo(String jobID) {52 return jobs.get(jobID);53 }54 42 55 public TaskInterface<?> getTaskInfo(String jobI D, String taskId) {43 public TaskInterface<?> getTaskInfo(String jobId, String taskId) { 56 44 Task task = null; 57 Job job = jobs.get(jobID);45 Job job = getJob(jobId); 58 46 59 47 if(job == null) … … 63 51 task = job.getTask(taskId); 64 52 } catch (NoSuchFieldException e) { 65 log.error(e.getMessage());66 53 } 67 54 return task; 68 55 } 69 56 70 /*public List<JobInterface<?>> getActiveJobs() { 71 log.error("getActiveJobs() not implemented."); 72 return null; 57 public Job getJob(String jobId){ 58 return (Job)jobs.get(jobId); 73 59 } 74 60 75 public List<TaskInterface<?>> getActiveTasks() {76 log.error("getActiveTasks() not implemented.");77 return null;78 }*/79 80 81 82 83 61 }
Note: See TracChangeset
for help on using the changeset viewer.