01: package org.jbpm.util;
02:
03: import java.util.Date;
04:
05: public abstract class Clock {
06:
07: public static DateGenerator dateGenerator = new DefaultDateGenerator();
08:
09: public interface DateGenerator {
10: Date getCurrentTime();
11: }
12:
13: public static class DefaultDateGenerator implements DateGenerator {
14: public Date getCurrentTime() {
15: return new Date();
16: }
17: }
18:
19: public static Date getCurrentTime() {
20: return dateGenerator.getCurrentTime();
21: }
22: }
|