Package com.yahoo.concurrent.maintenance
Class JobControl
- java.lang.Object
-
- com.yahoo.concurrent.maintenance.JobControl
-
public class JobControl extends Object
Provides status over running maintenance jobs. This is multi-thread safe.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description JobControl(JobControlState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
inactiveJobs()
Returns a snapshot containing the currently inactive jobs in thisboolean
isActive(String jobSimpleClassName)
Returns true if this job is not currently deactivatedSet<String>
jobs()
Returns a snapshot of the set of jobs started on this system (whether deactivated or not).Mutex
lockJob(String jobSimpleClassName)
Acquire lock for running given jobvoid
run(String jobSimpleClassName)
Run given job (inactive or not) immediatelyvoid
started(String jobSimpleClassName, Maintainer maintainer)
Notifies this that a job was started
-
-
-
Constructor Detail
-
JobControl
public JobControl(JobControlState state)
-
-
Method Detail
-
started
public void started(String jobSimpleClassName, Maintainer maintainer)
Notifies this that a job was started
-
jobs
public Set<String> jobs()
Returns a snapshot of the set of jobs started on this system (whether deactivated or not). Each job is represented by its simple (omitting package) class name.
-
inactiveJobs
public Set<String> inactiveJobs()
Returns a snapshot containing the currently inactive jobs in this
-
isActive
public boolean isActive(String jobSimpleClassName)
Returns true if this job is not currently deactivated
-
run
public void run(String jobSimpleClassName)
Run given job (inactive or not) immediately
-
-