
public final class AgentPeriodicTaskService extends Object implements ServiceLifecycle, HasLifecycle, ClearAlertHandler, AgentService
| Modifier and Type | Class and Description |
|---|---|
class |
AgentPeriodicTaskService.AgentPeriodicTaskExecutionHandler |
ClearAlertHandler.ClearAlertCode| Constructor and Description |
|---|
AgentPeriodicTaskService() |
| Modifier and Type | Method and Description |
|---|---|
void |
build()
First lifecycle hook.
|
ClearAlertHandler.ClearAlertCode |
canClearAlert(Alert alert,
AlertState state)
Callback to clear an
Alert instance. |
Scheduler |
createScheduler(String name,
int nThreads)
Create a scheduler by name and the default number of threads.
|
List<String> |
getAgentPeriodicTaskNames()
Get the list of names of the scheduled tasks.
|
String |
getAgentServiceName()
Get the name of this service.
|
Duration |
getPeriodicTaskPeriod(String taskName)
Get the period of a PeriodicTaks.
|
void |
init()
Called from the enclosing
Subsystem at initialization
phase. |
void |
preBuild() |
void |
preInit() |
void |
scheduleAgentPeriodicTask(AgentPeriodicTask task)
Schedule a PeriodicTask.
|
void |
scheduleAgentPeriodicTask(AgentPeriodicTask task,
String schedulerName) |
void |
setPeriodicTaskPeriod(String taskName,
Duration period)
Change the period of a PeriodicTask.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterInit, afterStart, preShutdown, preStartpostBuild, postInit, postShutdown, postStart, shutdown, startstartForAgentpublic String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic void preBuild()
preBuild in interface ServiceLifecyclepublic void build()
HasLifecyclebuild in interface HasLifecyclepublic void preInit()
preInit in interface ServiceLifecyclepublic void init()
HasLifecycleSubsystem at initialization
phase.
This method is called before the children components of this
object have their init method called.
At the time it is called, connection to the messaging layer is not yet
done, so there should be no attempt to send messages in the body of
this method. Configuration for message listening can nevertheless be
done here, such as adding MessageListener
objects.
It is unnecessary to call super.init()
init in interface HasLifecyclepublic Scheduler createScheduler(String name, int nThreads)
name - nThreads - public void scheduleAgentPeriodicTask(AgentPeriodicTask task)
task - The PeriodicTask to schedulepublic void scheduleAgentPeriodicTask(AgentPeriodicTask task, String schedulerName)
public Duration getPeriodicTaskPeriod(String taskName)
taskName - The name of the taskpublic void setPeriodicTaskPeriod(String taskName, Duration period)
taskName - The name of the taskperiod - The period Duration@Command(name="getAgentPeriodicTaskNames", description="Get the list of the names of the scheduled tasks", type=QUERY, category=SYSTEM) public List<String> getAgentPeriodicTaskNames()
public ClearAlertHandler.ClearAlertCode canClearAlert(Alert alert, AlertState state)
ClearAlertHandlerAlert instance.
Return a ClearAlertCode for the provided Alert.canClearAlert in interface ClearAlertHandleralert - The Alert instance to clear.state - The AlertState for the provided Alert.Copyright © 2021 LSST. All rights reserved.