@Test public void testConcurrentGraphModification() throws Exception { String jobName = "Test-Concurrent-Graph-Modification"; this.tg = new TaskGraph(); for (int i = 0; i < 200; i++) { this.tg.addTask(new EmptyTask("Task " + i)); } this.tg.addTask(new BaseTask("Reader task") { @Override public void execute() throws Exception { Set<TaskNode> predecessors =JobEngineTest.this.tg.getGraph().getPredecessors(JobEngineTest.this.tg.getEndTaskNode()); System.out.println(getName() + " : I have a task with " + predecessors.size() + " nodes"); } @Override public Set<LockObjectReference> getObjects() { return emptySet(); }}); this.tg.addTask(new BaseTask("Appender task") { @Override public void execute() throws Exception { JobEngineTest.this.tg.appendTask(new EmptyTask("A dummy task just to be appended")); } @Override public Set<LockObjectReference> getObjects() { return emptySet(); }}); this.job = this.je.submit(jobName, this.tg, new JobCompletionListener() { @Override public void completed(Job job) { System.out.println(job.getName() +" : " + job.getStatus()); } }, false); this.job.waitForCompletion(); Assert.assertNotNull(this.job); Assert.assertEquals(JobStatus.PASSED, this.job.getStatus().getStatus()); }
public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent) throws Exception { return initJob(name, taskGraph, null, listener, null, persistent); }
JobEngine { public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent) throws Exception { return initJob(name, taskGraph, null, listener, null, persistent); } }
JobEngine { public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent) throws Exception { return initJob(name, taskGraph, null, listener, null, persistent); } private  JobEngine(); }
JobEngine { public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent) throws Exception { return initJob(name, taskGraph, null, listener, null, persistent); } private  JobEngine(); synchronized void init(int jobThreadPoolSize, int taskThreadPoolSize); static synchronized JobEngine getEngine(); void shutdown(); void logStatus(); Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent); Job submit(String name, TaskGraph taskGraph, JobCompletionListener jobListener,
            TaskChangeListener taskListener, boolean persistent); Job submit(String name, TaskGraph taskGraph, boolean persistent); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects, JobCompletionListener listener); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects,
            JobCompletionListener jobListener, TaskChangeListener taskListener); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects,
            JobCompletionListener jobCompletionListener, TaskChangeListener taskChangeListener, boolean persistent); boolean isActive(); static void setJobThreadPoolSize(String value); static void setTaskThreadPoolSize(String value); synchronized void abortJob(Long jobId, String reason); void addJobCompletionListener(JobCompletionListener listener); void removeJobCompletionListener(JobCompletionListener listener); synchronized Job getJobByTask(Task task); }
JobEngine { public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent) throws Exception { return initJob(name, taskGraph, null, listener, null, persistent); } private  JobEngine(); synchronized void init(int jobThreadPoolSize, int taskThreadPoolSize); static synchronized JobEngine getEngine(); void shutdown(); void logStatus(); Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent); Job submit(String name, TaskGraph taskGraph, JobCompletionListener jobListener,
            TaskChangeListener taskListener, boolean persistent); Job submit(String name, TaskGraph taskGraph, boolean persistent); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects, JobCompletionListener listener); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects,
            JobCompletionListener jobListener, TaskChangeListener taskListener); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects); Job submit(String name, TaskGraph taskGraph, Set<LockObjectReference> objects,
            JobCompletionListener jobCompletionListener, TaskChangeListener taskChangeListener, boolean persistent); boolean isActive(); static void setJobThreadPoolSize(String value); static void setTaskThreadPoolSize(String value); synchronized void abortJob(Long jobId, String reason); void addJobCompletionListener(JobCompletionListener listener); void removeJobCompletionListener(JobCompletionListener listener); synchronized Job getJobByTask(Task task); static final int DEFAULT_JOB_THREAD_POOL_SIZE; static final int DEFAULT_TASK_THREAD_POOL_SIZE; }