|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wrapper.CPAMMegamodule
Field Summary | |
private java.util.Map |
connections
Maps connection ids to connection objects. |
private ParamValueTable |
defaultParams
Table of all the parameters in the megamodule and their default values. |
(package private) static int |
noCon
Number of possible connections per megamodule. |
(package private) static int |
noInv
Number of possible invocation per connection |
(package private) java.lang.String |
paramType
Kind of parameters this megamodule accepts (String or Gentype or ....) |
private java.util.Random |
random
|
Constructor Summary | |
CPAMMegamodule(java.lang.String paramType)
|
Method Summary | |
protected boolean |
abortExecution(Invocation invocationObject,
java.lang.String methodname)
Abort the invocation. |
void |
addParam(java.lang.String paramname,
java.lang.Object paramvalue)
Adds a name value pair to the list of known paramaters of a megamodule. |
(package private) void |
connectionTerminated(java.lang.Integer connectionId)
|
(package private) java.lang.Integer |
createConnection()
Creates a new connection object and its connection id. |
protected void |
createParameters()
Sets up the table with the parameter names and default values for this megamodule. |
protected abstract boolean |
dispatchInvocation(CPAMWrapperCallbacks invocationObject,
java.lang.String methodname)
Executes an invocation. |
(package private) Connection |
getConnection(java.lang.Integer connectionId)
|
(package private) Invocation |
getInvocation(java.lang.Integer invocationId)
|
protected boolean |
makeEstimate(Estimates estimates,
java.lang.String methodname,
ParamValueTableReader clientsettings)
Make estimates. |
protected void |
updateExecutionStatus(CPAMWrapperCallbacks invocationObject,
java.lang.String methodname)
If new progress information exists for the invocation given by invocationObject or if new result values exist that influence the status of this invocation, report them now. |
protected void |
updateResult(java.lang.String paramname,
CPAMWrapperCallbacks invocationObject,
java.lang.String methodname)
If new results for the parameter with the name paramname exist that have not yet been reported back to the wrapper, do it now. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int noInv
static final int noCon
The following condition must be fulfilled:
noInv * noCon + noCon < MAX int
private ParamValueTable defaultParams
final java.lang.String paramType
private java.util.Map connections
private java.util.Random random
Constructor Detail |
public CPAMMegamodule(java.lang.String paramType)
Method Detail |
protected void createParameters()
Use addParam(String name, Object value) to create the name value pairs. The names and the types of the values have to correspond to the names and types specified in the repository. In case of duplicate names or invalid types the method addParam throws ParameterNameException and ParameterTypeException.
public final void addParam(java.lang.String paramname, java.lang.Object paramvalue)
protected boolean makeEstimate(Estimates estimates, java.lang.String methodname, ParamValueTableReader clientsettings) throws MethodNameException
Return true (for estimates being available). The datastructure 'estimates' contains the fields timeRequired, feeRequired, datavolumeRequired, timeProvided , feeProvided, datavolumeProvided, timeValue, feeValue, datavolumeValue, timeAccuracy, feeAccuracy, datavolumeAccuracy. The ParamValueTable 'clientsettings' contains the client-specific parameter settings. The values can be read with clientsettings.get("parametername"). In case of an unknown methodname, throw an exception of type MethodNameException.
protected abstract boolean dispatchInvocation(CPAMWrapperCallbacks invocationObject, java.lang.String methodname)
Methodname is the name of the method invoked according to the CHAIMS repository. In case of an unknown methodname, throw an exception of type MethodNameException. InvocationObject gives the reference to the object holding invocation specific parameter settings, results, progress information and status information for the invocation.
The method must return true upon successful completion of the computation, or false in case of errors that result in being unable to complete all results or in case of an abort. Before returning with true all the final results have to be stored in the invocationObject.
Methods to use (@see also interface CPAMWrapperCallbacks): Method for getting invocation parameters: getParam Method for storing final results: updateParam Methods for storing progressive results and progress information: updateParam, updateInvocationProgress Other useful methods and fields: containsParam, getInvocationId, getInvocationParams Alternative for using getParam: getInvocationParams.get Alternative for storing progressive results and progress information within this method: overwrite the methods getInvocationProgress, getResultProgress, getResultValue ????
protected boolean abortExecution(Invocation invocationObject, java.lang.String methodname)
protected void updateResult(java.lang.String paramname, CPAMWrapperCallbacks invocationObject, java.lang.String methodname)
protected void updateExecutionStatus(CPAMWrapperCallbacks invocationObject, java.lang.String methodname)
final Invocation getInvocation(java.lang.Integer invocationId)
final Connection getConnection(java.lang.Integer connectionId)
final void connectionTerminated(java.lang.Integer connectionId)
final java.lang.Integer createConnection()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |