|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
PreloadConfig.setProgressListener(com.sleepycat.je.ProgressListener)
, which accepts a
ProgressListener<PreloadConfig.Phase>, and reports on
Environment.preload() or Database.preload()EnvironmentConfig.setRecoveryProgressListener(com.sleepycat.je.ProgressListener)
, which accepts a
ProgressListener<RecoveryProgress;, and reports on environment startup.
ReplicationConfig.setSyncupProgressListener(com.sleepycat.je.ProgressListener)
,
which accepts a ProgressListener<SyncupProgress>, and reports on
replication stream syncup.
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 |
---|
boolean progress(T phase, long n, long total)
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.
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.
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |