Class JobPoller

java.lang.Object
org.apache.ofbiz.service.job.JobPoller
All Implemented Interfaces:
ServiceConfigListener

public final class JobPoller extends Object implements ServiceConfigListener
Job poller. Queues and runs jobs.
  • Method Details

    • getInstance

      public static JobPoller getInstance()
      Returns the JobPoller instance.
    • registerJobManager

      public static void registerJobManager(JobManager jm)
      Register a JobManager with the job poller.
      Parameters:
      jm - The JobManager to register.
      Throws:
      IllegalArgumentException - if jm is null
    • getPoolState

      public Map<String,Object> getPoolState()
      Returns a Map containing JobPoller statistics.
    • onServiceConfigChange

      public void onServiceConfigChange(ServiceConfig serviceConfig)
      Description copied from interface: ServiceConfigListener
      Processes serviceengine.xml changes.
      Specified by:
      onServiceConfigChange in interface ServiceConfigListener
      Parameters:
      serviceConfig - The new ServiceConfig instance.
    • queueNow

      public void queueNow(Job job) throws InvalidJobException
      Adds a job to the job queue.
      Throws:
      InvalidJobException - if the job is in an invalid state.
    • stop

      public void stop()
      Stops the JobPoller. This method is called when OFBiz shuts down. The JobPoller cannot be restarted.