org.apache.ibatis.abator.api
Interface ProgressCallback

All Known Implementing Classes:
AntProgressCallback, EclipseProgressCallback, NullProgressCallback

public interface ProgressCallback

This interface can be implemented to return progress information from the file generation process. This interface is loosely based on the standard Eclipse IProgressMonitor interface, but does not implement all its methods. During the execution of a long running method, Abator will call the setNumberOfSubTasks method first, and then repeatedly call startSubTaskfinished. Periodically, Abator will call checkCancel to see if the method should be cancelled.

Author:
Jeff Butler

Method Summary
 void checkCancel()
          Abator will call this method periodically during a long running method.
 void finished()
          Abator calls this method when all subtasks are finished
 void setNumberOfSubTasks(int totalSubTasks)
          Called to designate the maximum number of startSubTask messages that will be sent.
 void startSubTask(java.lang.String subTaskName)
          Called to denote the beginning of another task
 

Method Detail

setNumberOfSubTasks

void setNumberOfSubTasks(int totalSubTasks)
Called to designate the maximum number of startSubTask messages that will be sent. It is not guaranteed that this number startSubTask messages will be sent. The actual number of messages depends on the objects generated from each table.

Parameters:
totalSubTasks -

startSubTask

void startSubTask(java.lang.String subTaskName)
Called to denote the beginning of another task

Parameters:
subTaskName - a descriptive name of the current work step

finished

void finished()
Abator calls this method when all subtasks are finished


checkCancel

void checkCancel()
                 throws java.lang.InterruptedException
Abator will call this method periodically during a long running method. If the the implementation throws InterruptedException, then the method will be cancelled. Any files that have already been saved will remain on the file system.

Throws:
java.lang.InterruptedException - if the main task should finish