org.mmbase.util.externalprocess
Interface IProgressMonitor

All Known Implementing Classes:
AbstractMonitor

public interface IProgressMonitor

The IProgressMonitor interface is implemented by objects that monitor the progress of a external process; the methods in this interface are invoked by code that performs the external process handling.

A request to cancel the external process can be signaled using the setCanceled method. Operations taking a progress monitor are expected to poll the monitor (using isCanceled) periodically and abort at their earliest convenience. Operation can however choose to ignore cancelation requests.

Since notification is synchronous with the external process itself, the listener should provide a fast and robust implementation. If the handling of notifications would involve blocking operations, or operations which might throw uncaught exceptions, the notifications should be queued, and the actual processing deferred (or perhaps delegated to a separate thread).

Clients may implement this interface.

Since:
MMBase-1.6
Version:
$Id: IProgressMonitor.java 35046 2009-05-08 13:06:00Z michiel $
Author:
Nico Klasens (Finalist IT Group)

Method Summary
 void begin()
          Notifies that the processing is beginning.
 void done()
          Notifies that the work is done; that is, either the external process is completed or the user canceled it.
 boolean isCanceled()
          Returns whether cancelation of current operation has been requested.
 void setCanceled(boolean value)
          Sets the cancel state to the given value.
 void worked()
          Notifies that some work of the external process has been completed.
 

Method Detail

begin

void begin()
Notifies that the processing is beginning. This must only be called once on a given progress monitor instance.


done

void done()
Notifies that the work is done; that is, either the external process is completed or the user canceled it.


isCanceled

boolean isCanceled()
Returns whether cancelation of current operation has been requested. Long-running operations should poll to see if cancelation has been requested.

Returns:
true if cancellation has been requested, and false otherwise
See Also:
setCanceled(boolean)

setCanceled

void setCanceled(boolean value)
Sets the cancel state to the given value.

Parameters:
value - true indicates that cancelation has been requested (but not necessarily acknowledged); false clears this flag
See Also:
isCanceled()

worked

void worked()
Notifies that some work of the external process has been completed.



MMBase 2.0-SNAPSHOT - null