org.jboss.dna.common.monitor
Class LoggingProgressMonitor

java.lang.Object
  extended by org.jboss.dna.common.monitor.ProgressMonitorWrapper
      extended by org.jboss.dna.common.monitor.LoggingProgressMonitor
All Implemented Interfaces:
ProgressMonitor

public class LoggingProgressMonitor
extends ProgressMonitorWrapper

Author:
Randall Hauch

Constructor Summary
LoggingProgressMonitor(ProgressMonitor delegate, Logger logger, Logger.Level level)
           
LoggingProgressMonitor(ProgressMonitor delegate, Logger logger, Logger.Level level, Locale locale)
           
 
Method Summary
 void beginTask(double totalWork, I18n name, Object... params)
          Called by the Updater to indicate work has started on the task, specifying the total amount of work that this task constitutes.
 void done()
          Called by the Updater to mark this activity as complete.
 void setCancelled(boolean value)
          Called by an Observer to request the cancellation of this activity, or by the Updater to deny a prior cancellation request (i.e., when the activity completes before the Updater recognizes a cancellation request by an Observer).
 void worked(double work)
          Called by the Updater to report work completed for this task.
 
Methods inherited from class org.jboss.dna.common.monitor.ProgressMonitorWrapper
createSubtask, getActivityName, getProblems, getStatus, getWrappedMonitor, isCancelled, isDone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingProgressMonitor

public LoggingProgressMonitor(ProgressMonitor delegate,
                              Logger logger,
                              Logger.Level level)

LoggingProgressMonitor

public LoggingProgressMonitor(ProgressMonitor delegate,
                              Logger logger,
                              Logger.Level level,
                              Locale locale)
Method Detail

beginTask

public void beginTask(double totalWork,
                      I18n name,
                      Object... params)
Called by the Updater to indicate work has started on the task, specifying the total amount of work that this task constitutes.

Specified by:
beginTask in interface ProgressMonitor
Overrides:
beginTask in class ProgressMonitorWrapper
Parameters:
totalWork - the total number of work units for the task
name - the name of the task
params - the parameters for localization

done

public void done()
Called by the Updater to mark this activity as complete. This method must be called, even if the activity has been cancelled.

Specified by:
done in interface ProgressMonitor
Overrides:
done in class ProgressMonitorWrapper

setCancelled

public void setCancelled(boolean value)
Called by an Observer to request the cancellation of this activity, or by the Updater to deny a prior cancellation request (i.e., when the activity completes before the Updater recognizes a cancellation request by an Observer).

Specified by:
setCancelled in interface ProgressMonitor
Overrides:
setCancelled in class ProgressMonitorWrapper
Parameters:
value - true if requesting the activity be cancelled.

worked

public void worked(double work)
Called by the Updater to report work completed for this task.

Specified by:
worked in interface ProgressMonitor
Overrides:
worked in class ProgressMonitorWrapper
Parameters:
work - the number of work units that have been worked


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.