Package org.apache.ofbiz.service.job
Class JobPoller
- java.lang.Object
-
- org.apache.ofbiz.service.job.JobPoller
-
- All Implemented Interfaces:
ServiceConfigListener
public final class JobPoller extends java.lang.Object implements ServiceConfigListener
Job poller. Queues and runs jobs.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JobPoller
getInstance()
Returns theJobPoller
instance.java.util.Map<java.lang.String,java.lang.Object>
getPoolState()
Returns aMap
containingJobPoller
statistics.void
onServiceConfigChange(ServiceConfig serviceConfig)
Processesserviceengine.xml
changes.void
queueNow(Job job)
Adds a job to the job queue.static void
registerJobManager(JobManager jm)
Register aJobManager
with the job poller.void
stop()
Stops theJobPoller
.
-
-
-
Method Detail
-
getInstance
public static JobPoller getInstance()
Returns theJobPoller
instance.
-
registerJobManager
public static void registerJobManager(JobManager jm)
Register aJobManager
with the job poller.- Parameters:
jm
- TheJobManager
to register.- Throws:
java.lang.IllegalArgumentException
- ifjm
is null
-
getPoolState
public java.util.Map<java.lang.String,java.lang.Object> getPoolState()
Returns aMap
containingJobPoller
statistics.
-
onServiceConfigChange
public void onServiceConfigChange(ServiceConfig serviceConfig)
Description copied from interface:ServiceConfigListener
Processesserviceengine.xml
changes.- Specified by:
onServiceConfigChange
in interfaceServiceConfigListener
- Parameters:
serviceConfig
- The newServiceConfig
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.java.util.concurrent.RejectedExecutionException
- if the poller is stopped.
-
stop
public void stop()
Stops theJobPoller
. This method is called when OFBiz shuts down. TheJobPoller
cannot be restarted.
-
-