* Copyright (C) 2012 The Guava Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
that never executes anything.
shutdownNow method of the returned executor always returns an empty list despite
the fact that everything is still technically awaiting execution.
getDelay method of any
returned by the executor will always
return the max long value instead of the time until the user-specified delay.
execute/submit/schedule, as in
. This applies both to individually submitted tasks and to collections of tasks submitted via
scheduleWithFixedDelay. In the case of tasks submitted by
invokeAny, tasks will run serially on the calling thread. Tasks are run to completion before a
Futureis returned to the caller (unless the executor has been shutdown).
The returned executor is backed by the executor returned by
and subject to the same
Although all tasks are immediately executed in the thread that
submitted the task, this
ExecutorService imposes a small
locking overhead on each task submission in order to implement shutdown
and termination behavior.
Because of the nature of single-thread execution, the methods
scheduleWithFixedDelay are not
supported by this class and will throw an UnsupportedOperationException.
The implementation deviates from the
specification with regards to the
shutdownNow method. First,
"best-effort" with regards to canceling running tasks is implemented
as "no-effort". No interrupts or other attempts are made to stop
threads executing tasks. Second, the returned list will always be empty,
as any submitted task is considered to have started execution.
This applies also to tasks given to
which are pending serial execution, even the subset of the tasks that
have not yet started execution. It is unclear from the
ExecutorService specification if these should be included, and
it's much easier to implement the interpretation that they not be.
Finally, a call to
shutdownNow may result
in concurrent calls to
RejectedExecutionException, although a subset of the tasks may already
have been executed.