com.ibm.dtfj.analyzer.ext
Interface IProgress


public interface IProgress

This interface is used to notify subscribers about the progress of analysis. It is designed to minimise the load on the individual analyzers and thus divides analysis into various elements some of which are notified by the framework and others require the assistance of individual analyzers. In general an analyzer should aim to


Method Summary
 void notifyAnalysisComplete(IAnalyzerBase analyzer, IAnalyzerContext context, java.lang.String type)
          The given analyzer has completed analysis
 void notifyAnalysisPhase(IAnalyzerBase analyzer, IAnalyzerContext context, int phase, int target)
          Notify the start of an analysis phase.
 boolean notifyAnalysisProgress(IAnalyzerBase analyzer, IAnalyzerContext context, int progress, int target)
          Notify progress of a phase in the analysis.
 void notifyAnalysisStarting(IAnalyzerBase analyzer, IAnalyzerContext context, java.lang.String type)
          The given analyzer is about to start analysis
 void notifyInitialization(java.lang.String name, int progress, int target)
          Report progress on reading the input file and and initializing contexts etc.
 

Method Detail

notifyInitialization

void notifyInitialization(java.lang.String name,
                          int progress,
                          int target)
Report progress on reading the input file and and initializing contexts etc.

Parameters:
name - the file being processed
progress - the progress made so far
target - the target

notifyAnalysisStarting

void notifyAnalysisStarting(IAnalyzerBase analyzer,
                            IAnalyzerContext context,
                            java.lang.String type)
The given analyzer is about to start analysis

Parameters:
analyzer - the current analyzer which may be null during parsing of the input file
context - the current analysis context which may be null during parsing of the input file
type - the analysis type

notifyAnalysisComplete

void notifyAnalysisComplete(IAnalyzerBase analyzer,
                            IAnalyzerContext context,
                            java.lang.String type)
The given analyzer has completed analysis

Parameters:
analyzer - the current analyzer which may be null during parsing of the input file
context - the current analysis context which may be null during parsing of the input file
type - the analysis type

notifyAnalysisPhase

void notifyAnalysisPhase(IAnalyzerBase analyzer,
                         IAnalyzerContext context,
                         int phase,
                         int target)
Notify the start of an analysis phase. An analyzer might choose to report progress on individual phases of the analysis if each phase might be long. Hence a pass through each of the objects in the heap might be a phase of the analysis and there may be many such phases. The total number may be known at the begining of the analysis or may become known after one of the phases.

Parameters:
analyzer - the current analyzer which may be null during parsing of the input file
context - the current analysis context which may be null during parsing of the input file
phase - the current analysis phase - this will be analyzer dependent
target - the target value or 0 if the target phase is not known

notifyAnalysisProgress

boolean notifyAnalysisProgress(IAnalyzerBase analyzer,
                               IAnalyzerContext context,
                               int progress,
                               int target)
Notify progress of a phase in the analysis. This is intended to be an indication of progress rather than an exact measure. An analyzer should aim to report progress every 100ms whilst in an analysis loop and it may be convenient to report the loop counter. If the final value of the counter is not known without some effort (eg by iterating through all the heap objects to count them) it is better to report a target value of 0. Typically these notifications will not all be passed to subscribers which will have the option to limit the frequency of notifications. To simplify the task of progress reporting this method returns a boolean indicating that the information was used; it wasn't too much. If this method returns false then the reporting component might choose to reduce the frequency (report every 2000 cycles rather than every 1000 etc.). Conversely if the reponse is always true the analyzer may choose to increase the frequency.

Parameters:
analyzer - the current analyzer which may be null during parsing of the input file
context - the current analysis context which may be null during parsing of the input file
progress - the progress made so far
target - the target value or 0 if the target is not known
Returns:
true if the information was used by at least one subscriber else false.


© 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.