Package org.oddjob.scheduling
Class DefaultExecutors
java.lang.Object
org.oddjob.scheduling.DefaultExecutors
- All Implemented Interfaces:
OddjobExecutors,Stoppable
Provide Simple Oddjob Services.
- Author:
- rob
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvide aExecutorService.intGet the pool size for the scheduled executor.Provide aScheduledExecutorService.booleanvoidsetPoolBaseName(String poolBaseName) voidsetPoolSize(int poolSize) Set the pool size for the scheduled executor.voidsetShareServices(boolean shareServices) Share the same service between the executor service and the scheduled executor service.voidstop()Stop the services.toString()
-
Field Details
-
POOL_SIZE_PROPERTY
- See Also:
-
-
Constructor Details
-
DefaultExecutors
public DefaultExecutors()Create a new instance. The scheduler is initialised with a fixed pool size that is either from the system property or based on the number of available processors discovered at runtime. The pool size can also be set by the property.
-
-
Method Details
-
stop
public void stop()Stop the services. -
getScheduledExecutor
Description copied from interface:OddjobExecutorsProvide aScheduledExecutorService.- Specified by:
getScheduledExecutorin interfaceOddjobExecutors- Returns:
- A ScheduledExecutorService. Never null.
-
getPoolExecutor
Description copied from interface:OddjobExecutorsProvide aExecutorService. Implementations are free to useOddjobExecutors.getScheduledExecutor()for this, or provide something different.- Specified by:
getPoolExecutorin interfaceOddjobExecutors- Returns:
- An ExecutorService. Never null.
-
getPoolSize
public int getPoolSize()Get the pool size for the scheduled executor.- Returns:
-
setPoolSize
public void setPoolSize(int poolSize) Set the pool size for the scheduled executor.- Parameters:
poolSize- The pool size.
-
getPoolBaseName
-
setPoolBaseName
-
toString
-