| example.PeriodicTaskMBean
All known Subclasses: example.PeriodicTask,
PeriodicTaskMBean | public interface PeriodicTaskMBean (Code) | | Perform a task and keep track of statistics.
|
Method Summary | |
public long | getAverageActiveTime() The average amount of time the task has taken. | public long | getEstimatedAverageTime() The estimated amount of milliseconds that the task will take,
used when the PeriodicTask has not been run yet so no historical data
is available. | public long | getEstimatedTimeRemaining() | public long | getLastActiveTime() The last time the task was started. | public long | getTotalActiveCount() The number of times the task has been performed. | public long | getTotalActiveTime() The total amount of time the tasks have taken. | public boolean | isActive() True if the task is currently active. | public void | run() Execute the task. | public void | setEstimatedAverageTime(long estimatedAverageTime) The estimated amount of milliseconds that the task will take,
used when the PeriodicTask has not been run yet so no historical data
is available. |
getAverageActiveTime | public long getAverageActiveTime()(Code) | | The average amount of time the task has taken.
If the task has never been run, then the estimatedAverageTime is returned.
the average active time, in milliseconds |
getEstimatedAverageTime | public long getEstimatedAverageTime()(Code) | | The estimated amount of milliseconds that the task will take,
used when the PeriodicTask has not been run yet so no historical data
is available.
|
getEstimatedTimeRemaining | public long getEstimatedTimeRemaining()(Code) | | If currently active, how much longer will the task take?
the estimate in milliseconds, 0 if not currently active |
getLastActiveTime | public long getLastActiveTime()(Code) | | The last time the task was started.
the last active time, in milliseconds since the epoch |
getTotalActiveCount | public long getTotalActiveCount()(Code) | | The number of times the task has been performed.
|
getTotalActiveTime | public long getTotalActiveTime()(Code) | | The total amount of time the tasks have taken.
the total active time, in milliseconds |
isActive | public boolean isActive()(Code) | | True if the task is currently active.
|
run | public void run()(Code) | | Execute the task. Only one execution of the task can take place at a
time, if the task is currently active, this method returns immediately.
|
setEstimatedAverageTime | public void setEstimatedAverageTime(long estimatedAverageTime)(Code) | | The estimated amount of milliseconds that the task will take,
used when the PeriodicTask has not been run yet so no historical data
is available. Default is 5000.
|
|
|