...
Your class should extend AbstractTask
Examples
httphttps://sourcegithub.com/openmrs.org/browseopenmrs-core/OpenMRStree/trunkmaster/api/src/main/java/org/openmrs/scheduler/tasks
Authentication
As of 1.7.0 tasks are executed as the Daemon User. This gives them all privileges without having to use Context.addProxyPrivilege().