Skip to content

Java Method Reference

Mark Taylor edited this page Jan 9, 2014 · 3 revisions

The background service provides various methods that may be overriden within the background service that you develop.

[doWork] (doWork)

Method is intended to used by derived background services to provide the actual program logic. This is the most critical method to override, otherwise no action will occur from the background service.

[getConfig] (getConfig)

Method is used to produce the configuration JSON object to be provided to the HTML/ Javascript front-end.

[setConfig] (setConfig)

Method is used to receive the configuration provided by the HTML/ Javascript front-end. It is the responsibility of the method to process the configuration and process as appropriate.

[initialiseLatestResult] (initialiseLatestResult)

Method is used to allow you to initialize the result. This allows for your background service to set results that will be returned to the HTML/ Javascript Front-End in the [Returned JSON] (Returned-JSON) before [doWork] (doWork) has had run (and thus set the result).

[onTimerEnabled] (onTimerEnabled)

Method that allows you to provide logic when the background service timer is enabled.

[onTimerDisabled] (onTimerDisabled)

Method that allows you to provide logic when the background service timer is disabled.

[onPause] (onPause)

Method that allows you to provide logic when the background service is paused.

[onPauseComplete] (onPauseComplete)

Method that allows you to provide logic when the background service has completed any pause.

[runOnce] (runOnce-Java)

Method that allows you to call the [doWork] (doWork) manually without the need for the timer.