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

Comparing jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java (file contents):
Revision 1.29 by jsr166, Mon Aug 15 20:45:30 2005 UTC vs.
Revision 1.30 by jsr166, Wed Aug 24 05:13:11 2005 UTC

# Line 102 | Line 102 | public class ScheduledThreadPoolExecutor
102          private final long period;
103  
104          /**
105 <         * Creates a one-shot action with given nanoTime-based trigger time
105 >         * Creates a one-shot action with given nanoTime-based trigger time.
106           */
107          ScheduledFutureTask(Runnable r, V result, long ns) {
108              super(r, result);
# Line 112 | Line 112 | public class ScheduledThreadPoolExecutor
112          }
113  
114          /**
115 <         * Creates a periodic action with given nano time and period
115 >         * Creates a periodic action with given nano time and period.
116           */
117 <        ScheduledFutureTask(Runnable r, V result, long ns,  long period) {
117 >        ScheduledFutureTask(Runnable r, V result, long ns, long period) {
118              super(r, result);
119              this.time = ns;
120              this.period = period;
# Line 122 | Line 122 | public class ScheduledThreadPoolExecutor
122          }
123  
124          /**
125 <         * Creates a one-shot action with given nanoTime-based trigger
125 >         * Creates a one-shot action with given nanoTime-based trigger.
126           */
127          ScheduledFutureTask(Callable<V> callable, long ns) {
128              super(callable);
# Line 153 | Line 153 | public class ScheduledThreadPoolExecutor
153  
154          /**
155           * Returns true if this is a periodic (not a one-shot) action.
156 +         *
157           * @return true if periodic
158           */
159          public boolean isPeriodic() {
# Line 160 | Line 161 | public class ScheduledThreadPoolExecutor
161          }
162  
163          /**
164 <         * Run a periodic task
164 >         * Runs a periodic task.
165           */
166          private void runPeriodic() {
167              boolean ok = ScheduledFutureTask.super.runAndReset();
# Line 241 | Line 242 | public class ScheduledThreadPoolExecutor
242      }
243  
244      /**
245 <     * Modify or replace the task used to execute a runnable.
245 >     * Modifies or replaces the task used to execute a runnable.
246       * This method can be used to override the concrete
247       * class used for managing internal tasks.
248 <     * The default implementation simply returns the given
248 <     * task.
248 >     * The default implementation simply returns the given task.
249       *
250       * @param runnable the submitted Runnable
251       * @param task the task created to execute the runnable
# Line 258 | Line 258 | public class ScheduledThreadPoolExecutor
258      }
259  
260      /**
261 <     * Modify or replace the task used to execute a callable.
261 >     * Modifies or replaces the task used to execute a callable.
262       * This method can be used to override the concrete
263       * class used for managing internal tasks.
264 <     * The default implementation simply returns the given
265 <     * task.
264 >     * The default implementation simply returns the given task.
265       *
266       * @param callable the submitted Callable
267       * @param task the task created to execute the callable
# Line 279 | Line 278 | public class ScheduledThreadPoolExecutor
278       * pool size.
279       *
280       * @param corePoolSize the number of threads to keep in the pool,
281 <     * even if they are idle.
281 >     * even if they are idle
282       * @throws IllegalArgumentException if <tt>corePoolSize &lt;= 0</tt>
283       */
284      public ScheduledThreadPoolExecutor(int corePoolSize) {
# Line 292 | Line 291 | public class ScheduledThreadPoolExecutor
291       * initial parameters.
292       *
293       * @param corePoolSize the number of threads to keep in the pool,
294 <     * even if they are idle.
294 >     * even if they are idle
295       * @param threadFactory the factory to use when the executor
296 <     * creates a new thread.
296 >     * creates a new thread
297       * @throws IllegalArgumentException if <tt>corePoolSize &lt;= 0</tt>
298       * @throws NullPointerException if threadFactory is null
299       */
# Line 309 | Line 308 | public class ScheduledThreadPoolExecutor
308       * initial parameters.
309       *
310       * @param corePoolSize the number of threads to keep in the pool,
311 <     * even if they are idle.
311 >     * even if they are idle
312       * @param handler the handler to use when execution is blocked
313 <     * because the thread bounds and queue capacities are reached.
313 >     * because the thread bounds and queue capacities are reached
314       * @throws IllegalArgumentException if <tt>corePoolSize &lt;= 0</tt>
315       * @throws NullPointerException if handler is null
316       */
# Line 326 | Line 325 | public class ScheduledThreadPoolExecutor
325       * initial parameters.
326       *
327       * @param corePoolSize the number of threads to keep in the pool,
328 <     * even if they are idle.
328 >     * even if they are idle
329       * @param threadFactory the factory to use when the executor
330 <     * creates a new thread.
330 >     * creates a new thread
331       * @param handler the handler to use when execution is blocked
332       * because the thread bounds and queue capacities are reached.
333       * @throws IllegalArgumentException if <tt>corePoolSize &lt;= 0</tt>
# Line 446 | Line 445 | public class ScheduledThreadPoolExecutor
445       * <tt>shutdownNow</tt>, or after setting the policy to
446       * <tt>false</tt> when already shutdown. This value is by default
447       * false.
448 +     *
449       * @param value if true, continue after shutdown, else don't.
450       * @see #getContinueExistingPeriodicTasksAfterShutdownPolicy
451       */
# Line 462 | Line 462 | public class ScheduledThreadPoolExecutor
462       * terminate upon <tt>shutdownNow</tt> or after setting the policy
463       * to <tt>false</tt> when already shutdown. This value is by
464       * default false.
465 <     * @return true if will continue after shutdown.
465 >     *
466 >     * @return true if will continue after shutdown
467       * @see #setContinueExistingPeriodicTasksAfterShutdownPolicy
468       */
469      public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy() {
# Line 476 | Line 477 | public class ScheduledThreadPoolExecutor
477       * <tt>shutdownNow</tt>, or after setting the policy to
478       * <tt>false</tt> when already shutdown. This value is by default
479       * true.
480 +     *
481       * @param value if true, execute after shutdown, else don't.
482       * @see #getExecuteExistingDelayedTasksAfterShutdownPolicy
483       */
# Line 492 | Line 494 | public class ScheduledThreadPoolExecutor
494       * <tt>shutdownNow</tt>, or after setting the policy to
495       * <tt>false</tt> when already shutdown. This value is by default
496       * true.
497 <     * @return true if will execute after shutdown.
497 >     *
498 >     * @return true if will execute after shutdown
499       * @see #setExecuteExistingDelayedTasksAfterShutdownPolicy
500       */
501      public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy() {
# Line 517 | Line 520 | public class ScheduledThreadPoolExecutor
520  
521      /**
522       * Attempts to stop all actively executing tasks, halts the
523 <     * processing of waiting tasks, and returns a list of the tasks that were
524 <     * awaiting execution.
523 >     * processing of waiting tasks, and returns a list of the tasks
524 >     * that were awaiting execution.
525       *
526       * <p>There are no guarantees beyond best-effort attempts to stop
527       * processing actively executing tasks.  This implementation
# Line 572 | Line 575 | public class ScheduledThreadPoolExecutor
575          public boolean offer(Runnable x) {
576              return dq.offer((RunnableScheduledFuture)x);
577          }
578 <        public void put(Runnable x)  {
578 >        public void put(Runnable x) {
579              dq.put((RunnableScheduledFuture)x);
580          }
581          public boolean offer(Runnable x, long timeout, TimeUnit unit) {
# Line 599 | Line 602 | public class ScheduledThreadPoolExecutor
602                  private Iterator<RunnableScheduledFuture> it = dq.iterator();
603                  public boolean hasNext() { return it.hasNext(); }
604                  public Runnable next() { return it.next(); }
605 <                public void remove() {  it.remove(); }
605 >                public void remove() { it.remove(); }
606              };
607          }
608      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines