/**
  * EJB3仕様に従い、 発生した例外によってトランザクションをロールバックしなくてはならない場合は<code>true</code>を、 それ以外の場合は<code>false</code>
  * を返します。
  *
  * @param throwable 発生した例外
  * @return 発生した例外によってトランザクションをロールバックしなくてはならない場合は<code>true</code>
  */
 protected static boolean isRollingBack(final Throwable throwable) {
   final Class<? extends Throwable> exceptionClass = throwable.getClass();
   final ApplicationException annotation =
       exceptionClass.getAnnotation(ApplicationException.class);
   if (annotation != null) {
     return annotation.rollback();
   }
   if (throwable instanceof RemoteException) {
     return true;
   }
   if (throwable instanceof RuntimeException) {
     return true;
   }
   if (throwable instanceof Exception) {
     return false;
   }
   return true;
 }
 @Override
 public boolean rollbackOn(Throwable ex) {
   ApplicationException ann = ex.getClass().getAnnotation(ApplicationException.class);
   return (ann != null ? ann.rollback() : super.rollbackOn(ex));
 }