Class PeriodicService
java.lang.Object
com.cloudbees.sdk.extensibility.lifecycle.PeriodicService
- All Implemented Interfaces:
Startable
Base implementation for components that run periodical background task.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRun()Run from the web interface.protected longInitial delay in milliseconds to run the first execution, in milliseconds.protected abstract longCycle of execution, in milliseconds.protected abstract voidrun()Executes the periodic task.voidstart()Called once right after the Guice world is started, to provide an opportunity to start various objects.
-
Constructor Details
-
PeriodicService
public PeriodicService()
-
-
Method Details
-
start
Description copied from interface:StartableCalled once right after the Guice world is started, to provide an opportunity to start various objects.Exceptions thrown will terminate the system.
-
run
Executes the periodic task.- Throws:
Exception
-
doRun
Run from the web interface.- Throws:
Exception
-
getPeriod
protected abstract long getPeriod()Cycle of execution, in milliseconds. -
getInitialDelay
protected long getInitialDelay()Initial delay in milliseconds to run the first execution, in milliseconds.
-