I place my jobs in the database table TURBINE_SCHEDULED_JOB
and on every restart of turbine, the scheduler service does pick up the Task in the table entry
I created a package entry for all my scheduled services as such
com.kiasoft.appname.modules.scheduledjobs.*
in my source tree.
mysql> select * from TURBINE_SCHEDULED_JOB;
+--------+--------+--------+------+----------+--------------+----------------------+---------------------+----------+
| JOB_ID | SECOND | MINUTE | HOUR | WEEK_DAY | DAY_OF_MONTH | TASK | EMAIL | PROPERTY |
+--------+--------+--------+------+----------+--------------+----------------------+---------------------+----------+
| 1 | 0 | 30 | -1 | -1 | -1 | NoticeAgent | [EMAIL PROTECTED] | NULL |
+--------+--------+--------+------+----------+--------------+----------------------+---------------------+----------+
1 row in set (0.00 sec)
so this maps to com.kiasoft.appname.modules.scheduledjobs.NoticeAgent class file
check your TurbineResources.properties for the following entries
# pick up our private modules
module.packages=com.kiasoft.appname.modules
# AND
# -------------------------------------------------------------------
#
# S C H E D U L E R S E R V I C E
#
# -------------------------------------------------------------------
# # Set enabled to true to start the scheduler. # scheduler.enabled=true
I'm not exactly sure why this works or how scheduler knows to look for scheduledjobs in that particular class heirarchy as it has been a while since I wrote the scheduled service.. I just know that this is currently working for me.
I know that there is a way to also hard code your scheduled jobs to be picked up from the TurbineResources.properties file as well rather than the database entry but I never experimented with that route.
Thanks,
Jeff Painter
[EMAIL PROTECTED]
Konrad Rokicki wrote:
What is the best place to put the code to add a job to the SchedulerService if I want it to run when the server starts? Thanks, Konrad Rokicki
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
