예제 #1
0
  private void execute(final EtlContext ctx) {
    final ProgressCallback oldProgress = ctx.getProgressCallback();

    final ProgressCallback p = oldProgress.fork(85, 100);
    final ProgressCallback p2 = p.fork(100);
    ctx.setProgressCallback(p2);
    ctx.session.execute(ctx);
    p.complete();
    ctx.setProgressCallback(oldProgress);
  }
예제 #2
0
  /**
   * Prepares the scripts context.
   *
   * @param indicator progress indicator to use.
   * @return prepared scripts context.
   */
  protected EtlContext prepare(final ProgressIndicator indicator) {
    EtlContext ctx = new EtlContext(!suppressStatistics);
    ctx.getStatisticsBuilder().etlStarted();
    ctx.setBaseURL(configuration.getDocumentUrl());
    ctx.setProgressCallback(new ProgressCallback(100, indicator));

    final ProgressCallback progress = ctx.getProgressCallback();
    progress.step(1, "Initializing properties");
    ctx.setProperties(configuration.getParameters());
    ctx.setProgressCallback(progress.fork(9, 100));
    ctx.session = new Session(configuration, ctx);
    ctx.getProgressCallback().complete();
    ctx.setProgressCallback(progress); // Restoring

    return ctx;
  }