com.jrockit.mc.flightrecorder.util
Class PrintStreamProgressMonitor

java.lang.Object
  extended by com.jrockit.mc.flightrecorder.util.PrintStreamProgressMonitor
All Implemented Interfaces:
IProgressMonitor

public final class PrintStreamProgressMonitor
extends java.lang.Object
implements IProgressMonitor

Simple IProgressMonitor that just write progress information to System.err or System.out, by default. FIXME: Better handling i18n

Author:
Erik Gahlin

Constructor Summary
PrintStreamProgressMonitor()
           
 
Method Summary
 void beginTask(int workUnits, java.lang.String formatString)
          Called when a task begins.
 boolean cancel()
          Cancels the current task.
 void done()
          Finished with all the work
 void doWork(int work)
          Do some work
 void endTask()
          Called when the current task is finished
 void log(Severity severity, java.lang.String message, java.lang.Throwable te)
          Logs an error/warning
 void setPrintStream(java.io.PrintStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintStreamProgressMonitor

public PrintStreamProgressMonitor()
Method Detail

cancel

public boolean cancel()
Description copied from interface: IProgressMonitor
Cancels the current task.

Specified by:
cancel in interface IProgressMonitor
Returns:
true if success

setPrintStream

public void setPrintStream(java.io.PrintStream stream)

endTask

public void endTask()
Description copied from interface: IProgressMonitor
Called when the current task is finished

Specified by:
endTask in interface IProgressMonitor

doWork

public void doWork(int work)
Description copied from interface: IProgressMonitor
Do some work

Specified by:
doWork in interface IProgressMonitor
Parameters:
work - the number of units to work

done

public void done()
Description copied from interface: IProgressMonitor
Finished with all the work

Specified by:
done in interface IProgressMonitor

beginTask

public void beginTask(int workUnits,
                      java.lang.String formatString)
Description copied from interface: IProgressMonitor
Called when a task begins.

Specified by:
beginTask in interface IProgressMonitor

log

public void log(Severity severity,
                java.lang.String message,
                java.lang.Throwable te)
Description copied from interface: IProgressMonitor
Logs an error/warning

Specified by:
log in interface IProgressMonitor
Parameters:
severity - the severity
message - the message
te - an optional Throwable. Null if N/A


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.