Package com.storedobject.job
Class DaemonJob
java.lang.Object
com.storedobject.job.Job
com.storedobject.job.DaemonJob
- Direct Known Subclasses:
Alert
,Controller
,DataChangeProcessor
,MessageSender
,MQTTDataCollector
Daemon job is a special
Job
and its Job.execute()
method will be invoked only once,
and it runs forever in the background. However, the Job.execute()
method may be invoked again if an error
occurred during the previous run or the isActive()
method returns false
when it is
due again.- Author:
- Syam
-
Constructor Details
-
DaemonJob
Constructor.- Parameters:
schedule
- Schedule defined for this Job.
-
-
Method Details
-
isActive
public boolean isActive()Check if the Job is still active or not. (The default implementation always returnstrue
). If this method returnsfalse
, the Job Scheduler will invoke theJob.execute()
method again when it is due for the next run.- Returns:
- True/false
-