일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- rowspan
- jsr 296
- Google Map
- Eclipse
- WebLogic
- dock
- node.js
- JDOM
- Struts
- PLSQL
- swingx
- GPS
- jQuery
- sencha touch
- JSON
- iBATIS
- ibsheet
- 선택적조인
- Android
- phonegap
- MFC
- Ajax
- PHP
- MySQL
- tomcat
- oracle
- appspresso
- 가우스
- 전자정부프레임워크
- Spring
Archives
- Today
- Total
Where The Streets Have No Name
Quartz Job Control code 본문
<%@ page contentType="text/html;charset=euc-kr" %>
<%@ page import="org.quartz.*" %>
<%@ page import="org.quartz.impl.StdSchedulerFactory" %>
<%@ page import="org.quartz.ee.servlet.*" %>
<%@ page import="lgmsales.mailing.job.*" %>
<%
String[] jobGroups;
String[] jobsInGroup;
int i;
int j;
ServletContext ctx = request.getSession().getServletContext();
Scheduler scheduler = null;
StdSchedulerFactory factory = (StdSchedulerFactory)ctx.getAttribute(QuartzInitializerServlet.QUARTZ_FACTORY_KEY);
scheduler = factory.getScheduler();
//scheduler.pauseJob("testjob2", "testgroup"); //정지
//scheduler.resumeJob("testjob2", "testgroup"); //재시작
//수정
/*
CronTrigger cronTrigger = new CronTrigger("testtrigger2","testgroup");
cronTrigger.setJobName("testjob2");
cronTrigger.setJobGroup("testgroup");
cronTrigger.setCronExpression("2 * * ? * MON-FRI");
scheduler.rescheduleJob("testtrigger2", "testgroup",cronTrigger);
*/
scheduler.deleteJob("testjob2", "testgroup"); //삭제
//추가
JobDetail jd = new JobDetail("testjob2", "testgroup",TestJob2.class);
CronTrigger cronTrigger = new CronTrigger("testtrigger2","testgroup");
cronTrigger.setCronExpression("10 * * ? * MON-FRI");
scheduler.scheduleJob(jd, cronTrigger);
jobGroups = scheduler.getJobGroupNames();
for (i = 0; i < jobGroups.length; i++) {
out.println("Group: " + jobGroups[i] + " contains the following jobs : ");
jobsInGroup = scheduler.getJobNames(jobGroups[i]);
for (j = 0; j < jobsInGroup.length; j++) {
out.println("- " + jobsInGroup[j]);
}
out.println("<br>");
}
%>
<%@ page import="org.quartz.*" %>
<%@ page import="org.quartz.impl.StdSchedulerFactory" %>
<%@ page import="org.quartz.ee.servlet.*" %>
<%@ page import="lgmsales.mailing.job.*" %>
<%
String[] jobGroups;
String[] jobsInGroup;
int i;
int j;
ServletContext ctx = request.getSession().getServletContext();
Scheduler scheduler = null;
StdSchedulerFactory factory = (StdSchedulerFactory)ctx.getAttribute(QuartzInitializerServlet.QUARTZ_FACTORY_KEY);
scheduler = factory.getScheduler();
//scheduler.pauseJob("testjob2", "testgroup"); //정지
//scheduler.resumeJob("testjob2", "testgroup"); //재시작
//수정
/*
CronTrigger cronTrigger = new CronTrigger("testtrigger2","testgroup");
cronTrigger.setJobName("testjob2");
cronTrigger.setJobGroup("testgroup");
cronTrigger.setCronExpression("2 * * ? * MON-FRI");
scheduler.rescheduleJob("testtrigger2", "testgroup",cronTrigger);
*/
scheduler.deleteJob("testjob2", "testgroup"); //삭제
//추가
JobDetail jd = new JobDetail("testjob2", "testgroup",TestJob2.class);
CronTrigger cronTrigger = new CronTrigger("testtrigger2","testgroup");
cronTrigger.setCronExpression("10 * * ? * MON-FRI");
scheduler.scheduleJob(jd, cronTrigger);
jobGroups = scheduler.getJobGroupNames();
for (i = 0; i < jobGroups.length; i++) {
out.println("Group: " + jobGroups[i] + " contains the following jobs : ");
jobsInGroup = scheduler.getJobNames(jobGroups[i]);
for (j = 0; j < jobsInGroup.length; j++) {
out.println("- " + jobsInGroup[j]);
}
out.println("<br>");
}
%>