01 package biz.xsoftware.examples.timer;
02
03 import java.util.Date;
04 import java.util.Timer;
05 import java.util.TimerTask;
06
07 public class TimerInterfaceImpl implements TimerInterface {
08
09 private Timer timer = new Timer();
10
11 public void cancelTask(TimerTask task) {
12 task.cancel();
13 }
14
15 public void cancel() {
16 timer.cancel();
17 }
18
19 public int purge() {
20 return timer.purge();
21 }
22
23 public void schedule(TimerTask task, Date firstTime, long period) {
24 timer.schedule(task, firstTime, period);
25 }
26
27 public void schedule(TimerTask task, Date time) {
28 timer.schedule(task, time);
29 }
30
31 public void schedule(TimerTask task, long delay, long period) {
32 timer.schedule(task, delay, period);
33 }
34
35 public void schedule(TimerTask task, long delay) {
36 timer.schedule(task, delay);
37 }
38
39 public void scheduleAtFixedRate(TimerTask task, Date firstTime, long period) {
40 timer.scheduleAtFixedRate(task, firstTime, period);
41 }
42
43 public void scheduleAtFixedRate(TimerTask task, long delay, long period) {
44 timer.scheduleAtFixedRate(task, delay, period);
45 }
46
47 }
|