01: // Prevayler(TM) - The Open-Source Prevalence Layer.
02: // Copyright (C) 2001 Klaus Wuestefeld.
03: // This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
04:
05: package org.prevayler.implementation;
06:
07: import org.prevayler.*;
08:
09: /**
10: * An implementation of the PrevalentSystem interface to be extended, if convenient. It takes care of the clock methods. It is not necessary that PrevalentSystems extend this class.
11: */
12: public abstract class AbstractPrevalentSystem implements
13: PrevalentSystem {
14:
15: private AlarmClock clock;
16:
17: /**
18: * See org.prevayler.PrevalentSystem.clock()
19: */
20: public AlarmClock clock() {
21: return clock;
22: }
23:
24: /**
25: * See org.prevayler.PrevalentSystem.clock(AlarmClock)
26: */
27: public void clock(AlarmClock clock) {
28: if (this .clock != null)
29: throw new IllegalStateException(
30: "The clock had already been set.");
31: this.clock = clock;
32: }
33:
34: }
|