wrapper
Interface CPAMWrapperCallbacks

All Known Implementing Classes:
Invocation

public abstract interface CPAMWrapperCallbacks

Defines the callback functions to be used by the wrapped computational (legacy) code for getting parameter values, reporting progress, and storing results. When getting a parameter value with getParam, the value must be cast to its type (e.g. String or Gentype) for processing.


Method Summary
 boolean containsParam(java.lang.String name)
          Checks if a specific parameter exists.
 java.lang.Integer getInvocationId()
          Returns the invocation Id for this invocation object.
 java.lang.Object getParam(java.lang.String name)
          Reads a parameter value.
 void updateInvocationProgress(float progress)
          Updates invocation progress.
 void updateParam(java.lang.String name, java.lang.Object value, boolean resultIsFinal, float accuracy)
          Stores results.
 

Method Detail

getParam

public java.lang.Object getParam(java.lang.String name)
Reads a parameter value.
Throws:
ParameterNameException - the name of the parameter is unknown

containsParam

public boolean containsParam(java.lang.String name)
Checks if a specific parameter exists. Returns true if name is the name of a parameter usable for this invocation.

updateParam

public void updateParam(java.lang.String name,
                        java.lang.Object value,
                        boolean resultIsFinal,
                        float accuracy)
Stores results. The results can be progressive or final. For final results resultIsFinal must be true, yet the value for accuracy needs not to be set ( 0 or 100 are good defaults for finished results). For progressive results, accuracy must be set and resultIsFinal must be false. Accuracy normally has a value between 0 and 100, unless specified differently for this parameter in the CHAIMS repository.
Throws:
ParameterNameException - the name of the parameter is unknown

updateInvocationProgress

public void updateInvocationProgress(float progress)
Updates invocation progress. This method should only be called if the computational code offers progress information. If progress information is available, progress is normally a value between 1-100 unless otherwise specified in the CHAIMS repository. Progress indicates the progress of this invocation, normally indicating the progress in the amount of execution time done in respect to the overall execution time of the method.

getInvocationId

public java.lang.Integer getInvocationId()
Returns the invocation Id for this invocation object. Every invocation object has a unique invocation id that is used internally as well as by clients to identify this invocation. This method is an easy way to get unique invocation identifiers in case the computational code needs some.