|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.datapower.wamt.clientAPI.MacroProgressContainer
public class MacroProgressContainer
A MacroProgressContainer
is a container for multiple
ProgressContainers. This class is typically used for ManagedSet
operations, since a ManagedSet
typical contains multiple
Device
objects, and long running operations performed on
Device
are wrapped in a ProgressContainer
.
The execution of MacroProgressContainer
is considered to have an
error if any of the individual ProgressContainer
tasks have an error.
The execution of a MacroProgressContainer
is considered to be complete
only when all of ProgressContainer
tasks it contains objects are complete.
A MacroProgressContainer
may find an exception in any of its nested
ProgressContainer
objects, or it may have an exception itself. A
MacroProgressContainer
can wait for all the nested ProgressContainer
objects to be complete, and it must wait for itself to be marked complete. However, a
MacroProgressContainer
doesn't have any steps or step descriptions itself,
those come only from the nested ProgressContainer
objects.
ProgressContainer
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT_2009_2013
|
static int |
DEFAULT_SLEEP_MS
The default time for the sleep interval while polling for update or completion. |
Method Summary | |
---|---|
void |
blockAndTrace(java.util.logging.Level level)
A convenience method for waiting for the tasks to complete and printing the progress of each step for each nested ProgressConatiner. |
java.lang.Object |
getCorrelator()
Get the correlator for this MacroProgressContainer. |
int |
getCurrentStep()
Get the current step which indicates the progress across the total number of steps in this MacroContainer. |
java.lang.String |
getCurrentStepDescription()
Get the description of the most recently updated step across all the nested ProgressContainers. |
java.lang.Exception |
getError()
Return the Exception from any of the nested ProgressContainers or from this MacroProgressContainer. |
java.util.Hashtable |
getFailedTasks()
|
ProgressContainer[] |
getProgressContainers()
Returns the nested ProgressContainers for any returned values or errors. |
int |
getSleepInterval()
Gets the interval between checks through all the nested ProgressContainers for any that may have had an update. |
Task |
getTask()
Get the Task for which this MacroProgressContainer has been created. |
int |
getTotalSteps()
Get the total number of steps across all the nested ProgressContainers. |
boolean |
hasError()
Check if any of the nested ProgressContainers or this MacroProgressContainer has an error set. |
boolean |
hasUpdate()
Check if any of the nested ProgressContainers has an update. |
boolean |
isComplete()
Check if this MacroProgressContainer is complete. |
void |
setCorrelator(java.lang.Object correlator)
Set the correlator for this MacroProgressContainer. |
void |
setFailedTasks(java.util.Hashtable failedTasks)
|
void |
setSleepInterval(int ms)
Sets the interval between checks through all the nested ProgressContainers for any that may have had an update. |
java.lang.String |
toString()
Get a String representation of this object for the purpose of debugging or tracing. |
void |
waitForEnd()
Block until all of the nested ProgressContainers are complete. |
void |
waitForUpdate()
Block until one of the nested ProgressContainers has an update. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_SLEEP_MS
setSleepInterval(int)
,
Constant Field Valuespublic static final java.lang.String COPYRIGHT_2009_2013
Method Detail |
---|
public int getSleepInterval()
setSleepInterval(int)
.
setSleepInterval(int)
,
waitForUpdate()
,
waitForEnd()
public void setSleepInterval(int ms)
waitForUpdate()
or
waitForEnd()
will return if any of them get an update. Because
polling must be used, this is how long waitForUpdate()
or
waitForEnd()
method should wait before checking all the
ProgressContainers for update or completion. You should pick a value here
that is a good balance between responsiveness and consuming too much CPU
doing the poll.
ms
- the interval between checks through all the nested
ProgressContainers for any that may have had an update. If not set
explicitly, the default is DEFAULT_SLEEP_MS
.getSleepInterval()
,
waitForUpdate()
,
waitForEnd()
public void waitForUpdate() throws java.lang.InterruptedException
setSleepInterval(int)
until the next check.
ProgressContainer.waitForUpdate()
,
hasUpdate()
public void waitForEnd() throws java.lang.InterruptedException
setSleepInterval(int)
until the next
check.
ProgressContainer.waitForEnd()
,
isComplete()
public boolean hasUpdate()
waitForUpdate()
,
ProgressContainer.hasUpdate()
public int getTotalSteps()
ProgressContainer.getTotalSteps()
,
getCurrentStep()
public Task getTask()
ProgressContainer.getTask()
public int getCurrentStep()
getTotalSteps()
,
ProgressContainer.getCurrentStep()
,
getCurrentStepDescription()
public java.lang.String getCurrentStepDescription()
getCurrentStep()
,
ProgressContainer.getCurrentStepDescription()
public boolean isComplete()
ProgressContainer.isComplete()
,
waitForEnd()
public boolean hasError()
ProgressContainer.hasError()
,
getError()
public java.lang.Exception getError()
hasError()
,
ProgressContainer.getError()
public void setCorrelator(java.lang.Object correlator)
correlator
- a user-defined value. It does not affect the correlator
for any of the nested ProgressContainers.getCorrelator()
,
ProgressContainer.setCorrelator(Object)
public java.lang.Object getCorrelator()
setCorrelator(Object)
.
setCorrelator(Object)
,
ProgressContainer.getCorrelator()
public java.lang.String toString()
toString
in class java.lang.Object
public ProgressContainer[] getProgressContainers()
public void setFailedTasks(java.util.Hashtable failedTasks)
public java.util.Hashtable getFailedTasks()
public void blockAndTrace(java.util.logging.Level level)
level
- the log level at which to generate the text messages
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |