1 16 17 package org.springframework.scheduling.commonj; 18 19 import commonj.timers.Timer; 20 import commonj.timers.TimerListener; 21 22 import org.springframework.util.Assert; 23 24 32 public class DelegatingTimerListener implements TimerListener { 33 34 private final Runnable runnable; 35 36 37 41 public DelegatingTimerListener(Runnable runnable) { 42 Assert.notNull(runnable, "Runnable is required"); 43 this.runnable = runnable; 44 } 45 46 47 50 public void timerExpired(Timer timer) { 51 this.runnable.run(); 52 } 53 54 } 55 | Popular Tags |