Class JobMonitor
- java.lang.Object
-
- com.composum.sling.core.concurrent.JobMonitor
-
- Direct Known Subclasses:
JobMonitor.IsDone
,JobMonitor.IsStarted
public abstract class JobMonitor extends Object implements Callable<Boolean>
Created by rw on 20.04.16.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JobMonitor.IsDone
static class
JobMonitor.IsStarted
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.sling.event.jobs.Job.JobState
currentState
static long
DELAY
protected boolean
done
protected org.apache.sling.event.jobs.Job.JobState
finalState
protected Boolean
isActive
String
jobId
org.apache.sling.event.jobs.JobManager
jobManager
org.apache.sling.api.resource.ResourceResolver
resolver
protected boolean
running
protected long
timeout
protected Boolean
wasActive
-
Constructor Summary
Constructors Modifier Constructor Description protected
JobMonitor(org.apache.sling.event.jobs.JobManager jobManager, org.apache.sling.api.resource.ResourceResolver resolver, String jobId, Long timeout)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Boolean
call()
protected void
checkJobState()
boolean
done()
boolean
error()
@Nullable JobFacade
getJob()
protected abstract boolean
goalReached()
boolean
started()
boolean
stopped()
boolean
succeeded()
String
toString()
-
-
-
Field Detail
-
DELAY
public static final long DELAY
- See Also:
- Constant Field Values
-
jobManager
public final org.apache.sling.event.jobs.JobManager jobManager
-
resolver
public final org.apache.sling.api.resource.ResourceResolver resolver
-
jobId
public final String jobId
-
isActive
protected Boolean isActive
-
wasActive
protected Boolean wasActive
-
currentState
protected org.apache.sling.event.jobs.Job.JobState currentState
-
finalState
protected org.apache.sling.event.jobs.Job.JobState finalState
-
running
protected boolean running
-
done
protected boolean done
-
timeout
protected long timeout
-
-
Method Detail
-
started
public boolean started()
-
succeeded
public boolean succeeded()
-
stopped
public boolean stopped()
-
error
public boolean error()
-
done
public boolean done()
-
goalReached
protected abstract boolean goalReached()
-
getJob
@Nullable public @Nullable JobFacade getJob()
-
checkJobState
protected void checkJobState()
-
-