Created
September 28, 2016 05:02
-
-
Save jongyoul/e291a81192cfe8f4f5e519e3b06ff0a4 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Run a single paragraph. | |
* | |
* @param paragraphId ID of paragraph | |
*/ | |
public void run(String paragraphId) { | |
Paragraph p = getParagraph(paragraphId); | |
p.setListener(jobListenerFactory.getParagraphJobListener(this)); | |
String requiredReplName = p.getRequiredReplName(); | |
Interpreter intp = factory.getInterpreter(getId(), requiredReplName); | |
if (intp == null) { | |
String intpExceptionMsg = | |
p.getJobName() + "'s Interpreter " + requiredReplName + " not found"; | |
InterpreterException intpException = new InterpreterException(intpExceptionMsg); | |
InterpreterResult intpResult = | |
new InterpreterResult(InterpreterResult.Code.ERROR, intpException.getMessage()); | |
p.setReturn(intpResult, intpException); | |
p.setStatus(Job.Status.ERROR); | |
throw intpException; | |
} | |
if (p.getConfig().get("enabled") == null || (Boolean) p.getConfig().get("enabled")) { | |
intp.getScheduler().submit(p); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment