public final class AgentPeriodicTaskService extends Object implements ServiceLifecycle, HasLifecycle, AgentService
| Modifier and Type | Class and Description |
|---|---|
class |
AgentPeriodicTaskService.AgentPeriodicTaskExceptionHandler |
| Constructor and Description |
|---|
AgentPeriodicTaskService() |
| Modifier and Type | Method and Description |
|---|---|
void |
build()
First lifecycle hook.
|
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, waitafterBuild, afterInit, 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 DurationCopyright © 2022 LSST. All rights reserved.