final public Task schedule(long msec){
  if (stop) {
    onStop(fast);
  }
 else {
    if (executor == null)     return this;
synchronized (lock) {
      if (runningQueue.contains(this)) {
        if (log.isDebugEnabled())         log.warn("the task is running, ignored: " + getName());
        return this;
      }
      if (pendingQueue.contains(this)) {
        if (sf != null) {
          sf.cancel(false);
        }
        log.warn("reschedule the task:" + getName());
      }
      t.set(System.currentTimeMillis() + msec);
      sf=executor.schedule(this,msec,TimeUnit.MILLISECONDS);
      pendingQueue.add(this);
    }
  }
  return this;
}

final public Task schedule ( long msec ) { if ( stop ) { onStop ( fast ) ; } else { if ( executor == null ) return this ; synchronized ( lock ) { if ( runningQueue . contains ( this ) ) { if ( log . isDebugEnabled ( ) ) log . warn ( "the task is running, ignored: " + getName ( ) ) ; return this ; } if ( pendingQueue . contains ( this ) ) { if ( sf != null ) { sf . cancel ( false ) ; } log . warn ( "reschedule the task:" + getName ( ) ) ; } t . set ( System . currentTimeMillis ( ) + msec ) ; sf = executor . schedule ( this , msec , TimeUnit . MILLISECONDS ) ; pendingQueue . add ( this ) ; } } return this ; }
schedule the worker task .
