KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > TransactionWithQuery

1 //Prevayler(TM) - The Free-Software Prevalence Layer.
//Copyright (C) 2001-2003 Klaus Wuestefeld
//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.

5 package org.prevayler;
7 import JavaDoc;
8 import java.util.Date JavaDoc;
10 /** A Transaction that also returns a result or throws an Exception after executing. <br><br>A "PersonCreation" Transaction, for example, may return the Person it created. Without this, to retrieve the newly created Person, the caller would have to issue a Query like: "What was the last Person I created?". <br><br>Looking at the Prevayler demos is by far the best way to learn how to use this class.
11  * @see Transaction
12  */

13 public interface TransactionWithQuery extends Serializable JavaDoc {
15     /** Performs the necessary modifications on the given prevalentSystem and also returns an Object or throws an Exception.
16      * This method is called by Prevayler.execute(TransactionWithQuery) to execute this TransactionWithQuery on the given Prevalent System. See org.prevayler.demos for usage examples.
17      * @param prevalentSystem The system on which this TransactionWithQuery will execute.
18      * @param executionTime The time at which this TransactionWithQuery is being executed. Every Transaction executes completely within a single moment in time. Logically, a Prevalent System's time does not pass during the execution of a Transaction.
19      */

20     public Object JavaDoc executeAndQuery(Object JavaDoc prevalentSystem, Date JavaDoc executionTime) throws Exception JavaDoc;
22 }
Popular Tags