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>
Modifier and Type | Method and Description |
---|---|
void |
addJob(CyJob job,
CyJobMonitor jobMonitor,
int pollInterval)
Add a job to be managed by the job manager.
|
void |
associateMonitor(CyJob job,
CyJobMonitor jobMonitor,
int pollInterval)
Associate a monitor with a job.
|
void |
associateMonitor(CyJob job,
String jobMonitorName,
int pollInterval)
Associate a handler with a job.
|
CyJobStatus |
cancelJob(CyJob job)
Cancel the specified job
|
List<CyJob> |
getJobs()
Return the list of
CyJob s currently managed by the CyJobManager. |
void |
removeJob(CyJob job)
Remove a job from being managed by the job manager.
|
List<CyJob> getJobs()
CyJob
s currently managed by the CyJobManager.CyJobStatus cancelJob(CyJob job)
job
- the job to be canceledvoid addJob(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
job
- the CyJob
to add to the list of managed jobsjobMonitor
- the CyJobMonitor
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.void removeJob(CyJob job)
job
- the CyJob
to remove from the list of managed jobsvoid associateMonitor(CyJob job, CyJobMonitor jobMonitor, int pollInterval)
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.void associateMonitor(CyJob job, String jobMonitorName, int pollInterval)
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.Copyright 2011-2015 Cytoscape Consortium. All rights reserved.