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 theloadData
method. This method will be called by theCyJobManager
when a job transitions to status ofFINISHED
and the user has indicated that they are ready to load the data. This will be done as part of aTask
to avoid potential synchronization issues.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 (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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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 Detail
-
jobStatusChanged
default void jobStatusChanged(CyJob job, CyJobStatus status)
This method is called whenever the status of a job changes.- Parameters:
job
- theCyJob
who's status has changedstatus
- the new jobCyJobStatus
-
loadData
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. 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
.
-
-