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, java.util.Locale locale)
           
 
Method Summary
 void beginTask(double totalWork, I18n name, java.lang.Object... params)
          Start work on the task, specifying the total amount of work that this task constitutes.
 void done()
          Mark this task as being completed. This method must be called for the task to be properly completed.
 void setCancelled(boolean value)
          Set the cancelled state of this activity. Cancelling the activity must be considered a request that can be denied by setting the cancelled state to false.
 void worked(double work)
          Report work completed for this task.
 
Methods inherited from class org.jboss.dna.common.monitor.ProgressMonitorWrapper
createSubtask, getActivityName, getStatus, getWrappedMonitor, isCancelled
 
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,
                              java.util.Locale locale)
Method Detail

beginTask

public void beginTask(double totalWork,
                      I18n name,
                      java.lang.Object... params)
Start work 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()
Mark this task as being completed. This method must be called for the task to be properly completed.

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

setCancelled

public void setCancelled(boolean value)
Set the cancelled state of this activity. Cancelling the activity must be considered a request that can be denied by setting the cancelled state to false.

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)
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. All Rights Reserved.