api/jar/src/main/java/javax/slee/resource/FailureReason.java
public static FailureReason fromInt(int reason) throws IllegalArgumentException {
        switch (reason) {
            case REASON_OTHER_REASON: return OTHER_REASON;
            case REASON_EVENT_QUEUE_FULL: return EVENT_QUEUE_FULL;
            case REASON_EVENT_QUEUE_TIMEOUT: return EVENT_QUEUE_TIMEOUT;
            case REASON_SYSTEM_OVERLOAD: return SYSTEM_OVERLOAD;
            case REASON_EVENT_MARSHALING_ERROR: return EVENT_MARSHALING_ERROR;
            case REASON_FIRING_TRANSACTION_ROLLED_BACK: return FIRING_TRANSACTION_ROLLED_BACK;
            default:
                if (reason > 0)
                    return new FailureReason(reason);
                else
                    throw new IllegalArgumentException("Invalid failure reason: " + reason);
        }
    }
public static FailureReason fromInt(int reason) throws IllegalArgumentException {
        switch (reason) {
            case REASON_OTHER_REASON: return OTHER_REASON;
            case REASON_EVENT_QUEUE_FULL: return EVENT_QUEUE_FULL;
            case REASON_EVENT_QUEUE_TIMEOUT: return EVENT_QUEUE_TIMEOUT;
            case REASON_SYSTEM_OVERLOAD: return SYSTEM_OVERLOAD;
            case REASON_EVENT_MARSHALING_ERROR: return EVENT_MARSHALING_ERROR;
            case REASON_FIRING_TRANSACTION_ROLLED_BACK: return FIRING_TRANSACTION_ROLLED_BACK;
            default:
                if (reason > 0)
                    return new FailureReason(reason);
                else
                    throw new IllegalArgumentException("Invalid failure reason: " + reason);
        }
    }
public static FailureReason fromInt ( int reason ) throws IllegalArgumentException { switch ( reason ) { case REASON_OTHER_REASON : return OTHER_REASON ; case REASON_EVENT_QUEUE_FULL : return EVENT_QUEUE_FULL ; case REASON_EVENT_QUEUE_TIMEOUT : return EVENT_QUEUE_TIMEOUT ; case REASON_SYSTEM_OVERLOAD : return SYSTEM_OVERLOAD ; case REASON_EVENT_MARSHALING_ERROR : return EVENT_MARSHALING_ERROR ; case REASON_FIRING_TRANSACTION_ROLLED_BACK : return FIRING_TRANSACTION_ROLLED_BACK ; default : if ( reason > 0 ) return new FailureReason ( reason ) ; else throw new IllegalArgumentException ( "Invalid failure reason: " + reason ) ; } }
Get a <code>FailureReason</code> object from an integer value.
<p>
This method returns the singleton objects for the failure reasons defined in
this class.  For all vendor-defined reason codes (those greater than 0 in value),
a non-unique <code>FailureReason</code> object is return encapsulating that value.
@param reason the reason as an integer.
@return a <code>FailureReason</code> object corresponding to <code>reason</code>.
@throws IllegalArgumentException if <code>reason</code> is less that 0 and does not
correspond to a SLEE-defined reason code.
Get a <code > FailureReason< / code > object from an integer value . <p > This method returns the singleton objects for the failure reasons defined in this class . For all vendor - defined reason codes ( those greater than 0 in value ) a non - unique <code > FailureReason< / code > object is return encapsulating that value .