Class DefaultExecutors

java.lang.Object
org.oddjob.scheduling.DefaultExecutors
All Implemented Interfaces:
OddjobExecutors, Stoppable

public class DefaultExecutors extends Object implements OddjobExecutors, Stoppable
Provide Simple Oddjob Services.
Author:
rob
  • Field Details

  • 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.
      Specified by:
      stop in interface Stoppable
    • getScheduledExecutor

      public ScheduledExecutorService getScheduledExecutor()
      Description copied from interface: OddjobExecutors
      Specified by:
      getScheduledExecutor in interface OddjobExecutors
      Returns:
      A ScheduledExecutorService. Never null.
    • getPoolExecutor

      public ExecutorService getPoolExecutor()
      Description copied from interface: OddjobExecutors
      Provide a ExecutorService. Implementations are free to use OddjobExecutors.getScheduledExecutor() for this, or provide something different.
      Specified by:
      getPoolExecutor in interface OddjobExecutors
      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.
    • isShareServices

      public boolean isShareServices()
    • setShareServices

      public void setShareServices(boolean shareServices)
      Share the same service between the executor service and the scheduled executor service.
      Parameters:
      shareServices -
    • getPoolBaseName

      public String getPoolBaseName()
    • setPoolBaseName

      public void setPoolBaseName(String poolBaseName)
    • toString

      public String toString()
      Overrides:
      toString in class Object