Interface Engine
-
- All Known Implementing Classes:
- GaussEngine, GRTEngine, MatlabEngine, MLabEngine, OxEngine, StubEngine, StubMlabEngine
public interface EngineThis interface defines the general contract that all implemented concrete engines must satisfy. Engine clients can communicate to a specific computational engine exclusively via method calls defined in this interface.Usage Note:
The methods defined in this interface should be sufficient to generalize the communication to every potential computational engine.Implemented methods should throw the following unchecked exceptions:
IllegalArgumentExceptionif a given argument was not validRuntimeExceptionif execution failed for some reasonIllegalStateExceptionif the engine was in a wrong state for the given method call
Each engine implementation should be created in a new package whith implementations of:
Enginefor the communication with the external softwareAbstractConfigPanelfor user input of engine specific settings on the user machine (DefaultConfigPanelcan be used as well)LoadTypesto define extra module types that might be loaded by that engineEngineTypesmediator to set the name, check settings and bind the other classes togetherConfigKeysto define configuration settings for the engine
ConfigKeys,EngineTypesandAbstractConfigPanelshould make sure that these resources are found and that they are in a consistent state to run theEngineinstance.- See Also:
AbstractConfigPanel,LoadTypes,EngineTypes,ConfigKeys
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidcall(java.lang.String procName, JSCData[] args, JSCData[] retData)Calls a procedure with input and return parameters specified.booleanisValid(JSCTypes type)Gets whethertypecan be handled by this engine.voidload(java.lang.String module, LoadTypes loadType, JSCData... args)Loads an engine specific type that is defined by a load type.voidshutdown()Terminates this engine and does clean up tasks.voidstop()Stops a running execution.
-
-
-
Method Detail
-
call
void call(java.lang.String procName, JSCData[] args, JSCData[] retData)Calls a procedure with input and return parameters specified.The return parameters define the data types that are returned. If the procedure returns types that are not compatible with the types in
retDatathen aRuntimeExceptionshould be thrown.Elements in
retDatamust not benull. All elements inretDataandargsmust be understood by this engine, which is defined by theisValidmethod.Returned values should be set to the elements in
retData, instead of creating new data objects and replacing the array elements.- Parameters:
procName- procedure to be executed by this engineargs- the data to be used as inputretData- the return types
-
isValid
boolean isValid(JSCTypes type)
Gets whethertypecan be handled by this engine.- Parameters:
type- the data type to be checked- Returns:
trueif ok,falseiftypecannot be handled by this engine
-
load
void load(java.lang.String module, LoadTypes loadType, JSCData... args)Loads an engine specific type that is defined by a load type. Implementations of this method can perform various specific actions according toloadType, for example library loading, setting of filenames for modules or object creation withargs.- Parameters:
module- the name of the module to loadloadType- the type of module to loadargs- (optional) module load arguments if needed
-
stop
void stop() throws java.lang.UnsupportedOperationException
Stops a running execution. If there is nothing to do for this engine, this method must throw anUnsupportedOperationException.- Throws:
java.lang.UnsupportedOperationException
-
shutdown
void shutdown()
Terminates this engine and does clean up tasks. Whenever aloadorexecuteis called afterwards this engine should be reinitialized.
-
-
DMelt 3.0 © DataMelt by jWork.ORG