ejb3/src/main/java/org/jboss/as/ejb3/tx/BMTInterceptor.java
protected Exception handleException(final InterceptorContext invocation, Throwable ex) throws Exception {
        ApplicationExceptionDetails ae = component.getApplicationException(ex.getClass(), invocation.getMethod());
        // it's an application exception, so just throw it back as-is
        if (ae != null) {
            throw (Exception)ex;
        }
        if (ex instanceof EJBException) {
            throw (EJBException) ex;
        } else if(ex instanceof Exception){
            throw new EJBException((Exception)ex);
        } else {
            throw new EJBException(new RuntimeException(ex));
        }
    }
protected Exception handleException(final InterceptorContext invocation, Throwable ex) throws Exception {
        ApplicationExceptionDetails ae = component.getApplicationException(ex.getClass(), invocation.getMethod());
        // it's an application exception, so just throw it back as-is
        if (ae != null) {
            throw (Exception)ex;
        }
        if (ex instanceof EJBException) {
            throw (EJBException) ex;
        } else if(ex instanceof Exception){
            throw new EJBException((Exception)ex);
        } else {
            throw new EJBException(new RuntimeException(ex));
        }
    }
protected Exception handleException ( final InterceptorContext invocation , Throwable ex ) throws Exception { ApplicationExceptionDetails ae = component . getApplicationException ( ex . getClass ( ) , invocation . getMethod ( ) ) ; // it's an application exception, so just throw it back as-is if ( ae != null ) { throw ( Exception ) ex ; } if ( ex instanceof EJBException ) { throw ( EJBException ) ex ; } else if ( ex instanceof Exception ) { throw new EJBException ( ( Exception ) ex ) ; } else { throw new EJBException ( new RuntimeException ( ex ) ) ; } }
Checks if the passed exception is an application exception. If yes, then throws back the
exception as-is. Else, wraps the exception in a {@link javax.ejb.EJBException} and throws the EJBException

@param ex The exception to handle
@throws Exception Either the passed exception or an EJBException
Checks if the passed exception is an application exception . If yes then throws back the exception as - is . Else wraps the exception in a { @link javax . ejb . EJBException } and throws the EJBException