1 43 package net.jforum.util.search.quartz; 44 45 import java.util.Date ; 46 47 import org.apache.log4j.Logger; 48 import org.quartz.JobExecutionContext; 49 import org.quartz.JobExecutionException; 50 import org.quartz.JobListener; 51 52 56 public class SimpleListener implements JobListener 57 { 58 private static Logger logger = Logger.getLogger(SimpleListener.class); 59 private String name; 60 61 public void setName(String name) 62 { 63 this.name = name; 64 } 65 66 69 public String getName() 70 { 71 return this.name; 72 } 73 74 77 public void jobToBeExecuted(JobExecutionContext context) 78 { 79 logger.info("Job going to be executed: " + context.getJobDetail().getName() 80 + ", " + context.getJobDetail().getDescription() 81 + "[" + new Date () + "]"); 82 } 83 84 87 public void jobExecutionVetoed(JobExecutionContext context) {} 88 89 92 public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) 93 { 94 logger.info("Job execution ended: " + context.getJobDetail().getName() 95 + ", " + context.getJobDetail().getDescription() 96 + "[" + new Date () + "]"); 97 } 98 99 } 100 | Popular Tags |