All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface framework.Modulable

public interface Modulable
All modules that can be run by the Framework must implement this interface. The Modulable interface only contains the method run().

Version:
$Revision: 1.9 $

Method Index

 o run(DataStore, DataStore, ParameterStore)
Run the module.

Methods

 o run
 public abstract boolean run(DataStore input,
                             DataStore output,
                             ParameterStore parameters) throws JNIException, ModuleException
Run the module. Called by the Framework when the user of the Framework selects the run button (only if this module is in the run path). A module typically provides a run() method that accepts the input and parameters from the Framework, executes its algorithm and passes the results back to the Framework.

Parameters:
input - a DataStore containing a Data element for each InConnector of the module, as specified in the Module Description File. Data elements are instances of a class that implements the Data interface. The Data elements in this DataStore are in order of the InConnectors in the Module Description File.
output - an empty DataStore. This method is supposed to be used by the module to pass the output it generates back to the Framework. This method must fill the DataStore with Data elements containing the output for each OutConnector of the module. There must be one Data element for each OutConnector. They must be ordered the same way the OutConnectors in the Module Description File are ordered.

If a Data element is missing from the output DataStore(its entry contains the value null or there are fewer elements in the DataStore than OutConnectors in the Module Description File), the Framework assumes the module has failed to complete its task. The Data elements that are in the output DataStore are considered to be valid. They may be used as input for other modules, or their contents may be saved to disk.

If the construction of a particular Data element is performed in several steps during which the Data element may be invalid, the module should hold the Data element in a local variable, and only add it to the output DataStore after it has become valid. If the Data element is added to early, while it still is invalid, the module may never be able to finish the construction of the Data element, because it may be interrupted by an exception. Then, the output DataStore could contain an invalid Data element, which might be given as input to other modules or which contents might be saved to disk.

parameters - a ParameterStore containing the values the user of the Framework specified for the parameters of the module. The elements in this ParameterStore are in the same order as the parameters in the Module Description File.
Returns:
A boolean value which indicates the success of the module. If the module detected an error while running, it should return false. If everything went OK, it should return true. If the result is false, the Framework will display a message to the user of the Framework to inform him or her that the module has failed. Please note that even when the module fails, the Framework still searches the output DataStore for Data elements. Any Data element found is assumed to be valid and may be used as input for another module or its contents may be saved to disk.
Throws: JNIException
If the actual algorithm of the module is written in C or C++, a JNIException or a subclass of JNIException is thrown if the contents of the Data elements or parameters are incorrectly accessed. These exceptions are caught by the Framework, which will display the problem to the user.
Throws: ModuleException
If a module fails to perform its task for some reason, it can throw a ModuleException to indicate its failure. This exception will be caught by the Framework, which will display the problem to the user.
See Also:
DataStore, ParameterStore, JNIException, ModuleException

All Packages  Class Hierarchy  This Package  Previous  Next  Index