KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > tm > StatusHelper


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.tm;
8
9 /**
10  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
11  */

12
13 final class StatusHelper {
14
15     /**
16      * Return a string representation of the given status code.
17      */

18     public static String JavaDoc toString(int status) {
19         switch(status) {
20             case javax.transaction.Status.STATUS_PREPARING:
21                 return "STATUS_PREPARING";
22             case javax.transaction.Status.STATUS_PREPARED:
23                 return "STATUS_PREPARED";
24             case javax.transaction.Status.STATUS_ROLLING_BACK:
25                 return "STATUS_ROLLING_BACK";
26             case javax.transaction.Status.STATUS_ROLLEDBACK:
27                 return "STATUS_ROLLEDBACK";
28             case javax.transaction.Status.STATUS_COMMITTING:
29                 return "STATUS_COMMITING";
30             case javax.transaction.Status.STATUS_COMMITTED:
31                 return "STATUS_COMMITED";
32             case javax.transaction.Status.STATUS_NO_TRANSACTION:
33                 return "STATUS_NO_TRANSACTION";
34             case javax.transaction.Status.STATUS_UNKNOWN:
35                 return "STATUS_UNKNOWN";
36             case javax.transaction.Status.STATUS_MARKED_ROLLBACK:
37                 return "STATUS_MARKED_ROLLBACK";
38             case javax.transaction.Status.STATUS_ACTIVE:
39                 return "STATUS_ACTIVE";
40             default:
41                 return "STATUS_UNKNOWN(" + status + ")";
42         }
43     }
44
45     public static void main(String JavaDoc[] args) {
46
47     }
48 }
49
50
Popular Tags