public List<IDEAJob> getJobs(long sessId, String jobsMD) throws FileNotFoundException, IOException, ClassNotFoundException { if (runningBatch != null && runningBatch.getSessId() == sessId) { return runningBatch.getJobs(); } for (Iterator<IDEABatch> it = batches.iterator(); it.hasNext(); ) { IDEABatch batch = it.next(); if (batch.getSessId() == sessId) return batch.getJobs(); } ObjectInputStream ois = new ObjectInputStream(new FileInputStream(jobsMD)); IDEABatchFile batch = (IDEABatchFile) ois.readObject(); List<IDEAJob> result = batch.jobList; ois.close(); return result; }
public void restartJobs(AnalysisInfo info) { long sessId = info.getIdeaSessionId(); if (runningBatch != null && runningBatch.getSessId() == sessId) { return; } for (Iterator<IDEABatch> it = batches.iterator(); it.hasNext(); ) { IDEABatch batch = it.next(); if (batch.getSessId() == sessId) { return; } } IDEABatch batch = new IDEABatch(); batch.setMethod(ExecutionMethod.Parallel); batch.setSessId(info.getIdeaSessionId()); batch.setBatchHome(info.getAnalysisLocation()); batch.setJobs(info.getJobs()); addBatch(batch); }