Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1009 → Rev 1010

/hostadmiral/trunk/src/ak/hostadmiral/core/model/TransactionListener.java
0,0 → 1,43
package ak.hostadmiral.core.model;
 
import java.util.Collection;
import ak.hostadmiral.util.ModelException;
 
/**
* One could implement this interface to receive transaction start, commit and
* rollback events.
* An object will be informed about this events if it actualy interacts with the
* transaction, e.g. if it is registered as listener for object modifications.
*/
public interface TransactionListener
{
/**
* called when this object first time interacts with given transaction,
* before any other callbacks of this object in the transaction
*
* @param id some transaction identifier, the same for all transaction* methods
* @throws ModelException if transaction must be aborted immediately
*/
public void transactionBegin(Object id)
throws ModelException;
 
/**
* called when transaction is commited
*
* @param id some transaction identifier, the same as in corresponding transactionBegin
* method call
* @throws ModelException logged, but ignored
*/
public void transactionCommited(Object id)
throws ModelException;
 
/**
* called when transaction is rolled back
*
* @param id some transaction identifier, the same as in corresponding transactionBegin
* method call
* @throws ModelException logged, but ignored
*/
public void transactionRolledBack(Object id)
throws ModelException;
}