Created
February 2, 2012 14:30
-
-
Save sherman/1723719 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resultCheckerExecutor.execute( | |
new Runnable() { | |
@Override | |
public void run() { | |
while (true) { | |
try { | |
Task saved = taskDao.getById(task.getId()); | |
assertNotNull(saved); | |
if (saved.getState().equals(TaskState.ERROR)) { | |
assertNull(saved.getFinished()); | |
assertNotNull(saved.getStarted()); | |
resultSemaphore.release(); | |
break; | |
} | |
try { | |
Thread.sleep(PAUSE_TIME); | |
} catch (InterruptedException e) {} | |
} catch (Exception e) { | |
log.error("Error in result checker", e); | |
} | |
} | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment