Package wt.jmx.core

Class 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