1 16 17 package org.springframework.scheduling.timer; 18 19 import java.util.TimerTask ; 20 21 import org.springframework.beans.factory.FactoryBean; 22 import org.springframework.scheduling.support.MethodInvokingRunnable; 23 24 46 public class MethodInvokingTimerTaskFactoryBean extends MethodInvokingRunnable implements FactoryBean { 47 48 private TimerTask timerTask; 49 50 51 public void afterPropertiesSet() throws ClassNotFoundException , NoSuchMethodException { 52 super.afterPropertiesSet(); 53 this.timerTask = new DelegatingTimerTask(this); 54 } 55 56 57 public Object getObject() { 58 return this.timerTask; 59 } 60 61 public Class getObjectType() { 62 return TimerTask .class; 63 } 64 65 public boolean isSingleton() { 66 return true; 67 } 68 69 } 70 | Popular Tags |