public class ProgressStatusMirroringImpl extends ProgressStatusBase
ProgressStatusBase.ChildProgressStatus
children, 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, toString
public ProgressStatusMirroringImpl(String name, ProgressStatusBase parent, String id)
protected ProgressStatusBase doCreateChild(String name, int totalStepCount)
doCreateChild
in class ProgressStatusBase
public void setTotalStepCount(int totalStepCount)
ProgressStatus
org.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 ProgressStatus
setTotalStepCount
in class ProgressStatusBase
totalStepCount
- non-negative value defines denominator for
the percentage computationpublic void progress(int steps, String message)
ProgressStatus
progress
in interface ProgressStatus
progress
in class ProgressStatusBase
steps
- 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)
ProgressStatus
setCurrentStepCount
in interface ProgressStatus
setCurrentStepCount
in class ProgressStatusBase
stepCount
- 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 ProgressStatusBase
protected void fireEvent(ProgressStatusEvent event)
ProgressStatusBase
ProgressStatusEvent
to parent.fireEvent
in class ProgressStatusBase
protected float computeCompleteSteps()
computeCompleteSteps
in class ProgressStatusBase
public float computeCompletePortion()
computeCompletePortion
in class ProgressStatusBase
Copyright © 2019. All rights reserved.