com.ibm.dtfj.analyzer.ext
Interface IAnalyze


public interface IAnalyze

Some analysers will be required simply to do analysis of a dump and produce output in the form of name=value pairs or more complex forms such as XML. Such analysers would implement this interface (and also IAnalyzerBase). The analyser would also implement the method analyzeResponse(String[] response, String ruleName) which would analyse the response values and give the ability to answer some set of simple (typically yes/no) answers about the results. Those answers would then guide further analysis.


Field Summary
static int STATE_ERROR
          Error detected and needs handling but not fatal
static int STATE_FALSE
          No error - analyzer answer is 'false' or 'no'
static int STATE_FATAL
          Fatal error detected which needs handling
static int STATE_OK
          Nothing obviously wrong
static int STATE_TRUE
          No error - analyzer answer is 'true' or 'yes'
 
Method Summary
 int analyzeResponse(java.lang.String[] response, java.lang.String ruleName)
          When the analysis has been done and produced some strings we need to decide what to do next.
 java.lang.String[] doAnalysis()
          Run the analysis which the analyser is designed to do on the image.
 java.lang.String[] listRules()
          An analyzer may be capable of evaluating a number of separate rules which typically operate on a single set of data obtained by the analyzer.
 IAnalysisReport produceReport(java.lang.String[] response, java.lang.String rule, int state)
          When the response has been analysed we have produced some state value.
 

Field Detail

STATE_OK

static final int STATE_OK
Nothing obviously wrong

See Also:
Constant Field Values

STATE_ERROR

static final int STATE_ERROR
Error detected and needs handling but not fatal

See Also:
Constant Field Values

STATE_FATAL

static final int STATE_FATAL
Fatal error detected which needs handling

See Also:
Constant Field Values

STATE_TRUE

static final int STATE_TRUE
No error - analyzer answer is 'true' or 'yes'

See Also:
Constant Field Values

STATE_FALSE

static final int STATE_FALSE
No error - analyzer answer is 'false' or 'no'

See Also:
Constant Field Values
Method Detail

doAnalysis

java.lang.String[] doAnalysis()
Run the analysis which the analyser is designed to do on the image. In general errors which prevent the analysis proceeding should be reported back to the analyser using the addError method. Errors detected as a result of the analysis (eg deadlock conditions) should be reflected in the return values for later analysis.

Returns:
- a sequence of String which in general should be name=value pairs or xml strings - not NLS

analyzeResponse

int analyzeResponse(java.lang.String[] response,
                    java.lang.String ruleName)
When the analysis has been done and produced some strings we need to decide what to do next. If the analysis has produced nothing concrete then we should run the next analyzer. If the analysis has detected an error we can tell the user about it. If the error is clearly a serious one then we can probably stop doing any more analysis.

Parameters:
response - - the set of strings which was produced by running this analyzer
ruleName - - the rule which we were analysing in the analyzer
Returns:
- the rule value. See the STATE_ values above.

produceReport

IAnalysisReport produceReport(java.lang.String[] response,
                              java.lang.String rule,
                              int state)
When the response has been analysed we have produced some state value. From the response and the state we can produce an error report if required. This simple default implementation simply converts the state value to a string.

Parameters:
response - - the set of strings which was produced by running this analyzer
rule - - the rule which we were analysing in the analyzer
state - - the value returned from analyzeResponse.
Returns:
- the generic report object which will be given to some formatter

listRules

java.lang.String[] listRules()
An analyzer may be capable of evaluating a number of separate rules which typically operate on a single set of data obtained by the analyzer. The rules are intended to be self documenting eg 'Is the JIT enabled'. Typically the result of evaluating the rule (in analyzeResponse) will be STATE_TRUE or STATE_FALSE.

Returns:
- the list of rules which the analyzer can evaluate


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.