I had a requirement to remove a quartz job from a tomcat without restarting it. So best solution is to write a jsp to do this. I had earlier written a Quartz Admin jsp blog so I went and added a Delete button to that jsp and it appears all I need to do is call
<%
if("Delete".equals(btnInterrupt)) {
scheduler.deleteJob(jobNameToRun, groupNameToRun);
%>
Job <%=jobNameToRun%> Deleted.
<%
}
%>
There is a unschedule api also but that will only unschedule the job's next execution and I wanted to remove the job. When tomcat is restarted the job will come back.
<%
if("Delete".equals(btnInterrupt)) {
scheduler.deleteJob(jobNameToRun, groupNameToRun);
%>
Job <%=jobNameToRun%> Deleted.
<%
}
%>
There is a unschedule api also but that will only unschedule the job's next execution and I wanted to remove the job. When tomcat is restarted the job will come back.
Comments
Post a Comment