Search in sources :

Example 1 with TRANSACTION_ROLLEDBACK

use of org.omg.CORBA.TRANSACTION_ROLLEDBACK in project Payara by payara.

the class POAProtocolMgr method mapException.

/**
 * Map the EJB/RMI exception to a protocol-specific (e.g. CORBA) exception
 */
@Override
public Throwable mapException(Throwable exception) {
    boolean initCause = true;
    Throwable mappedException = exception;
    if (exception instanceof java.rmi.NoSuchObjectException || exception instanceof NoSuchObjectLocalException) {
        mappedException = new OBJECT_NOT_EXIST(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else if (exception instanceof java.rmi.AccessException || exception instanceof javax.ejb.AccessLocalException) {
        mappedException = new NO_PERMISSION(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else if (exception instanceof java.rmi.MarshalException) {
        mappedException = new MARSHAL(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else if (exception instanceof javax.transaction.TransactionRolledbackException || exception instanceof TransactionRolledbackLocalException) {
        mappedException = new TRANSACTION_ROLLEDBACK(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else if (exception instanceof javax.transaction.TransactionRequiredException || exception instanceof TransactionRequiredLocalException) {
        mappedException = new TRANSACTION_REQUIRED(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else if (exception instanceof javax.transaction.InvalidTransactionException) {
        mappedException = new INVALID_TRANSACTION(MAPEXCEPTION_CODE, CompletionStatus.COMPLETED_MAYBE);
    } else {
        initCause = false;
    }
    if (initCause) {
        mappedException.initCause(exception);
    }
    return mappedException;
}
Also used : NO_PERMISSION(org.omg.CORBA.NO_PERMISSION) TransactionRolledbackLocalException(javax.ejb.TransactionRolledbackLocalException) INVALID_TRANSACTION(org.omg.CORBA.INVALID_TRANSACTION) MARSHAL(org.omg.CORBA.MARSHAL) NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) TRANSACTION_REQUIRED(org.omg.CORBA.TRANSACTION_REQUIRED) TRANSACTION_ROLLEDBACK(org.omg.CORBA.TRANSACTION_ROLLEDBACK) TransactionRequiredLocalException(javax.ejb.TransactionRequiredLocalException)

Aggregations

NoSuchObjectLocalException (javax.ejb.NoSuchObjectLocalException)1 TransactionRequiredLocalException (javax.ejb.TransactionRequiredLocalException)1 TransactionRolledbackLocalException (javax.ejb.TransactionRolledbackLocalException)1 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)1 MARSHAL (org.omg.CORBA.MARSHAL)1 NO_PERMISSION (org.omg.CORBA.NO_PERMISSION)1 OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)1 TRANSACTION_REQUIRED (org.omg.CORBA.TRANSACTION_REQUIRED)1 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)1