Package com.cmobilecom.af.util
Class AbstractProgress
- java.lang.Object
-
- com.cmobilecom.af.util.AbstractProgress
-
- All Implemented Interfaces:
Progress
- Direct Known Subclasses:
EntityProgressProperty.ProgressImpl
public abstract class AbstractProgress extends java.lang.Object implements Progress
Progress Implementation base. A module, representing a workload, can create a number of child modules.- Since:
- 1.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.cmobilecom.af.util.Progress
Progress.Module
-
-
Constructor Summary
Constructors Constructor Description AbstractProgress()
Create a progress with root module.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModulePercentageCompleted(double percentageToAdd)
Add work percentage completed to the active module.void
addProgressListener(ProgressListener listener)
Add progress listener.void
completeChildModule(Progress.Module module)
Complete the current active child modulevoid
done()
Set root module completed percentage.static void
logMessage(org.slf4j.Logger logger, org.slf4j.event.Level level, java.lang.String message)
Log message using the logger.Progress.Module
startChildModule(int percentage)
Start a child module.Progress.Module
startNextChildModule(Progress.Module module, int percentage)
Complete the current active child module, and start next child module.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.cmobilecom.af.util.Progress
getLogger, logMessage, writeStatusMessage
-
-
-
-
Method Detail
-
startChildModule
public Progress.Module startChildModule(int percentage)
Description copied from interface:Progress
Start a child module. After the child module is created, it becomes active module.- Specified by:
startChildModule
in interfaceProgress
- Parameters:
percentage
- the child module workload percentage of the current module.- Returns:
- a Progress module
-
completeChildModule
public void completeChildModule(Progress.Module module)
Description copied from interface:Progress
Complete the current active child module- Specified by:
completeChildModule
in interfaceProgress
- Parameters:
module
- active child module
-
startNextChildModule
public Progress.Module startNextChildModule(Progress.Module module, int percentage)
Description copied from interface:Progress
Complete the current active child module, and start next child module.- Specified by:
startNextChildModule
in interfaceProgress
- Parameters:
module
- the current active modulepercentage
- the percentage of the next module workload among its sibling modules- Returns:
- the next module started
-
addModulePercentageCompleted
public void addModulePercentageCompleted(double percentageToAdd)
Add work percentage completed to the active module.- Specified by:
addModulePercentageCompleted
in interfaceProgress
- Parameters:
percentageToAdd
- 0 to 100
-
done
public void done()
Set root module completed percentage.
-
addProgressListener
public void addProgressListener(ProgressListener listener)
Description copied from interface:Progress
Add progress listener.- Specified by:
addProgressListener
in interfaceProgress
- Parameters:
listener
- the listener to add
-
logMessage
public static void logMessage(org.slf4j.Logger logger, org.slf4j.event.Level level, java.lang.String message)
Log message using the logger.- Parameters:
logger
- loggerlevel
- log levelmessage
- the message to log- Since:
- 5.9
-
-