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;
06:
07: import java.io.Serializable;
08:
09: /**
10: * Provides transparent persistence for all business objects in a PrevalentSystem. All commands to the system must be represented as objects implementing the Command interface and must be executed using Prevayler.executeCommand(Command).
11: * See the demo applications in org.prevayler.demos for examples.
12: */
13: public interface Prevayler {
14:
15: /**
16: * Returns the underlying PrevalentSystem.
17: */
18: public PrevalentSystem system();
19:
20: /**
21: * Logs the received command for crash or shutdown recovery and executes it on the underlying PrevalentSystem.
22: * @return The serializable object that was returned by the execution of command.
23: * @throws IOException if there is trouble writing the command to one of the log files.
24: * @throws Throwable if the execution of command throws an Exception.
25: */
26: public Serializable executeCommand(Command command)
27: throws Throwable;
28: }
|