Package javax.ejb

Examples of javax.ejb.TransactionAttribute


   {
      TransactionManagementType mtype = TxUtil.getTransactionManagementType(container.getAdvisor());
      if (mtype == javax.ejb.TransactionManagementType.BEAN) return false;


      TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(method, TransactionAttribute.class);
      if (attr == null)
      {
         attr =(TransactionAttribute)container.resolveAnnotation(TransactionAttribute.class);
      }
      TransactionAttributeType type = TransactionAttributeType.REQUIRED;
      if (attr != null) type = attr.value();
      return type == javax.ejb.TransactionAttributeType.REQUIRED;
   }
View Full Code Here


      return annotation.value();
   }

   public void process(T bean, E element)
   {
      TransactionAttribute annotation = finder.getAnnotation(element, TransactionAttribute.class);
      if(annotation == null)
         return;
     
      IEjbJarMetaData ejbJarMetaData = bean.getEjbJarMetaData();
     
View Full Code Here

      return annotation.value();
   }

   public void process(T bean, E element)
   {
      TransactionAttribute annotation = finder.getAnnotation(element, TransactionAttribute.class);
      if(annotation == null)
         return;
     
      IEjbJarMetaData ejbJarMetaData = bean.getEjbJarMetaData();
     
View Full Code Here

                if (bean.getTransactionType() == TransactionType.CONTAINER) {
                    Map<String, List<MethodTransaction>> methodTransactions = assemblyDescriptor.getMethodTransactions(ejbName);

                    // SET THE DEFAULT
                    if (!methodTransactions.containsKey("*")) {
                        TransactionAttribute attribute = clazz.getAnnotation(TransactionAttribute.class);
                        if (attribute != null) {
                            ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), ejbName, "*");
                            assemblyDescriptor.getContainerTransaction().add(ctx);
                        }
                    }

                    List<Method> methods = classFinder.findAnnotatedMethods(TransactionAttribute.class);
                    for (Method method : methods) {
                        TransactionAttribute attribute = method.getAnnotation(TransactionAttribute.class);
                        if (!methodTransactions.containsKey(method.getName())) {
                            // no method with this name in descriptor
                            addContainerTransaction(attribute, ejbName, method, assemblyDescriptor);
                        } else {
                            // method name already declared
View Full Code Here

    public void postProcessAnnotation(AnnotationInfo ainfo,
            AnnotatedElementHandler aeHandler)
            throws AnnotationProcessorException {
        EjbContext ejbContext = (EjbContext)aeHandler;
        EjbDescriptor ejbDesc = ejbContext.getDescriptor();
        TransactionAttribute taAn =
            (TransactionAttribute) ainfo.getAnnotation();
        ContainerTransaction containerTransaction =
            getContainerTransaction(taAn.value());
        Class classAn = (Class)ainfo.getAnnotatedElement();

        Set txBusMethods = ejbDesc.getTxBusinessMethodDescriptors();
        for (Object mdObj : txBusMethods) {
            MethodDescriptor md = (MethodDescriptor)mdObj;
View Full Code Here

                if (bean.getTransactionType() == TransactionType.CONTAINER) {
                    Map<String, List<MethodTransaction>> methodTransactions = assemblyDescriptor.getMethodTransactions(ejbName);

                    // SET THE DEFAULT
                    if (!methodTransactions.containsKey("*")) {
                        TransactionAttribute attribute = clazz.getAnnotation(TransactionAttribute.class);
                        if (attribute != null) {
                            ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), ejbName, "*");
                            assemblyDescriptor.getContainerTransaction().add(ctx);
                        }
                    }

                    List<Method> methods = classFinder.findAnnotatedMethods(TransactionAttribute.class);
                    for (Method method : methods) {
                        TransactionAttribute attribute = method.getAnnotation(TransactionAttribute.class);
                        if (!methodTransactions.containsKey(method.getName())) {
                            // no method with this name in descriptor
                            addContainerTransaction(attribute, ejbName, method, assemblyDescriptor);
                        } else {
                            // method name already declared
View Full Code Here

   private static final String TX_TYPE_NEVER = "NEVER";

   protected String resolveTxType(Advisor advisor, Joinpoint jp)
   {
      Method method = ((MethodJoinpoint) jp).getMethod();
      TransactionAttribute tx = (TransactionAttribute) advisor.resolveAnnotation(method, TransactionAttribute.class);

      if (tx == null)
         tx = (TransactionAttribute) advisor.resolveAnnotation(TransactionAttribute.class);

      String value = TxInterceptorFactory.TX_TYPE_REQUIRED;
      if (tx != null)
      {
         TransactionAttributeType type = tx.value();

         if (type == null)
         {
            value = TxInterceptorFactory.TX_TYPE_REQUIRED;
         }
View Full Code Here

      return containers;
   }
  
   protected void validateMDBTransactionAttribute(MDB mdb)
   {
      TransactionAttribute tx = (TransactionAttribute)mdb.resolveAnnotation(TransactionAttribute.class);
      if (tx != null)
      {
         TransactionAttributeType type = tx.value();
         if (type != TransactionAttributeType.REQUIRED && type != TransactionAttributeType.NOT_SUPPORTED)
            throw new RuntimeException("MDB " + mdb.getEjbName() + " has an invalid TransactionAttribute: " + type +
                  ". Only REQUIRED and NOT_SUPPORTED are valid");
      }
   }
View Full Code Here

   {
      TransactionManagementType mtype = TxUtil.getTransactionManagementType(container);
      if (mtype == javax.ejb.TransactionManagementType.BEAN) return false;


      TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(method, TransactionAttribute.class);
      if (attr == null)
      {
         attr =(TransactionAttribute)container.resolveAnnotation(TransactionAttribute.class);
      }
      TransactionAttributeType type = TransactionAttributeType.REQUIRED;
      if (attr != null) type = attr.value();
      return type == javax.ejb.TransactionAttributeType.REQUIRED;
   }
View Full Code Here

            // SET THE DEFAULT
            if (!hasMethodTransaction("*", null, methodTransactions)) {
                for (Class<?> type : ancestors(clazz)) {
                    if (!hasMethodTransaction("*", type, methodTransactions)){
                        TransactionAttribute attribute = type.getAnnotation(TransactionAttribute.class);
                        if (attribute != null) {
                            ContainerTransaction ctx = new ContainerTransaction(cast(attribute.value()), type.getName(), ejbName, "*");
                            assemblyDescriptor.getContainerTransaction().add(ctx);
                        }
                    }
                }

            }


            List<Method> methods = classFinder.findAnnotatedMethods(TransactionAttribute.class);
            for (Method method : methods) {
                TransactionAttribute attribute = method.getAnnotation(TransactionAttribute.class);
                if (!methodTransactions.containsKey(method.getName())) {
                    // no method with this name in descriptor
                    addContainerTransaction(attribute, ejbName, method, assemblyDescriptor);
                } else {
                    // method name already declared
View Full Code Here

TOP

Related Classes of javax.ejb.TransactionAttribute

Copyright © 2018 www.massapicom. 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.