Long running operations

From Bioclipse
Jump to: navigation, search
This page is out of date!

In Bioclipse 2 long running jobs can (and in most cases should) be made with AOP on the managers. For an explanation see: How_to_make_a_manager and also Building_a_recordable_plugin might be of intrest.



This is how long running operations should be handles in Bioclipse2.

Create a Job this way:

 class LongJob extends AbstractJob{
 ...
 }


And instantiate and schedule the job this way:

 LongJob job = new LongJob();
 job.setDelay(0);
 ImageDescriptor icon = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT);
 ActionJobRunner.getInstance().runSingleAction(job, true, false, icon);

More information: see LongRunningAction in net.bioclipse.biojava.ui.actions.

The ActionJobRunner also has the following methods:

  • runSingleAction(final IActionJob actionJob, boolean showDialog, final boolean isUIJob, final ImageDescriptor image)
Run a Job in Bioclipse
  • runRunnableInUI(final IRunnableWithProgress action, final boolean cancelable) {
Run a Runnable in Bioclipse.


Concurrency

TBC

Links