Package javax.ejb

Examples of javax.ejb.ApplicationException.rollback()


            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


                    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

   {
      ApplicationException ae = invocation.getApplicationException(t.getClass());

      if (ae != null)
      {
         if (ae.rollback()) setRollbackOnly(tx);
         // an app exception can never be an Error
         throw (Exception) t;
      }

      // if it's not EJBTransactionRolledbackException
View Full Code Here

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

      // if it's neither EJBException nor RemoteException
      if(!(t instanceof EJBException || t instanceof RemoteException))
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

            }

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

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

      if(!Exception.class.isAssignableFrom(element))
         throw new IllegalArgumentException("ApplicationException is only valid on an Exception");
     
      ApplicationExceptionMetaData metaData = new ApplicationExceptionMetaData();
      metaData.setExceptionClass(element.getName());
      metaData.setRollback(annotation.rollback());
     
      return metaData;
   }

   public void process(EjbJar3xMetaData ejbJar, Class<?> type)
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.