Package org.cytoscape.jobs
Interface CyJobMonitor
public interface CyJobMonitor
Apps are expected to implement this interface to receive notifications
about job completions. To be informed about the status of a particular
job, CyJobMonitors should be registered as services so that jobs can be
reassociated with their handlers on session restore. Note that classes
should implement the
loadData
method. This method will
be called by the CyJobManager
when a job transitions to status
of FINISHED
and the user has indicated that they
are ready to load the data. This will be done as part of a
Task
to avoid potential synchronization issues.Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
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>
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
jobStatusChanged(CyJob job, CyJobStatus status)
This method is called whenever the status of a job changes.void
loadData(CyJob job, TaskMonitor taskMonitor)
This method is called when when the job status transitions toFINISHED
and the user has indicated that they are ready to load the data from the task.
-
Method Details
-
jobStatusChanged
This method is called whenever the status of a job changes.- Parameters:
job
- theCyJob
who's status has changedstatus
- the new jobCyJobStatus
-
loadData
This method is called when when the job status transitions toFINISHED
and the user has indicated that they are ready to load the data from the task. Typically, this will result in thefetchResults
method being called, but if the data package is large, implementers might want to callfetchResults
in a separate thread spawned fromjobStatusChanged
, then when the user indicates they are ready to process the data, the call to loadData can merge the resulting data into Cytoscape.- Parameters:
job
- the finishedCyJob
to fetch the data fortaskMonitor
- theTaskMonitor
from the callingTask
.
-