Package javax.ejb

Examples of javax.ejb.ApplicationException.rollback()


             * Re-throw AppException. Mark the transaction for rollback if the
             * application exception is specified as causing rollback.
             */

            // Mark the transaction for rollback.
            if (applicationException.rollback()) {
                markTransactionRollback();
            }

            // rethrow
            throw e;
View Full Code Here


             * Mark the transaction for rollback if the application exception is
             * specified as causing rollback, and then re-throw AppException.
             * Otherwise, attempt to commit the transaction, and then re-throw
             * AppException.
             */
            if (applicationException.rollback()) {
                // TODO: rollback or mark rollback ??
                rollback();
            } else {
                commit();
            }
View Full Code Here

   
    ApplicationException appExn = exn.getAnnotation(ApplicationException.class);
   
    if (appExn != null) {
      // ejb/1276
      return new AppExceptionItem(true, appExn.rollback(), appExn.inherited());
    }
   
    AppExceptionItem parentItem = getApplicationException(exn.getSuperclass(),
                                                          isSystem);
View Full Code Here

            for (Method method : clazz.getMethods()) {
                for (Class<?> exception : method.getExceptionTypes()) {
                    ApplicationException annotation = exception.getAnnotation(ApplicationException.class);
                    if (annotation == null) continue;
                    if (assemblyDescriptor.getApplicationException(exception) != null) continue;
                    assemblyDescriptor.addApplicationException(exception, annotation.rollback());
                }
            }
        }

        private void processSessionInterfaces(SessionBean sessionBean, Class<?> beanClass, EjbModule ejbModule) {
View Full Code Here

            }

            for (Class<?> exceptionClass : finder.findAnnotatedClasses(ApplicationException.class)) {
                if (assemblyDescriptor.getApplicationException(exceptionClass) == null){
                    ApplicationException annotation = exceptionClass.getAnnotation(ApplicationException.class);
                    assemblyDescriptor.addApplicationException(exceptionClass, annotation.rollback());
                }
            }

            return ejbModule;
        }
View Full Code Here

            List<Class<?>> appExceptions = finder.findAnnotatedClasses(ApplicationException.class);
            for (Class<?> exceptionClass : appExceptions) {
                startupLogger.debug("...handling " + exceptionClass);
                ApplicationException annotation = exceptionClass.getAnnotation(ApplicationException.class);
                if (assemblyDescriptor.getApplicationException(exceptionClass) == null) {
                    startupLogger.debug("...adding " + exceptionClass + " with rollback=" + annotation.rollback());
                    assemblyDescriptor.addApplicationException(exceptionClass, annotation.rollback(), annotation.inherited());
                } else {
                    mergeApplicationExceptionAnnotation(assemblyDescriptor, exceptionClass, annotation);
                }
            }
View Full Code Here

            for (Class<?> exceptionClass : appExceptions) {
                startupLogger.debug("...handling " + exceptionClass);
                ApplicationException annotation = exceptionClass.getAnnotation(ApplicationException.class);
                if (assemblyDescriptor.getApplicationException(exceptionClass) == null) {
                    startupLogger.debug("...adding " + exceptionClass + " with rollback=" + annotation.rollback());
                    assemblyDescriptor.addApplicationException(exceptionClass, annotation.rollback(), annotation.inherited());
                } else {
                    mergeApplicationExceptionAnnotation(assemblyDescriptor, exceptionClass, annotation);
                }
            }
View Full Code Here

                    if (annotation == null) continue;
                    if (assemblyDescriptor.getApplicationException(exception) != null) {
                        mergeApplicationExceptionAnnotation(assemblyDescriptor, exception, annotation);
                    } else {
                        logger.debug("Found previously undetected application exception {0} listed on a method {1} with annotation {2}", method, exception, annotation);
                        assemblyDescriptor.addApplicationException(exception, annotation.rollback(), annotation.inherited());
                    }
                }
            }
        }
View Full Code Here

   public void handleExceptionInOurTx(Invocation invocation, Throwable t, Transaction tx) throws Throwable
   {
      ApplicationException ae = TxUtil.getApplicationException(t.getClass(), invocation);
      if (ae != null)
      {
         if (ae.rollback()) setRollbackOnly(tx);
         throw t;
      }

      // if it's neither EJBException nor RemoteException
      if(!(t instanceof EJBException || t instanceof RemoteException))
View Full Code Here

   {
      ApplicationException ae = TxUtil.getApplicationException(t.getClass(), invocation);
  
      if (ae != null)
      {
         if (ae.rollback()) setRollbackOnly(tx);
         throw t;
      }
     
      // if it's not EJBTransactionRolledbackException
      if(!(t instanceof EJBTransactionRolledbackException))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.