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

package org.jfox.tm;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

final class StatusHelper {

    /**
     * Return a string representation of the given status code.
     */
    public static String toString(int status) {
        switch(status) {
            case javax.transaction.Status.STATUS_PREPARING:
                return "STATUS_PREPARING";
            case javax.transaction.Status.STATUS_PREPARED:
                return "STATUS_PREPARED";
            case javax.transaction.Status.STATUS_ROLLING_BACK:
                return "STATUS_ROLLING_BACK";
            case javax.transaction.Status.STATUS_ROLLEDBACK:
                return "STATUS_ROLLEDBACK";
            case javax.transaction.Status.STATUS_COMMITTING:
                return "STATUS_COMMITING";
            case javax.transaction.Status.STATUS_COMMITTED:
                return "STATUS_COMMITED";
            case javax.transaction.Status.STATUS_NO_TRANSACTION:
                return "STATUS_NO_TRANSACTION";
            case javax.transaction.Status.STATUS_UNKNOWN:
                return "STATUS_UNKNOWN";
            case javax.transaction.Status.STATUS_MARKED_ROLLBACK:
                return "STATUS_MARKED_ROLLBACK";
            case javax.transaction.Status.STATUS_ACTIVE:
                return "STATUS_ACTIVE";
            default:
                return "STATUS_UNKNOWN(" + status + ")";
        }
    }

    public static void main(String[] args) {

    }
}

