@Override public ScriptExports execute(final ResourceKey script) { final ScriptExecutor executor = this.executorManager.getExecutor(script.getApplicationKey()); final Object exports = executor.executeMain(script); final ScriptValue value = executor.newScriptValue(exports); return new ScriptExportsImpl(script, value, exports); }
@Override public Resource getResource(final ResourceKey resourceKey) { URL resourceUrl = null; final Application application = getActiveApplication(resourceKey.getApplicationKey()); if (application != null) { String resourcePath = resourceKey.getPath(); resourceUrl = application.getBundle().getResource(resourcePath); } return new UrlResource(resourceKey, resourceUrl); }
@Override public boolean hasScript(final ResourceKey script) { final ResourceService service = this.executorManager.getExecutor(script.getApplicationKey()).getResourceService(); return service.getResource(script).exists(); }