Skip to content

Commit 5b420e2

Browse files
committed
revised TaskScheduler javadoc (SPR-7253)
1 parent 78c906c commit 5b420e2

File tree

1 file changed

+14
-5
lines changed
  • org.springframework.context/src/main/java/org/springframework/scheduling

1 file changed

+14
-5
lines changed

org.springframework.context/src/main/java/org/springframework/scheduling/TaskScheduler.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,6 +59,7 @@ public interface TaskScheduler {
5959
* or <code>null</code> if the given Trigger object never fires (i.e. returns
6060
* <code>null</code> from {@link Trigger#nextExecutionTime})
6161
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
62+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
6263
* @see org.springframework.scheduling.support.CronTrigger
6364
*/
6465
ScheduledFuture schedule(Runnable task, Trigger trigger);
@@ -69,8 +70,10 @@ public interface TaskScheduler {
6970
* {@link ScheduledFuture} gets cancelled.
7071
* @param task the Runnable to execute whenever the trigger fires
7172
* @param startTime the desired execution time for the task
73+
* (if this is in the past, the task will be executed immediately, i.e. as soon as possible)
7274
* @return a {@link ScheduledFuture} representing pending completion of the task
7375
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
76+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
7477
*/
7578
ScheduledFuture schedule(Runnable task, Date startTime);
7679

@@ -81,9 +84,11 @@ public interface TaskScheduler {
8184
* {@link ScheduledFuture} gets cancelled.
8285
* @param task the Runnable to execute whenever the trigger fires
8386
* @param startTime the desired first execution time for the task
84-
* @param period the interval between successive executions of the task
87+
* (if this is in the past, the task will be executed immediately, i.e. as soon as possible)
88+
* @param period the interval between successive executions of the task (in milliseconds)
8589
* @return a {@link ScheduledFuture} representing pending completion of the task
8690
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
91+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
8792
*/
8893
ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period);
8994

@@ -93,9 +98,10 @@ public interface TaskScheduler {
9398
* <p>Execution will end once the scheduler shuts down or the returned
9499
* {@link ScheduledFuture} gets cancelled.
95100
* @param task the Runnable to execute whenever the trigger fires
96-
* @param period the interval between successive executions of the task
101+
* @param period the interval between successive executions of the task (in milliseconds)
97102
* @return a {@link ScheduledFuture} representing pending completion of the task
98103
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
104+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
99105
*/
100106
ScheduledFuture scheduleAtFixedRate(Runnable task, long period);
101107

@@ -107,10 +113,12 @@ public interface TaskScheduler {
107113
* {@link ScheduledFuture} gets cancelled.
108114
* @param task the Runnable to execute whenever the trigger fires
109115
* @param startTime the desired first execution time for the task
116+
* (if this is in the past, the task will be executed immediately, i.e. as soon as possible)
110117
* @param delay the delay between the completion of one execution and the start
111-
* of the next
118+
* of the next (in milliseconds)
112119
* @return a {@link ScheduledFuture} representing pending completion of the task
113120
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
121+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
114122
*/
115123
ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay);
116124

@@ -121,9 +129,10 @@ public interface TaskScheduler {
121129
* <p>Execution will end once the scheduler shuts down or the returned
122130
* {@link ScheduledFuture} gets cancelled.
123131
* @param task the Runnable to execute whenever the trigger fires
124-
* @param delay the interval between successive executions of the task
132+
* @param delay the interval between successive executions of the task (in milliseconds)
125133
* @return a {@link ScheduledFuture} representing pending completion of the task
126134
* @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted
135+
* for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress)
127136
*/
128137
ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay);
129138

0 commit comments

Comments
 (0)