Package javax.ejb

Examples of javax.ejb.TransactionManagementType


                processCallbacks(bean, inheritedClassFinder);

                if (bean.getTransactionType() == null) {
                    TransactionManagement tx = getInheritableAnnotation(clazz, TransactionManagement.class);
                    TransactionManagementType transactionType = TransactionManagementType.CONTAINER;
                    if (tx != null) {
                        transactionType = tx.value();
                    }
                    switch (transactionType) {
                        case BEAN:
View Full Code Here


                /*
                 * @TransactionManagement
                 */
                if (bean.getTransactionType() == null) {
                    TransactionManagement tx = getInheritableAnnotation(clazz, TransactionManagement.class);
                    TransactionManagementType transactionType = TransactionManagementType.CONTAINER;
                    if (tx != null) {
                        transactionType = tx.value();
                    }
                    switch (transactionType) {
                        case BEAN:
View Full Code Here

   private static final Logger log = Logger.getLogger(CMTTxInterceptorFactory.class);

   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      // We have to do this until AOP supports matching based on annotation attributes
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.BEAN)
         return new NullInterceptor();
     
      TransactionManager tm = TxUtil.getTransactionManager();
      boolean stateful = advisor.resolveAnnotation(Stateful.class) != null;
View Full Code Here

   public static boolean getRollbackOnly()
   {
      Invocation currentInvocation = CurrentInvocation.getCurrentInvocation();
      Advisor advisor = currentInvocation.getAdvisor();
      // EJB1.1 11.6.1: Must throw IllegalStateException if BMT
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.CONTAINER)
         throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to call getRollbackOnly from BMT: " + type);

      // TODO: we should really ask a TxType object to handle getRollbackOnly()
      if(getTxType(currentInvocation) == TransactionAttributeType.SUPPORTS)
View Full Code Here

      // Is construction happening from within another bean?
      if(ctx.getInstance() != invocation.getTargetObject())
         throw new IllegalStateException("It's not allowed to get the UserTransaction during construction and injection " + ctx);
     
      Advisor advisor = invocation.getAdvisor();
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.BEAN) throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to inject UserTransaction into a CMT bean");

      return new UserTransactionImpl();  
   }
View Full Code Here

  
   public static void setRollbackOnly()
   {
      Advisor advisor = CurrentInvocation.getCurrentInvocation().getAdvisor();
      // EJB1.1 11.6.1: Must throw IllegalStateException if BMT
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.CONTAINER) throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to call setRollbackOnly from BMT: " + type);

      try
      {
         TransactionManager tm = TxUtil.getTransactionManager();
View Full Code Here

   @Override
   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      // We have to do this until AOP supports matching based on annotation attributes
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type == TransactionManagementType.BEAN)
         return new NullInterceptor();

      TransactionManager tm = TxUtil.getTransactionManager();
     
View Full Code Here

    * @return true when CMT
    */
   @XmlTransient
   public boolean isCMT()
   {
      TransactionManagementType type = getTransactionType();
      if (type == null)
         return true;
      else
         return type == TransactionManagementType.CONTAINER;
   }
View Full Code Here

    * @return true when CMT
    */
   @XmlTransient
   public boolean isCMT()
   {
      TransactionManagementType type = getTransactionType();
      if (type == null)
         return true;
      else
         return type == TransactionManagementType.CONTAINER;
   }
View Full Code Here

         descriptionGroup.setDescriptions(descriptions);
         bean.setDescriptionGroup(descriptionGroup);
      }

      TransactionManagement txMgmt = finder.getAnnotation(beanClass, TransactionManagement.class);
      TransactionManagementType txType = TransactionManagementType.CONTAINER;
      if(txMgmt != null)
         txType = txMgmt.value();
      bean.setTransactionType(txType);

      processTopLevel(bean, beanClass);
View Full Code Here

TOP

Related Classes of javax.ejb.TransactionManagementType

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.