I am using Quartz to run some frequent operations , but for that I need to externalize the cron expression to be driven from any property file on server so that User can modify it without opening my war
<?xml version='1.0' encoding='utf-8'?> <job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd" version="1.8"> <schedule> <job> <name>my-very-clever-job</name> <group>MYJOB_GROUP</group> <description>The job description</description> <job-class>com.acme.scheduler.job.CleverJob</job-class> <job-data-map allows-transient-data="false"> <entry> <key>burger-type</key> <value>hotdog</value> </entry> <entry> <key>dressing-list</key> <value>ketchup,mayo</value> </entry> </job-data-map> </job> <trigger> <cron> <name>my-trigger</name> <group>MYTRIGGER_GROUP</group> <job-name>my-very-clever-job</job-name> <job-group>MYJOB_GROUP</job-group> <!-- trigger every night at 4:30 am --> <!-- do not forget to light the kitchen's light --> <cron-expression>0 30 4 * * ?</cron-expression> </cron> </trigger> </schedule> </job-scheduling-data>
No comments:
Post a Comment