|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ros.concurrent.DefaultScheduledExecutorService
public class DefaultScheduledExecutorService
This wraps a Executors.newCachedThreadPool()
and a
Executors.newScheduledThreadPool(int)
to provide the functionality of
both in a single ScheduledExecutorService
. This is necessary since
the ScheduledExecutorService
uses an unbounded queue which makes it
impossible to create an unlimited number of threads on demand (as explained
in the ThreadPoolExecutor
class javadoc.
Constructor Summary | |
---|---|
DefaultScheduledExecutorService()
|
|
DefaultScheduledExecutorService(java.util.concurrent.ExecutorService executorService)
This instance will take over the lifecycle of the services. |
|
DefaultScheduledExecutorService(java.util.concurrent.ExecutorService executorService,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
This instance will take over the lifecycle of the services. |
Method Summary | ||
---|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
First calls awaitTermination(long, TimeUnit) on the wrapped
ExecutorService and then awaitTermination(long, TimeUnit)
on the wrapped ScheduledExecutorService . |
|
void |
execute(java.lang.Runnable command)
|
|
|
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
|
|
|
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
|
|
|
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
|
|
|
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
|
|
boolean |
isShutdown()
|
|
boolean |
isTerminated()
|
|
|
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit)
|
|
java.util.concurrent.ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit)
|
|
java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
|
|
java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit)
|
|
void |
shutdown()
|
|
java.util.List<java.lang.Runnable> |
shutdownNow()
|
|
|
submit(java.util.concurrent.Callable<T> task)
|
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task)
|
|
|
submit(java.lang.Runnable task,
T result)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultScheduledExecutorService()
public DefaultScheduledExecutorService(java.util.concurrent.ExecutorService executorService)
executorService
- public DefaultScheduledExecutorService(java.util.concurrent.ExecutorService executorService, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
executorService
- scheduledExecutorService
- Method Detail |
---|
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination(long, TimeUnit)
on the wrapped
ExecutorService
and then awaitTermination(long, TimeUnit)
on the wrapped ScheduledExecutorService
.
awaitTermination
in interface java.util.concurrent.ExecutorService
true
if both Executor
s terminated, false
otherwise
java.lang.InterruptedException
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit
in interface java.util.concurrent.ExecutorService
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |