|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
wt.jmx.core.SharedScheduledExecutor
public class SharedScheduledExecutor
This utility is largely a normal, drop in ScheduledExecutorService implementation. It assumes that all instances sharing a given name and daemon flag should share a single ScheduledThreadPoolExecutor. This prevents the common circumstance wherein many bodies of code create their own ScheduledExecutorService or Timer and thus their own thread or thread pool when their load does not justify this -- thus wasting threads.
This is not a full ScheduledExecutorService implementation, however, in that
shutdownNow(), awaitTermination(), and isTerminated() do not behave as described in
the ScheduledExecutorService documentation. Please use ScheduledThreadPoolExecutor
instead if this is an issue.
Supported API: true
Extendable: false
| Constructor Summary | |
|---|---|
SharedScheduledExecutor(String name,
boolean daemon)
Constructor. |
|
| Method Summary | ||
|---|---|---|
void |
execute(Runnable command)
Method required by ScheduledExecutorService interface
Supported API: true |
|
boolean |
isShutdown()
Method required by ScheduledExecutorService interface
Supported API: true |
|
|
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Method required by ScheduledExecutorService interface
Supported API: true |
|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Method required by ScheduledExecutorService interface
Supported API: true |
|
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Method required by ScheduledExecutorService interface
Supported API: true |
|
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Method required by ScheduledExecutorService interface
Supported API: true |
|
void |
shutdown()
Method required by ScheduledExecutorService interface
Supported API: true |
|
|
submit(Callable<T> task)
Overrides AbstractExecutorService method with same signature. |
|
Future<?> |
submit(Runnable task)
Overrides AbstractExecutorService method with same signature. |
|
|
submit(Runnable task,
T result)
Overrides AbstractExecutorService method with same signature. |
|
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.ExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny |
| Constructor Detail |
|---|
public SharedScheduledExecutor(String name,
boolean daemon)
| Method Detail |
|---|
public ScheduledFuture<?> schedule(Runnable command,
long delay,
TimeUnit unit)
ScheduledExecutorService interface
schedule in interface ScheduledExecutorService
public <V> ScheduledFuture<V> schedule(Callable<V> callable,
long delay,
TimeUnit unit)
ScheduledExecutorService interface
schedule in interface ScheduledExecutorService
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
ScheduledExecutorService interface
scheduleAtFixedRate in interface ScheduledExecutorService
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
ScheduledExecutorService interface
scheduleWithFixedDelay in interface ScheduledExecutorServicepublic void shutdown()
ScheduledExecutorService interface
shutdown in interface ExecutorServicepublic boolean isShutdown()
ScheduledExecutorService interface
isShutdown in interface ExecutorServicepublic <T> Future<T> submit(Callable<T> task)
AbstractExecutorService method with same signature.
Method required by ScheduledExecutorService interface.
submit in interface ExecutorServicesubmit in class AbstractExecutorService
public <T> Future<T> submit(Runnable task,
T result)
AbstractExecutorService method with same signature.
Method required by ScheduledExecutorService interface.
submit in interface ExecutorServicesubmit in class AbstractExecutorServicepublic Future<?> submit(Runnable task)
AbstractExecutorService method with same signature.
Method required by ScheduledExecutorService interface.
submit in interface ExecutorServicesubmit in class AbstractExecutorServicepublic void execute(Runnable command)
ScheduledExecutorService interface
execute in interface Executor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||