View Javadoc

1   package ch.busyboxes.agoo.job;
2   
3   import org.apache.log4j.Logger;
4   
5   import ch.busyboxes.agoo.service.WatcherTaskService;
6   
7   /**
8    * Launches jobs
9    * 
10   * @author julien@busyboxes.ch
11   */
12  public class JobOrchestrator {
13  	
14  	/** Logger for this class */
15  	private Logger logger = Logger.getLogger(JobOrchestrator.class);
16  	
17  	/** The watcher task service */
18  	private WatcherTaskService watcherTaskService;
19  	
20  	/**
21  	 * Periodically launched job
22  	 */
23  	public void run() {
24  		logger.debug("Run started...");
25  		watcherTaskService.runNextTask();
26  		logger.debug("Run finished.");
27  	}
28  
29  	/**
30  	 * Sets the watcher task service
31  	 * 
32  	 * @param watcherTaskService the watcherTaskService to set
33  	 */
34  	public void setWatcherTaskService(WatcherTaskService watcherTaskService) {
35  		this.watcherTaskService = watcherTaskService;
36  	}
37  	
38  }