Exemplo n.º 1
0
  public Variable execute(List ops) {
    this.setStatus(STATUS_RUNNING);

    // inform al listeners that execution is just about to start
    Iterator listenersIterator = this.scraperRuntimeListeners.iterator();
    while (listenersIterator.hasNext()) {
      ScraperRuntimeListener listener = (ScraperRuntimeListener) listenersIterator.next();
      listener.onExecutionStart(this);
    }

    Iterator it = ops.iterator();
    while (it.hasNext()) {
      IElementDef elementDef = (IElementDef) it.next();
      BaseProcessor processor =
          ProcessorResolver.createProcessor(elementDef, this.configuration, this);

      if (processor != null) {
        processor.run(this, context);
      }
    }

    return new NodeVariable("");
  }