Project

General

Profile

« Previous | Next » 

Revision 4959

Added by daigle almost 15 years ago

Added generic scheduler and workflow scheduling functionality.

View differences:

WorkflowJob.java
25 25
 */
26 26
package edu.ucsb.nceas.metacat.workflow;
27 27

  
28
import java.util.Calendar;
29

  
30
import org.apache.log4j.Logger;
31

  
32
import org.quartz.InterruptableJob;
28 33
import org.quartz.JobExecutionContext;
29 34
import org.quartz.JobExecutionException;
30 35

  
31
import edu.ucsb.nceas.metacat.scheduler.ScheduledJobInterface;
36
import edu.ucsb.nceas.utilities.FileUtil;
37
import edu.ucsb.nceas.utilities.UtilException;
32 38

  
33
public class WorkflowJob implements ScheduledJobInterface {
39
public class WorkflowJob implements InterruptableJob {
34 40
	
41
	private static Logger logMetacat = Logger.getLogger(WorkflowJob.class);
42
	
35 43
	public void execute(JobExecutionContext context) throws JobExecutionException {
44
		try {
45
			FileUtil.createFile("/tmp/worflowJob.txt");
46
			FileUtil.writeFile("/tmp/worflowJob.txt", Calendar.getInstance().getTime().toString());			
47
		} catch (UtilException ue) {
48
			String errorstr = "Util Exception writing to file" + ue.getMessage();
49
			logMetacat.error(errorstr);
50
			throw new JobExecutionException(errorstr);
51
		}
52
	
36 53
	}
37 54
	
38 55
	public void interrupt() {

Also available in: Unified diff