use of org.openksavi.sponge.engine.interactive.InteractiveModeConsole in project sponge by softelnet.
the class DefaultInteractiveMode method loop.
@Override
public void loop() {
running.set(true);
try (InteractiveModeConsole console = consoleSupplier.get()) {
activeConsole = console;
if (!console.isOpen()) {
console.open();
}
ScriptKnowledgeBaseInterpreter scriptInterpreter = getScriptKnowledgeBaseInterpreter();
console.print(getWelcomeMessage());
while (true) {
try {
if (!iteration(console, scriptInterpreter)) {
break;
}
} catch (Throwable e) {
handleException("interactive", e);
}
}
} finally {
running.set(false);
}
}
Aggregations