Beispiel #1
0
  @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);
  }
Beispiel #2
0
  @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);
  }
Beispiel #3
0
 @Override
 public boolean hasScript(final ResourceKey script) {
   final ResourceService service =
       this.executorManager.getExecutor(script.getApplicationKey()).getResourceService();
   return service.getResource(script).exists();
 }