Package org.cytoscape.jobs
Interface CyJobManager
-
public interface CyJobManager
CyJobManager
is responsible for managing all currently runningCyJobs
, including polling for changes in theStatus
of the job and notifying theCyJobMonitor
provided by the App of the change in status. TheCyJobManager
also is responsible for callingCyJobExecutionService.saveJobInSession(CyJob, java.io.File)
as part of session saving andCyJobExecutionService.restoreJobFromSession(org.cytoscape.session.CySession, java.io.File)
when a session is loaded.Module:
jobs-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>jobs-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addJob(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
Add a job to be managed by the job manager.void
associateMonitor(CyJob job, String jobMonitorName, int pollInterval)
Associate a handler with a job.void
associateMonitor(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
Associate a monitor with a job.CyJobStatus
cancelJob(CyJob job)
Cancel the specified jobList<CyJob>
getJobs()
Return the list ofCyJob
s currently managed by the CyJobManager.void
removeJob(CyJob job)
Remove a job from being managed by the job manager.
-
-
-
Method Detail
-
getJobs
List<CyJob> getJobs()
Return the list ofCyJob
s currently managed by the CyJobManager.- Returns:
- the list of CyJobs
-
cancelJob
CyJobStatus cancelJob(CyJob job)
Cancel the specified job- Parameters:
job
- the job to be canceled- Returns:
- the job status of the canceled job
-
addJob
void addJob(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
Add a job to be managed by the job manager. If the jobMonitor is specified, then that jobMonitor will be called if the job completes or fails- Parameters:
job
- theCyJob
to add to the list of managed jobsjobMonitor
- theCyJobMonitor
to be called if this job completes or fails. If this is null, the name of the job handler defined in the job is used (through OSGi services)pollInterval
- the number of seconds between poll attempts. If 0 or -1 the pollInterval defined in the job is used.
-
removeJob
void removeJob(CyJob job)
Remove a job from being managed by the job manager.- Parameters:
job
- theCyJob
to remove from the list of managed jobs
-
associateMonitor
void associateMonitor(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
Associate a monitor with a job. This method is used primarily by apps to reassociate with jobs after session loading.- Parameters:
job
- the job to associate tojobMonitor
- the job monitor that should be called when the job completespollInterval
- the polling interval. If this is -1, the polling interval from the CyJob will be used.
-
associateMonitor
void associateMonitor(CyJob job, String jobMonitorName, int pollInterval)
Associate a handler with a job. This method is used primarily by CyJobExecutionServices to reassociate with jobs after session loading.- Parameters:
job
- the job to associate tojobMonitorName
- the name of the job handler that should be called when the job completespollInterval
- the polling interval. If this is -1, the polling interval from the CyJob will be used.
-
-