Interface SimpleScheduledExecutor
- All Known Implementing Classes:
DelegatingSimpleScheduledExecutor
@Incubating
public interface SimpleScheduledExecutor
-
Method Details
-
submit
- Parameters:
task- the task to submit- Returns:
- a
Futurerepresenting pending completion of the task - Throws:
RejectedExecutionException- if the task cannot be scheduled for execution
-
schedule
Submits a task that becomes enabled after the given delay.- Parameters:
command- the task to executedelay- the time from now to delay executionunit- the time unit of the delay parameter- Returns:
- a
ScheduledFuturerepresenting pending completion of the submitted task. - Throws:
RejectedExecutionException- if the task cannot be scheduled for execution
-
offer
Makes an attempt to submit ataskfor execution. If the attempt is successful - returns aFuturerepresenting that task. Otherwise, in case submitting a task would result in blocking - task is not submitted and anexceptionis thrown.- Parameters:
task- the task to submit- Returns:
- a
Futurerepresenting pending completion of the task - Throws:
RejectedExecutionException- if the task cannot be scheduled for execution, or doing so would result in blocking the tread.
-
shutdownNow
void shutdownNow()Attempts to stop all actively executing tasks, halts the processing of waiting tasks. -
isBlocking
boolean isBlocking()- Returns:
trueif this executor may block when a task is submitted to it;falseif it never block (e.g. throws anRejectedExecutionException).
-