quartz
参考
Trigger That Fires Every 5 Minutes Between 8:15 AM and 5:30 PM (every day)
// Define the Trigger (fires on the fifth working day of every month at 5:00 PM)
CronTrigger testTrigger = new CronTrigger("testTrigger", "TEST", "0 0/5 * * * ?"); //every five minutes
testTrigger.setJobName("TestJob");
testTrigger.setJobGroup("TEST")
// Define the Calendar
DailyCalendar dailyCal = new DailyCalendar("dailyCalendar", "8:15", "17:30");
//This creates a calendar which excludes the time range we want.
// We need to the calendar to exclude all but the time range we've defined.
// By inverting the time range, we tell the calendar to exclude all times that
// do not fall in the specified time range:
dailyCal.setInvertTimeRange(true);
//add the calendar to the scheduler
sched.addCalendar("dailyCalendar", dailyCal, true, true);
//associate the calendar with the trigger
testTrigger.setCalendarName("dailyCalendar");
//schedule the trigger
sched.scheduleJob(testTrigger);
参考2