Package org.apache.sling.event.impl.jobs
Class JobHandler
- java.lang.Object
-
- org.apache.sling.event.impl.jobs.JobHandler
-
-
Field Summary
Fields Modifier and Type Field Description longstarted
-
Constructor Summary
Constructors Constructor Description JobHandler(JobImpl job, org.apache.sling.event.jobs.consumer.JobExecutor consumer, JobManagerConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRetryList()booleanequals(Object obj)voidfinished(org.apache.sling.event.jobs.Job.JobState state, boolean keepJobInHistory, Long duration)Finish a job.org.apache.sling.event.jobs.consumer.JobExecutorgetConsumer()JobImplgetJob()intgetProgressLogMaxCount()inthashCode()booleanisStopped()booleanpersistJobProperties(String... propNames)Update the property of a job in the resource treevoidreassign()Reassign to a new instance.booleanremoveFromRetryList()booleanreschedule()Reschedule the job Update the retry count and remove the started time.booleanstartProcessing(org.apache.sling.event.jobs.Queue queue)voidstop()StringtoString()
-
-
-
Constructor Detail
-
JobHandler
public JobHandler(JobImpl job, org.apache.sling.event.jobs.consumer.JobExecutor consumer, JobManagerConfiguration configuration)
-
-
Method Detail
-
getJob
public JobImpl getJob()
-
getProgressLogMaxCount
public int getProgressLogMaxCount()
-
getConsumer
public org.apache.sling.event.jobs.consumer.JobExecutor getConsumer()
-
startProcessing
public boolean startProcessing(org.apache.sling.event.jobs.Queue queue)
-
reschedule
public boolean reschedule()
Reschedule the job Update the retry count and remove the started time.- Returns:
trueif rescheduling was successful,falseotherwise.
-
finished
public void finished(org.apache.sling.event.jobs.Job.JobState state, boolean keepJobInHistory, Long duration)Finish a job.- Parameters:
state- The state of the processingkeepJobInHistory- whether to keep the job in the job history.duration- the duration of the processing.
-
reassign
public void reassign()
Reassign to a new instance.
-
persistJobProperties
public boolean persistJobProperties(String... propNames)
Update the property of a job in the resource tree- Parameters:
propNames- the property names to update- Returns:
trueif the update was successful.
-
isStopped
public boolean isStopped()
-
stop
public void stop()
-
addToRetryList
public void addToRetryList()
-
removeFromRetryList
public boolean removeFromRetryList()
-
-