Interface ConfigurableExecutorService
-
- All Superinterfaces:
Executor,ExecutorService
- All Known Implementing Classes:
AuditRequestContextPropagatingExecutorService,AuditRequestContextPropagatingScheduledExecutorService
public interface ConfigurableExecutorService extends ExecutorService
An ExecutorService that may be re-configured after construction. This interface is a work-around for the fact that ThreadPoolExecutor does not implement an interface for its configuration methods. As such, in order to re-configure a ThreadPoolExecutor after its construction you must cast it to its concrete type. This aspect of the ThreadPoolExecutor design makes it hard to write decorators that support re-configuration, (such asAuditRequestContextPropagatingExecutorService).- Since:
- 13.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutorServiceConfiguratorgetConfigurator()Gets theExecutorServiceConfiguratorfor this object if it supports re-configuration.booleanisConfigurable()Determines if this service is configurable.-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
-
-
-
Method Detail
-
isConfigurable
boolean isConfigurable()
Determines if this service is configurable.- Returns:
- True if this objects can actually be re-configured.
- See Also:
getConfigurator()
-
getConfigurator
ExecutorServiceConfigurator getConfigurator()
Gets theExecutorServiceConfiguratorfor this object if it supports re-configuration.- Returns:
- An ExecutorServiceConfigurator.
- Throws:
IllegalStateException- if this object does not support re-configuration.
-
-