/** * installs a Verb in a given container * @param engineId ID of the engine which provides the Verb (e.g. "Wine") * @param container name of the container * @param verbId ID of the Verb * @param doneCallback callback executed after the script ran * @param errorCallback callback executed in case of an error */ public void installVerb(String engineId, String container, String verbId, Runnable doneCallback, Consumer<Exception> errorCallback) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval( "include([\"engines\", \"" + engineId + "\", \"verbs\", \"" + verbId + "\"]);", ignored -> interactiveScriptSession.eval("new Verb()", output -> { final Verb verbObject = (Verb) output; verbObject.install(container); doneCallback.run(); }, errorCallback), errorCallback); }