Package org.cytoscape.jobs
Interface CyJobManager
public interface CyJobManager
CyJobManager
is responsible for managing all currently running
CyJobs
, including polling for changes in the
Status
of the job and notifying the
CyJobMonitor
provided by the App of the change in status.
The CyJobManager
also is responsible for calling
CyJobExecutionService.saveJobInSession(CyJob, java.io.File)
as part
of session saving and
CyJobExecutionService.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
Modifier and TypeMethodDescriptionvoid
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.Cancel the specified jobgetJobs()
Return the list ofCyJob
s currently managed by the CyJobManager.void
Remove a job from being managed by the job manager.
-
Method Details
-
getJobs
Return the list ofCyJob
s currently managed by the CyJobManager.- Returns:
- the list of CyJobs
-
cancelJob
Cancel the specified job- Parameters:
job
- the job to be canceled- Returns:
- the job status of the canceled job
-
addJob
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
Remove a job from being managed by the job manager.- Parameters:
job
- theCyJob
to remove from the list of managed jobs
-
associateMonitor
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
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.
-