1 17 18 package org.sape.carbon.services.scheduler.test; 19 20 21 import org.sape.carbon.services.scheduler.UnrecoverableTaskException; 22 23 import org.apache.commons.logging.Log; 24 import org.apache.commons.logging.LogFactory; 25 26 32 public class UnrecoverableExceptionSchedulableImpl 33 implements SchedulableComponent { 34 35 38 private Log log = LogFactory.getLog(this.getClass()); 39 40 private SchedulerServiceTestListener listener; 41 42 45 public void setListener(SchedulerServiceTestListener listener) { 46 this.listener = listener; 47 } 48 49 public void doSpecializeTask() throws UnrecoverableTaskException { 50 if (log.isTraceEnabled()) { 51 log.trace("Running specialized scheduled task"); 52 } 53 this.listener.incrementSecondaryCount(); 54 55 throw new UnrecoverableTaskException( 56 this.getClass(), 57 "test UnrecoverableTaskException"); 58 } 59 60 63 public void runScheduledTask() throws UnrecoverableTaskException { 64 if (log.isTraceEnabled()) { 65 log.trace("Running scheduled task"); 66 } 67 this.listener.incrementCount(); 68 throw new UnrecoverableTaskException( 69 this.getClass(), 70 "test UnrecoverableTaskException"); 71 } 72 73 } 74 | Popular Tags |