Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je
Interface ProgressListener<T extends Enum<T>>


public interface ProgressListener<T extends Enum<T>>

ProgressListener provides feedback to the application that progress is being made on a potentially long running or asynchronous JE operation. The listener itself is general and abstract, and more details about the meaning of the progress callback can be found by reading about the entry points where specific ProgressListeners can be specified. For example, see:

Since:
5.0

Method Summary
 boolean progress(T phase, long n, long total)
          Called by BDB JE to indicate to the user that progress has been made on a potentially long running or asynchronous operation.
 

Method Detail

progress

boolean progress(T phase,
                 long n,
                 long total)
Called by BDB JE to indicate to the user that progress has been made on a potentially long running or asynchronous operation.

This method should do the minimal amount of work, queuing any resource intensive operations for processing by another thread before returning to the caller, so that it does not unduly delay the target operation, which invokes this method.

The applicaton should also be aware that the method has potential to disrupt the reported-upon operation. If the progress() throws a RuntimeException, the operation for which the progress is being reported will be aborted and the exception propagated back to the original caller. Also, if progress() returns false, the operation will be halted. For recovery and syncup listeners, a false return value can invalidate and close the environment.

Parameters:
phase - an enum indicating the phase of the operation for which progress is being reported.
n - indicates the number of units that have been processed so far. If this does not apply, -1 is returned.
total - indicates the total number of units that will be processed if it is known by JE. If total is < 0, then the total number is unknown. When total == n, this indicates that processing of this operation is 100% complete, even if all previous calls to progress passed a negative value for total.
Returns:
true to continue the operation, false to stop it.

Berkeley DB Java Edition
version 5.0.34

Copyright (c) 2004-2011 Oracle. All rights reserved.