1 package org.oddjob.monitor.action; 2 3 import org.apache.log4j.Logger; 4 import org.oddjob.designer.model.DesignDefinition; 5 import org.oddjob.monitor.model.ExplorerContext; 6 import org.oddjob.monitor.model.JobAction; 7 import org.oddjob.scheduling.OddjobScheduler; 8 9 14 15 public class UnScheduleAction extends JobAction { 16 private static final Logger logger = Logger.getLogger(UnScheduleAction.class); 17 18 private String id; 19 20 private boolean enabled; 21 22 private OddjobScheduler oddjobScheduler; 23 24 public UnScheduleAction(OddjobScheduler oddjobScheduler, String id) { 25 this.oddjobScheduler = oddjobScheduler; 26 this.id = id; 27 } 28 29 32 public String getName() { 33 return id + " on " + oddjobScheduler; 34 } 35 36 40 public void select(Object component, ExplorerContext eContext) { 41 enabled = true; 42 } 43 44 48 public void deSelect() { 49 enabled = false; 50 } 51 52 56 public boolean enabled() { 57 return enabled; 58 } 59 60 64 public DesignDefinition form() { 65 return null; 66 } 67 68 72 public void action() throws Exception { 73 logger.debug("Attempting to " + getName()); 74 oddjobScheduler.unSchedule(id); 75 } 76 77 } 78 | Popular Tags |