public class SimpleProgressGauge extends DestroyableBase implements ProgressGauge
ProgressGauge.Listener
Destroyable.Util
logger
Constructor and Description |
---|
SimpleProgressGauge() |
SimpleProgressGauge(int maxHint) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProgressGauge.Listener listener)
Add an listener to this gauge that monitors the progress update
|
int |
currentProgressPercent() |
int |
currentSteps()
Report the current progress steps
|
boolean |
done()
Mark the progress has been finished
|
int |
getCurrentSteps() |
java.lang.String |
getId() |
int |
getMaxHint() |
int |
getProgressPercent() |
int |
maxHint()
Returns the max hint
|
protected void |
releaseResources() |
void |
setId(java.lang.String id)
Set ID to the gauge
|
void |
step()
Advances the progress by one step
|
void |
stepBy(int steps)
Advances the progress by specified steps
|
void |
stepTo(int steps)
Log progress
|
void |
updateMaxHint(int maxHint)
Update max hint.
|
static SimpleProgressGauge |
wrap(ProgressGauge progressGauge) |
static java.lang.String |
wsJobProgressTag(java.lang.String jobId) |
addSubResource, destroy, isDestroyed, reload, scope
debug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isTraceEnabled, trace, trace, warn, warn
public SimpleProgressGauge(int maxHint)
public SimpleProgressGauge()
protected void releaseResources()
releaseResources
in class DestroyableBase
public void addListener(ProgressGauge.Listener listener)
ProgressGauge
Add an listener to this gauge that monitors the progress update
addListener
in interface ProgressGauge
listener
- the listenerpublic void updateMaxHint(int maxHint)
ProgressGauge
Update max hint. If the number is negative, then it indicate the progress is indefinite
updateMaxHint
in interface ProgressGauge
maxHint
- the max steps hintpublic void step()
ProgressGauge
Advances the progress by one step
step
in interface ProgressGauge
public void stepBy(int steps)
ProgressGauge
Advances the progress by specified steps
stepBy
in interface ProgressGauge
steps
- the step sizepublic void stepTo(int steps)
ProgressGauge
Log progress
stepTo
in interface ProgressGauge
steps
- the new progress valuepublic int currentSteps()
ProgressGauge
Report the current progress steps
currentSteps
in interface ProgressGauge
public int getCurrentSteps()
public int maxHint()
ProgressGauge
Returns the max hint
maxHint
in interface ProgressGauge
public int getMaxHint()
public void setId(java.lang.String id)
ProgressGauge
Set ID to the gauge
setId
in interface ProgressGauge
id
- the gauge IDpublic java.lang.String getId()
public int currentProgressPercent()
public int getProgressPercent()
public boolean done()
ProgressGauge
Mark the progress has been finished
done
in interface ProgressGauge
public static SimpleProgressGauge wrap(ProgressGauge progressGauge)
public static java.lang.String wsJobProgressTag(java.lang.String jobId)
Copyright © 2014–2017 ActFramework. All rights reserved.