コード例 #1
0
ファイル: Job.java プロジェクト: GayashanNA/andes
  public void notCompleted() {
    final ExecutorService pool = _poolReference.getPool();

    if (pool == null) {
      return;
    }

    try {
      pool.execute(this);
    } catch (RejectedExecutionException e) {
      _logger.warn("Thread pool shutdown while tasks still outstanding");
    }
  }
コード例 #2
0
ファイル: Job.java プロジェクト: GayashanNA/andes
  /**
   * Implements a terminal continuation for the {@link Job} for this filter. Whenever the Job
   * completes its processing of a batch of events this is called. This method simply re-activates
   * the job, if it has more events to process.
   *
   * @param session The Mina session to work in.
   * @param job The job that completed.
   */
  public void completed() {
    if (!isComplete()) {
      final ExecutorService pool = _poolReference.getPool();

      if (pool == null) {
        return;
      }

      // ritchiem : 2006-12-13 Do we need to perform the additional checks here?
      // Can the pool be shutdown at this point?
      if (activate()) {
        try {
          pool.execute(this);
        } catch (RejectedExecutionException e) {
          _logger.warn("Thread pool shutdown while tasks still outstanding");
        }
      }
    }
  }