1 17 18 package org.quartz.examples.example12; 19 20 import java.util.Date ; 21 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 import org.quartz.Job; 25 import org.quartz.JobExecutionContext; 26 import org.quartz.JobExecutionException; 27 28 35 public class SimpleJob implements Job { 36 37 public static final String MESSAGE = "msg"; 38 39 private static Log _log = LogFactory.getLog(SimpleJob.class); 40 41 45 public SimpleJob() { 46 } 47 48 58 public void execute(JobExecutionContext context) 59 throws JobExecutionException { 60 61 String jobName = context.getJobDetail().getFullName(); 64 65 String message = (String ) context. 66 getJobDetail().getJobDataMap().get(MESSAGE); 67 68 _log.info("SimpleJob: " + jobName + " executing at " + new Date ()); 69 _log.info("SimpleJob: msg: " + message); 70 } 71 72 73 74 } | Popular Tags |