Package wt.jmx.core
Class SharedScheduledExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
wt.jmx.core.SharedScheduledExecutor
- All Implemented Interfaces:
Executor,ExecutorService,ScheduledExecutorService
public class SharedScheduledExecutor
extends AbstractExecutorService
implements ScheduledExecutorService
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidboolean<V> ScheduledFuture<V>scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) voidshutdown()Future<?>OverridesAbstractExecutorServicemethod with same signature.<T> Future<T>OverridesAbstractExecutorServicemethod with same signature.<T> Future<T>OverridesAbstractExecutorServicemethod with same signature.Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskForMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
-
Constructor Details
-
SharedScheduledExecutor
Constructor.
Supported API: true
-
-
Method Details
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceExecutorService
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceExecutorService
-
submit
OverridesAbstractExecutorServicemethod with same signature. Method required byScheduledExecutorServiceinterface.
Supported API: true- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
OverridesAbstractExecutorServicemethod with same signature. Method required byScheduledExecutorServiceinterface.
Supported API: true- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
OverridesAbstractExecutorServicemethod with same signature. Method required byScheduledExecutorServiceinterface.
Supported API: true- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
execute
-