public class ProgressStatusMirroringImpl extends ProgressStatusBase
ProgressStatusBase.ChildProgressStatuschildren, completed, currentStepCount, id, name, parent, totalStepCount| Constructor and Description |
|---|
ProgressStatusMirroringImpl(String name,
ProgressStatusBase parent,
String id) |
| Modifier and Type | Method and Description |
|---|---|
float |
computeCompletePortion() |
protected float |
computeCompleteSteps() |
ProgressStatus |
createChild(String name,
int allocatedSteps,
int totalStepCount)
Ignores allocated steps.
|
protected ProgressStatusBase |
doCreateChild(String name,
int totalStepCount) |
protected void |
fireEvent(ProgressStatusEvent event)
Fires
ProgressStatusEvent to parent. |
void |
progress(int steps,
String message)
Indicates progress occurred.
|
void |
setCurrentStepCount(int stepCount)
This allows the current step count to be changed to a specific value,
for example when an error occurs and the command must repeat a set
of operations.
This will likely result in the overall completion percentage jumping when the next progress() message is generated. |
void |
setTotalStepCount(int totalStepCount)
Number of steps necessary to complete the operation.
|
allocateStapsForChildProcess, complete, complete, completeSilently, computeSumSteps, createChild, createChild, findById, getChildProgressStatuses, getChildren, getCurrentStepCount, getId, getName, getParrent, getRemainingStepCount, getTotalStepCount, isComplete, progress, progress, progress, toStringpublic ProgressStatusMirroringImpl(String name, ProgressStatusBase parent, String id)
protected ProgressStatusBase doCreateChild(String name, int totalStepCount)
doCreateChild in class ProgressStatusBasepublic void setTotalStepCount(int totalStepCount)
ProgressStatusorg.glassfish.api.Progress annotation.
The total step count is used as the denominator for computing the
completion percentage as reported in the command's progress output:
percent complete = current step count / total step count * 100
Note the above formula is a bit more complex when child ProgressStatus
objects are in use.
The total step count can be changed after being set but may result in the completion percentage jumping (forward or backwards).
If the total step count is not set then a completion percentage will not be available.
It can be also set during injection using totalStepCount
parameter in org.glassfish.api.Progress annotation.
setTotalStepCount in interface ProgressStatussetTotalStepCount in class ProgressStatusBasetotalStepCount - non-negative value defines denominator for
the percentage computationpublic void progress(int steps,
String message)
ProgressStatusprogress in interface ProgressStatusprogress in class ProgressStatusBasesteps - the number of steps taken. Negative steps will reduce
the completion percentage. Never to non-negative value.message - to be displayed by the client.public void setCurrentStepCount(int stepCount)
ProgressStatussetCurrentStepCount in interface ProgressStatussetCurrentStepCount in class ProgressStatusBasestepCount - new stepCount value. Negative is normalized to 0
greater than the total step count is normalized to the total step
countpublic ProgressStatus createChild(String name, int allocatedSteps, int totalStepCount)
createChild in class ProgressStatusBaseprotected void fireEvent(ProgressStatusEvent event)
ProgressStatusBaseProgressStatusEvent to parent.fireEvent in class ProgressStatusBaseprotected float computeCompleteSteps()
computeCompleteSteps in class ProgressStatusBasepublic float computeCompletePortion()
computeCompletePortion in class ProgressStatusBaseCopyright © 2017–2020 Eclipse Foundation. All rights reserved.