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