
public class AgentPeriodicTask extends Object
Runnable to execute
- taskName name of this task
Other parameters that define the Periodic task are:
- isFixedRate true if this task will be executed at fixed rate, the default;
false if this task will be run with fixed delay
- logLevel level at which exceptions thrown by this task will be logged. By default
Level.SEVERE will be used;
- period the period between successive executions, or the delay between executions,
depending on the value of isFixedRate argument. By default the
task is configured to execute every second.
- unit the time unit of the period parameter, by default TimeUnit.MILLISECONDS| Constructor and Description |
|---|
AgentPeriodicTask(String taskName,
Runnable runnable)
Create a periodic task by name.
|
| Modifier and Type | Method and Description |
|---|---|
Level |
getLogLevel()
Get the log level at which exceptions will be logged.
|
Duration |
getPeriod()
Get the task period.
|
Runnable |
getRunnable()
Get the Runnable to be executed.
|
String |
getTaskName()
Get the name for this task.
|
boolean |
isIsFixedRate()
Get if the task is to be executed at fixed rated or fixed delay.
|
AgentPeriodicTask |
withIsFixedRate(boolean isFixedRate)
Set if the task is to be executed with fixed rate or fixed delay.
|
AgentPeriodicTask |
withLogLevel(Level logLevel)
Set the log level for this periodic task.
|
AgentPeriodicTask |
withPeriod(Duration period)
Set the period between successive executions, or the delay between executions,
depending on the value of
isFixedRate argument. |
public AgentPeriodicTask withIsFixedRate(boolean isFixedRate)
isFixedRate - true if this task will be executed at fixed rate;
false if this task will be run with fixed delaypublic AgentPeriodicTask withLogLevel(Level logLevel)
logLevel - level at which exceptions thrown by this task will be loggedpublic AgentPeriodicTask withPeriod(Duration period)
isFixedRate argument. The units of this
period are specified by the unit parameter.period - the period for this taskpublic Runnable getRunnable()
public boolean isIsFixedRate()
public String getTaskName()
public Level getLogLevel()
public Duration getPeriod()
Copyright © 2018 LSST. All rights reserved.