Package org.cytoscape.jobs
Interface CyJobMonitor
-
public interface CyJobMonitorApps 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 theloadDatamethod. This method will be called by theCyJobManagerwhen a job transitions to status ofFINISHEDand the user has indicated that they are ready to load the data. This will be done as part of aTaskto avoid potential synchronization issues.Module:
jobs-apiTo 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 voidjobStatusChanged(CyJob job, CyJobStatus status)This method is called whenever the status of a job changes.voidloadData(CyJob job, TaskMonitor taskMonitor)This method is called when when the job status transitions toFINISHEDand 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- theCyJobwho's status has changedstatus- the new jobCyJobStatus
-
loadData
void loadData(CyJob job, TaskMonitor taskMonitor)
This method is called when when the job status transitions toFINISHEDand the user has indicated that they are ready to load the data from the task. Typically, this will result in thefetchResultsmethod being called, but if the data package is large, implementers might want to callfetchResultsin 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 finishedCyJobto fetch the data fortaskMonitor- theTaskMonitorfrom the callingTask.
-
-