Skip navigation links


oracle.idm.util.progress
Class ProgressMonitor

java.lang.Object
  extended by oracle.idm.util.progress.ProgressReporter
      extended by oracle.idm.util.progress.ProgressProcessor
          extended by oracle.idm.util.progress.ProgressMonitor

All Implemented Interfaces:
java.lang.Runnable

public class ProgressMonitor
extends ProgressProcessor

The ProgressMonitor object is used to monitor execution of lengthy monolithic operations, that otherwise do not provide any indication of their progress. This is a convenient way to monitor progress, but it provides only current duration information.

When a ProgressMonitor is started by calling the start() method, a new timer task is created in the timer thread associated with the ProgressManager class. This task runs at intervals as specified by the ProgressMamager interval property, and it timeouts as specified by the ProgressManager timeout property.


Field Summary
static Transitions TRANSITIONS
          State transition model (null is the pre-initial state):

 

Fields inherited from class oracle.idm.util.progress.ProgressProcessor
ABORTED, CANCELED, FINISHED, progressEventDurationInfo, progressEventLocalizedMessage, progressEventMessage, progressEventName, progressEventPercentInfo, progressEventProgressInfo, progressEventStateInfo, progressEventStatusInfo, progressEventStepInfo, progressEventThrowable, RESTORED, RESUMED, STARTED, STOPPED, SUSPENDED, TIMEDOUT, transitions

 

Constructor Summary
ProgressMonitor(ProgressManager manager, java.lang.Runnable runnable)
          Creates an instance of a ProgressMonitor.
ProgressMonitor(java.lang.Runnable runnable)
          Creates an instance of a ProgressMonitor.

 

Method Summary
 long getInterval()
          Getter for the interval property.
 java.lang.String getProgressEventLocalizedMessage()
          Getter for the progressEventLocalizedMessage property.
 java.lang.String getProgressEventMessage()
          Getter for the progressEventMessage property.
 java.lang.String getProgressEventName()
          Getter for the progressEventName property.
 java.lang.Object getProgressEventProgressInfo()
          Getter for the progressEventProgressInfo property.
protected  void process(boolean quiet)
          This method first sends a start progress event the progress listeners.
 void setInterval(long interval)
          Setter for the interval property.
 void setProgressEventLocalizedMessage(java.lang.String localizedMessage)
          Setter for the progressEventLocalizedMessage property.
 void setProgressEventMessage(java.lang.String message)
          Setter for the progressEventMessage property.
 void setProgressEventName(java.lang.String name)
          Setter for the progressEventName property.
 void setProgressEventProgressInfo(java.lang.Object progressInfo)
          Setter for the progressEventProgressInfo property.
 void start()
          This method calls process(false);

 

Methods inherited from class oracle.idm.util.progress.ProgressProcessor
abort, block, block, block, canAbort, canCancel, cancel, cancel, canFinish, canReset, canRestore, canResume, canStart, canStop, canSuspend, canTimeout, canTransition, finish, getProgressEvent, getProgressEventDurationInfo, getProgressEventPercentInfo, getProgressEventStateInfo, getProgressEventStatusInfo, getProgressEventStepInfo, getProgressEventThrowable, getTransitions, isAborted, isCanceled, isFinal, isFinished, isInitial, isIntermediate, isNext, isPrevious, isReachable, isReset, isRestored, isResumed, isStarted, isStopped, isSuspended, isTimedout, isUnreachable, ping, reset, restore, resume, resume, run, sendProgressEvent, setTransitions, start, stop, stop, suspend, suspend, timeout, transition

 

Methods inherited from class oracle.idm.util.progress.ProgressReporter
clearTransient, continuing, getDuration, getErrorTotal, getException, getLocalizedMessage, getLocalizedMessages, getMessage, getMessages, getProgressManager, getRuntimeException, getStateCurrent, getStateTimeStamp, getTimeout, getTransient, getWarningTotal, hasTimedout, isStateCurrent, isTransient, markTransient, resetDuration, sendProgressEvent, setErrorTotal, setProgressManager, setStateCurrent, setStateTimeStamp, setTimeout, setWarningTotal, throwErrorOrException, throwErrorOrRuntimeException, throwException, throwRuntimeException, unmarkTransient

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

