com.bbn.swede.editor.visualeditors.restriction
Class ModelLoadJob

java.lang.Object
  extended byJob
      extended bycom.bbn.swede.editor.visualeditors.restriction.ModelLoadJob
All Implemented Interfaces:
Runnable

public class ModelLoadJob
extends Job
implements Runnable

A job to load the Jena model used by the Restriction Editor in a different thread so as to keep the UI responsive. It will create a inferencing OntModel containing all the statements of each document referenced by either assigning a namespace, or by an owl:import statement, as available.

Author:
aperezlo
See Also:
Serialized Form

Constructor Summary
ModelLoadJob(IOWLAbstractSyntaxTree oast)
          Creates a model load job for a specific OAST.
 
Method Summary
 OntModel getModel()
          Returns the model loaded by this job.
 void run()
          Loads the model as described in the class documentation.
protected  IStatus run(IProgressMonitor monitor)
          Default behaviour, runs asynchronously on a separate thread.
protected  IStatus runBlocking(IProgressMonitor monitor)
          Runs on the calling thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelLoadJob

public ModelLoadJob(IOWLAbstractSyntaxTree oast)
Creates a model load job for a specific OAST.

Parameters:
oast - the OAST of the document to use for loading the model
Method Detail

getModel

public OntModel getModel()
Returns the model loaded by this job. Only call once the job has finished or the result will be null.

Returns:
the loaded model

run

public void run()
Loads the model as described in the class documentation.

Specified by:
run in interface Runnable
See Also:
Runnable.run()

runBlocking

protected IStatus runBlocking(IProgressMonitor monitor)
Runs on the calling thread.

Parameters:
monitor - A progress monitor
Returns:
A status object indicating the success or failure of the job.

run

protected IStatus run(IProgressMonitor monitor)
Default behaviour, runs asynchronously on a separate thread.

See Also:
org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.