|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.engine.grte.GRTEngine
public final class GRTEngine
Provides communication to the Gauss Runtime Engine and conforms to the
Engine
interface. This class serves as an adapter to the
GaussWorkspace
class of the GaussApi. Currently only realy
numbers and arrays are recognized, the complex part of returns is ignored.
Usage Note:
The engine can be configured via the respective XML config file. On
initialization the given GCG file is loaded and the procedure
initJGRTE
defined in jgrte.src
is called. On
shutdown
the method shutdownGRTE
is called. It
is assumed that these method are compiled into the loaded GCG file before.
Change the respective GAUSS code according to your needs. The default
functionality depends on the system library jgrte.dll
(Windows) to manage the display of graphics, which would otherwise not work
properly.
By default this communication class assumes that the GRT type engine version 5.0 is loaded. This can be changed via setting the system library in the XML config file.
All resources must be placed in the subdirectory jgrte
.
Constructor Summary | |
---|---|
GRTEngine()
Creates an instance of GRTEngine . |
Method Summary | |
---|---|
void |
call(java.lang.String procName,
JSCData[] args,
JSCData[] retData)
Calls a procedure with input and return parameters specified. |
com.aptech.gaussApi5_0.GaussWorkspace |
getGaussWorkSpace()
Gets the workspace that is encapsulated by this engine. |
static GRTEngine |
getInstance()
Returns an initialized instance of the GRTEngine that is a
Singleton. |
com.aptech.gaussApi5_0.GaussWorkspace |
getWk()
Gets the gauss workspace that this engine uses. |
boolean |
isValid(JSCTypes type)
Gets whether type can be handled by this engine. |
void |
load(java.lang.String loadName,
LoadTypes loadType,
JSCData... args)
Loads a module according to the load type. |
void |
shutdown()
Deletes graphics directory and shuts down all workspaces by calling Gauss.shutdown() . |
void |
stop()
Throws an Exception, because the task cannot be stopped. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GRTEngine()
GRTEngine
. This should only be
invoked if more than one workspace is needed. Otherwise the static
initializer should be preferred. This attaches System.out
to the output and error writer of the created GaussWorkspace
.
java.lang.RuntimeException
- if something went wrong during the init process
com.aptech.gaussApi5_0.GaussException
- if the workspace initialization failed
java.lang.UnsatisfiedLinkError
- if system libraries cannot be foundMethod Detail |
---|
public void call(java.lang.String procName, JSCData[] args, JSCData[] retData)
shutdown
then the initialization is
done again. If JSCConstants.DEBUG == true
, then
initialization is done for every call. This allows to take changes in the
compiled GCG file into account without restarting.
IMPORTANT:
Any GaussMatrix
that is returned from a GRTE call that
contains only a single NaN
element is treated as an empty
matrix and is transformed to an empty JSCData
object of
the specified type. This convention is choosen, because otherwise not
initialized objects could not be returned.
Please note:
If a data object of type JSCTypes.INT
is specified as
return, then any double scalar will silently be cast to an int. It may
happen that information is lost during that operation.
call
in interface Engine
procName
- procedure to be calledargs
- the data to be used as input, can be null
or
emtpyretData
- the data objects to store the return parameters, can be
null
or emtpy
java.lang.IllegalArgumentException
- if args
or retData
contain
elements that are null
or
if (procName == null || procName.length() == 0)
or if procName
is not a loaded procedure
java.lang.RuntimeException
- if return types are not compatible with returns
com.aptech.gaussApi5_0.GaussException
- if there were any GAUSS errors during the execution of the
procedurepublic static GRTEngine getInstance()
GRTEngine
that is a
Singleton.
java.lang.RuntimeException
- if something went wrong during the init process
com.aptech.gaussApi5_0.GaussException
- if the workspace initialization failed
java.lang.UnsatisfiedLinkError
- if system libraries cannot be foundpublic boolean isValid(JSCTypes type)
Engine
type
can be handled by this engine.
isValid
in interface Engine
type
- the data type to be checked
true
if ok, false
if
type
cannot be handled by this engineEngine
public void load(java.lang.String loadName, LoadTypes loadType, JSCData... args)
args
argument is ignored. If this command is called after
shutdown
then the initialization is done again.
load
in interface Engine
loadName
- the name of the module to loadloadType
- the type of the load operation to invokeargs
- always ignored
java.lang.IllegalArgumentException
- if (loadName == null || loadType == null)
or
if (loadName.length() == 0)
or if
loadName
is not validEngine
public void stop()
stop
in interface Engine
java.lang.UnsupportedOperationException
Engine.stop()
public void shutdown()
Gauss.shutdown()
.
shutdown
in interface Engine
public com.aptech.gaussApi5_0.GaussWorkspace getGaussWorkSpace()
public com.aptech.gaussApi5_0.GaussWorkspace getWk()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |