Package javax.ejb

Examples of javax.ejb.ApplicationException.rollback()


      setPropagationBehaviorName(PREFIX_PROPAGATION + type.name());
    }

    public boolean rollbackOn(Throwable ex) {
      ApplicationException ann = ex.getClass().getAnnotation(ApplicationException.class);
      return (ann != null ? ann.rollback() : (ex instanceof RuntimeException || ex instanceof Error));
    }
  }

}
View Full Code Here


            EjbApplicationExceptionInfo appExcInfo = new
                EjbApplicationExceptionInfo();
            Class annotatedClass = (Class) ae;
            appExcInfo.setExceptionClassName(annotatedClass.getName());
            appExcInfo.setRollback(appExcAnn.rollback());

            ejbBundle.addApplicationException(appExcInfo);

        }
View Full Code Here

                    }
                    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

            final List<Class<?>> appExceptions = finder.findAnnotatedClasses(ApplicationException.class);
            for (final Class<?> exceptionClass : appExceptions) {
                startupLogger.debug("...handling " + exceptionClass);
                final 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 (final Class<?> exceptionClass : appExceptions) {
                startupLogger.debug("...handling " + exceptionClass);
                final 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

                    ejbJar.setAssemblyDescriptor(new AssemblyDescriptor());
                }
            }
            for (Class<?> exceptionClass : classes) {
                ApplicationException annotation = exceptionClass.getAnnotation(ApplicationException.class);
                org.apache.openejb.jee.ApplicationException exception = new org.apache.openejb.jee.ApplicationException(exceptionClass.getName(), annotation.rollback());
                ejbJar.getAssemblyDescriptor().getApplicationException().add(exception);
            }

            return ejbModule;
        }
View Full Code Here

        // Unregistered - runtime exceptions are system exception and the rest are application exceptions
        final Class<? extends Throwable> eClass = e.getClass();
        final ApplicationException applicationException = eClass.getAnnotation(ApplicationException.class);
        if (applicationException != null) {
            addApplicationException(eClass, applicationException.rollback(), applicationException.inherited());
            return getExceptionType(e);
        }

        if (e instanceof RuntimeException) {
            return ExceptionType.SYSTEM;
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

                        while (annotation == null) {
                            parentExceptionClass = parentExceptionClass.getSuperclass();
                            annotation = parentExceptionClass.getAnnotation(ApplicationException.class);
                        }
                    }
                    startupLogger.debug("...adding " + exceptionClass + " with rollback=" + annotation.rollback())
                    assemblyDescriptor.addApplicationException(exceptionClass, annotation.rollback());
                }
            }

            ejbModule.getFinderReference().set(finder);
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.