<servlet> <display-name>Quartz Initializer Servlet</display-name> <servlet-name>QuartzInitializer</servlet-name> <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class> <init-param> <param-name>config-file</param-name> <param-value>com/ineast/scheduler/quartz.properties</param-value> </init-param> <init-param> <param-name>shutdown-on-unload</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>start-scheduler-on-load</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <display-name>SchedulerInit</display-name> <servlet-name>SchedulerInit</servlet-name> <servlet-class>com.ineast.scheduler.SchedulerInit</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SchedulerInit</servlet-name> <url-pattern>/SchedulerInit</url-pattern> </servlet-mapping> |
org.quartz.scheduler.instanceName = SchedulerInit org.quartz.scheduler.instanceId = AUTO org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount = 12 org.quartz.threadPool.threadPriority = 5 org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore org.quartz.scheduler.instanceName = SchedulerInit org.quartz.scheduler.instanceId = AUTO org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount = 12 org.quartz.threadPool.threadPriority = 5 org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore |
package com.ineast.scheduler; import java.text.ParseException; import org.quartz.CronTrigger; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; import org.quartz.impl.StdSchedulerFactory; public class SchedulerInit { private SchedulerFactory schedFact; private Scheduler sched; public SchedulerInit() { try { schedFact = new StdSchedulerFactory(); sched = schedFact.getScheduler(); sched.start(); JobDetail job1 = new JobDetail("Schedule", "group1", Schedule.class); CronTrigger trigger1 = new CronTrigger("Trigger_Schedule", "group1", "0/30 * * * * ?"); sched.scheduleJob(job1, trigger1); } catch (SchedulerException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } } public static void main(String[] args) { new SchedulerInit(); } } |
package com.ineast.scheduler; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; public class Schedule implements Job { public void execute(JobExecutionContext context) throws JobExecutionException { getMyAlarmData(); } public void getMyAlarmData() { System.out.println("스케줄러 실행중"); } } |
java smtp Mail 발송 (0) | 2010.04.19 |
---|---|
CronTrigger 의 표현식(Quartz) (0) | 2010.04.19 |
GRIDBAGLAYOUT 사용하기 (1) | 2010.03.03 |
좋은 Swing 자료 (0) | 2010.03.03 |
Swing 을 이용한 RAISON 담배~~~ (0) | 2010.02.28 |