KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > taskman > transaction > TransactionListener


1 package org.sapia.taskman.transaction;
2
3 /**
4  * This interface specifies callbacks that are called at different points of a
5  * given <code>Transaction</code>'s execution.
6  *
7  * @author Yanick Duchesne
8  *
9  * <dl>
10  * <dt><b>Copyright: </b>
11  * <dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open
12  * Source Software </a>. All Rights Reserved.</dd>
13  * </dt>
14  * <dt><b>License: </b>
15  * <dd>Read the license.txt file of the jar or visit the <a
16  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
17  * OSS web site</dd>
18  * </dt>
19  * </dl>
20  */

21 public interface TransactionListener {
22   /**
23    * Called after <code>commit()</code> has been called on the corresponding
24    * task.
25    */

26   public void onBegin();
27
28   /**
29    * Called when the currently executing task has signaled an error.
30    *
31    * @param msg
32    * some message.
33    */

34   public void onError(Object JavaDoc msg);
35
36   /**
37    * Called when the currently executing task has signaled an error.
38    *
39    * @param t
40    * a <code>Throwable</code>- corresponding to an execution error.
41    */

42   public void onError(Throwable JavaDoc t);
43
44   /**
45    * Called when the currently executing task has signaled an error.
46    *
47    * @param msg
48    * some message.
49    */

50   public void onError(Object JavaDoc msg, Throwable JavaDoc t);
51
52   /**
53    * Called when the corresponding transaction has committed.
54    *
55    * @param success
56    * if <code>true</code>, signals that the transaction has
57    * completed successfully (no task has signaled an error).
58    */

59   public void onCommitted(boolean success);
60 }
61
Popular Tags