ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ScheduledExecutorService.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ScheduledExecutorService.java (file contents):
Revision 1.3 by dl, Fri Dec 19 14:42:25 2003 UTC vs.
Revision 1.4 by dl, Sun Dec 21 14:55:52 2003 UTC

# Line 16 | Line 16 | import java.util.*;
16   * and return a task object that can be used to cancel or check
17   * execution. The <tt>scheduleAtFixedRate</tt> and
18   * <tt>scheduleWithFixedDelay</tt> methods create and execute tasks
19 < * that run periodically until cancelled.  Commands submitted using
20 < * the <tt>execute</tt> method are scheduled with a requested delay of
21 < * zero.
19 > * that run periodically until cancelled.  
20 > *
21 > * <p> Commands submitted using the {@link Executor#execute} and
22 > * {@link ExecutorService} <tt>submit</tt> methods are scheduled with
23 > * a requested delay of zero. Zero and negative delays (but not
24 > * periods) are also allowed in <tt>schedule</tt> methods, and are
25 > * treated as requests for immediate execution.
26   *
27   * <p>All <t>schedule</tt> methods accept <em>relative</em> delays and
28   * periods as arguments, not absolute times or dates. It is a simple
# Line 29 | Line 33 | import java.util.*;
33   * TimeUnit.MILLISECONDS)</tt>. Beware however that expiration of a
34   * relative delay need not coincide with the current <tt>Date</tt> at
35   * which the task is enabled due to network time synchronization
36 < * protocols, clock drift, or other factors. Negative relative delays
33 < * (but not periods) are allowed in <tt>schedule</tt> methods, and are
34 < * treated as requests for immediate execution.
36 > * protocols, clock drift, or other factors.
37   *
38   * @since 1.5
39   * @author Doug Lea
# Line 76 | Line 78 | public interface ScheduledExecutorServic
78       * @param command the task to execute.
79       * @param initialDelay the time to delay first execution.
80       * @param period the period between successive executions.
81 <     * @param unit the time unit of the delay and period parameters
81 >     * @param unit the time unit of the initialDelay and period parameters
82       * @return a Future representing pending completion of the task,
83       * and whose <tt>get()</tt> method will throw an exception upon
84       * cancellation.
# Line 97 | Line 99 | public interface ScheduledExecutorServic
99       * @param initialDelay the time to delay first execution.
100       * @param delay the delay between the termination of one
101       * execution and the commencement of the next.
102 <     * @param unit the time unit of the delay and delay parameters
102 >     * @param unit the time unit of the initialDelay and delay parameters
103       * @return a Future representing pending completion of the task,
104       * and whose <tt>get()</tt> method will throw an exception upon
105       * cancellation.
# Line 108 | Line 110 | public interface ScheduledExecutorServic
110       */
111      public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay,  long delay, TimeUnit unit);
112  
111    /**
112     * Execute command with zero required delay. This has effect
113     * equivalent to <tt>schedule(command, 0, anyUnit)</tt>.  
114     * @param command the task to execute
115     * @throws RejectedExecutionException if this task cannot be
116     * accepted for execution.
117     * @throws NullPointerException if command is null
118     */
119    public void execute(Runnable command);
113   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines