public static String printFlag(int flags)
    {
        StringBuffer sb = new StringBuffer();
        sb.append(Integer.toHexString(flags));
        sb.append("=");

        if (flags == XAResource.TMNOFLAGS)
        {
            sb.append("TMNOFLAGS");
        }
        else
        {
            if ((flags & XAResource.TMENDRSCAN)   != 0) sb.append("TMENDRSCAN|");
            if ((flags & XAResource.TMFAIL)       != 0) sb.append("TMFAIL|");
            if ((flags & XAResource.TMJOIN)       != 0) sb.append("TMJOIN|");
            if ((flags & XAResource.TMONEPHASE)   != 0) sb.append("TMONEPHASE|");
            if ((flags & XAResource.TMRESUME)     != 0) sb.append("TMRESUME|");
            if ((flags & XAResource.TMSTARTRSCAN) != 0) sb.append("TMSTARTRSCAN|");
            if ((flags & XAResource.TMSUCCESS)    != 0) sb.append("TMSUCCESS|");
            if ((flags & XAResource.TMSUSPEND)    != 0) sb.append("TMSUSPEND|");

            sb.deleteCharAt(sb.length() - 1);
        }
        return sb.toString();
    }
public static String printFlag ( int flags ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( Integer . toHexString ( flags ) ) ; sb . append ( "=" ) ; if ( flags == XAResource . TMNOFLAGS ) { sb . append ( "TMNOFLAGS" ) ; } else { if ( ( flags & XAResource . TMENDRSCAN ) != 0 ) sb . append ( "TMENDRSCAN|" ) ; if ( ( flags & XAResource . TMFAIL ) != 0 ) sb . append ( "TMFAIL|" ) ; if ( ( flags & XAResource . TMJOIN ) != 0 ) sb . append ( "TMJOIN|" ) ; if ( ( flags & XAResource . TMONEPHASE ) != 0 ) sb . append ( "TMONEPHASE|" ) ; if ( ( flags & XAResource . TMRESUME ) != 0 ) sb . append ( "TMRESUME|" ) ; if ( ( flags & XAResource . TMSTARTRSCAN ) != 0 ) sb . append ( "TMSTARTRSCAN|" ) ; if ( ( flags & XAResource . TMSUCCESS ) != 0 ) sb . append ( "TMSUCCESS|" ) ; if ( ( flags & XAResource . TMSUSPEND ) != 0 ) sb . append ( "TMSUSPEND|" ) ; sb . deleteCharAt ( sb . length ( ) - 1 ) ; } return sb . toString ( ) ; }
Translate flags defined in javax.transaction.xa.XAResource into
string representation