| java.lang.Object java.util.TimerTask org.apache.roller.business.runnable.RollerTask
All known Subclasses: org.apache.roller.business.runnable.ResetHitCountsTask, org.apache.roller.planet.tasks.SyncWebsitesTask, org.apache.roller.planet.tasks.RefreshEntriesTask, org.apache.roller.planet.tasks.TechnoratiRankingsTask, org.apache.roller.business.runnable.TurnoverReferersTask, org.apache.roller.business.pings.PingQueueTask,
RollerTask | abstract public class RollerTask extends TimerTask (Code) | | An abstract class representing a scheduled task in Roller.
This class extends the java.util.TimerTask class and builds in some Roller
specifics, such as handling of locks for synchronization in clustered
environments.
|
Method Summary | |
protected Date | getAdjustedTime(Date startTime, String changeFactor) A convenience method for calculating an adjusted time given an initial
Date to work from and a "changeFactor" which describes how the time
should be adjusted. | abstract public int | getInterval() How often should the task run, in seconds. | abstract public int | getLeaseTime() Get the time, in seconds, this task wants to be leased for. | abstract public String | getName() Get the unique name for this task. | abstract public Date | getStartTime(Date currentTime) When should this task be started? The task is given the current time
so that it may determine a start time relative to the current time,
such as the end of the day or hour.
It is acceptable to return the currentTime object passed in or any other
time after it. | protected Properties | getTaskProperties() Get the properties from RollerConfig which pertain to this task. | public void | init() Initialization. | final public void | run() The run() method as called by our thread manager.
This method is purposely defined as "final" so that any tasks that are
defined may not override it and remove any of its functionality. | abstract public void | runTask() Run the task. |
getAdjustedTime | protected Date getAdjustedTime(Date startTime, String changeFactor)(Code) | | A convenience method for calculating an adjusted time given an initial
Date to work from and a "changeFactor" which describes how the time
should be adjusted.
Allowed change factors are ...
'immediate' - no change
'startOfHour' - top of the hour, beginning with next hour
'startOfDay' - midnight, beginning on the next day
|
getInterval | abstract public int getInterval()(Code) | | How often should the task run, in seconds.
example: 3600 means this task runs once every hour.
The interval the task should be run at, in minutes. |
getLeaseTime | abstract public int getLeaseTime()(Code) | | Get the time, in seconds, this task wants to be leased for.
example: 300 means the task is allowed 5 minutes to run.
The time this task should lease its lock for, in minutes. |
getName | abstract public String getName()(Code) | | Get the unique name for this task.
The unique name for this task. |
getStartTime | abstract public Date getStartTime(Date currentTime)(Code) | | When should this task be started? The task is given the current time
so that it may determine a start time relative to the current time,
such as the end of the day or hour.
It is acceptable to return the currentTime object passed in or any other
time after it. If the return value is before currentTime then it will
be ignored and the task will be started at currentTime.
Parameters: currentTime - The current time. The Date when this task should be started. |
getTaskProperties | protected Properties getTaskProperties()(Code) | | Get the properties from RollerConfig which pertain to this task.
This extracts all properties from the RollerConfig of the type
task..=value and returns them in a properties object
where each item is keyed by .
|
run | final public void run()(Code) | | The run() method as called by our thread manager.
This method is purposely defined as "final" so that any tasks that are
defined may not override it and remove any of its functionality. It is
setup to provide some basic functionality to the running of all tasks,
such as lock acquisition and releasing.
Roller tasks should put their logic in the runTask() method.
|
|
|