TRANSITIONS

public static final Transitions TRANSITIONS
State transition model (null is the pre-initial state):
 null -> STARTED
 STARTED -> [ FINISHED | ABORTED | TIMEDOUT ]
 

Constructor Detail

ProgressMonitor

public ProgressMonitor(java.lang.Runnable runnable)
Creates an instance of a ProgressMonitor. Users of this package can also create instances of ProgressMonitor via the getProgressMonitor factory method in the ProgressManager class.
Parameters:
runnable - Runnable whose progress will to be monitored.
See Also:
ProgressManager.getProgressMonitor(java.lang.Runnable)

ProgressMonitor

public ProgressMonitor(ProgressManager manager,
                       java.lang.Runnable runnable)
Creates an instance of a ProgressMonitor. Users of this package can also create instances of ProgressMonitor via the getProgressMonitor factory method in the ProgressManager class.
Parameters:
manager - ProgressManager that manages this ProgressMonitor.
runnable - Runnable whose progress will to be monitored.
See Also:
ProgressManager.getProgressMonitor(java.lang.Runnable)

Method Detail

getInterval

public long getInterval()
Getter for the interval property. The interval property is used by the ProgressMonitor when reporting progress events. The default value is 1000L.
See Also:
ProgressMonitor

setInterval

public void setInterval(long interval)
Setter for the interval property.
Parameters:
interval - The interval at which progress events are reported by the ProgressMonitor.
See Also:
getInterval()

getProgressEventName

public java.lang.String getProgressEventName()
Getter for the progressEventName property.
Overrides:
getProgressEventName in class ProgressProcessor
Returns:

setProgressEventName

public void setProgressEventName(java.lang.String name)
Setter for the progressEventName property.
Parameters:
name -

getProgressEventMessage

public java.lang.String getProgressEventMessage()
Getter for the progressEventMessage property.
Overrides:
getProgressEventMessage in class ProgressProcessor
Returns:

setProgressEventMessage

public void setProgressEventMessage(java.lang.String message)
Setter for the progressEventMessage property.
Parameters:
message -

getProgressEventLocalizedMessage

public java.lang.String getProgressEventLocalizedMessage()
Getter for the progressEventLocalizedMessage property.
Overrides:
getProgressEventLocalizedMessage in class ProgressProcessor
Returns:

setProgressEventLocalizedMessage

public void setProgressEventLocalizedMessage(java.lang.String localizedMessage)
Setter for the progressEventLocalizedMessage property.
Parameters:
message -

getProgressEventProgressInfo

public java.lang.Object getProgressEventProgressInfo()
Getter for the progressEventProgressInfo property.
Overrides:
getProgressEventProgressInfo in class ProgressProcessor
Returns:

setProgressEventProgressInfo

public void setProgressEventProgressInfo(java.lang.Object progressInfo)
Setter for the progressEventProgressInfo property.
Parameters:
info -

start

public void start()
           throws java.lang.Exception
This method calls process(false);
Overrides:
start in class ProgressProcessor
Throws:
java.lang.Exception

process

protected void process(boolean quiet)
                throws java.lang.Exception
This method first sends a start progress event the progress listeners. Then, it creates a new timer task to monitor the execution of the monolithic operation. It schedules the timer to run with intervals and timeouts as specified in by the progress manager instance. Then it calls run() metod of the runnable in the invoking thread. If the run() method throws an exception, it will be reported as with ERROR status of an abort progress event. If it terminates normally, a finish progress event will be sent.
Specified by:
process in class ProgressProcessor
Parameters:
event -
Throws:
java.lang.Exception

Skip navigation links