Package javax.ejb

Examples of javax.ejb.ApplicationException.rollback()


      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


   protected void handleInCallerTx(InvocationContext invocation, Throwable t, Transaction tx) throws Exception
   {
      ApplicationException ae = this.getApplicationException(t.getClass());
      if (ae != null)
      {
         if (ae.rollback())
         {
            setRollbackOnly(tx);
         }
         // an app exception can never be an Error
         throw (Exception) t;
View Full Code Here

   protected void handleExceptionInOurTx(InvocationContext invocation, Throwable t, Transaction tx) throws Exception
   {
      ApplicationException ae = this.getApplicationException(t.getClass());
      if (ae != null)
      {
         if (ae.rollback())
         {
            setRollbackOnly(tx);
         }
         throw (Exception) t;
      }
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(JBossMetaData ejbJar, Class<?> type)
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

                        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

                            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

            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

                    }
                    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

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.