Package javax.ejb

Examples of javax.ejb.TransactionManagementType


                /*
                 * @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


/*    */   {
/* 44 */     super(property);
/*    */
/* 46 */     if ((container instanceof Container))
/*    */     {
/* 48 */       TransactionManagementType type = TxUtil.getTransactionManagementType((Advisor)container);
/* 49 */       if (type != TransactionManagementType.BEAN)
/* 50 */         throw new IllegalStateException("Container " + ((Container)container).getEjbName() + ": it is illegal to inject UserTransaction into a CMT bean");
/*    */     }
/*    */   }
View Full Code Here

/*    */
/*    */   public UserTransactionMethodInjector(Method setMethod, InjectionContainer container)
/*    */   {
/* 48 */     if ((container instanceof Container))
/*    */     {
/* 50 */       TransactionManagementType type = TxUtil.getTransactionManagementType((Advisor)container);
/* 51 */       if (type != TransactionManagementType.BEAN)
/* 52 */         throw new IllegalStateException("Container " + ((Container)container).getEjbName() + ": it is illegal to inject UserTransaction into a CMT bean");
/*    */     }
/* 54 */     this.setMethod = setMethod;
/* 55 */     setMethod.setAccessible(true);
View Full Code Here

/*    */
/*    */   public UserTransactionFieldInjector(Field field, InjectionContainer container)
/*    */   {
/* 46 */     if ((container instanceof Container))
/*    */     {
/* 48 */       TransactionManagementType type = TxUtil.getTransactionManagementType((Advisor)container);
/* 49 */       if (type != TransactionManagementType.BEAN)
/* 50 */         throw new IllegalStateException("Container " + ((Container)container).getEjbName() + ": it is illegal to inject UserTransaction into a CMT bean");
/*    */     }
/* 52 */     this.field = field;
/* 53 */     this.field.setAccessible(true);
View Full Code Here

/*      */   }
/*      */
/*      */   @XmlTransient
/*      */   public boolean isCMT()
/*      */   {
/*  484 */     TransactionManagementType type = getTransactionType();
/*  485 */     if (type == null) {
/*  486 */       return true;
/*      */     }
/*  488 */     return type == TransactionManagementType.CONTAINER;
/*      */   }
View Full Code Here

/*  90 */       descriptionGroup.setDescriptions(descriptions);
/*  91 */       bean.setDescriptionGroup(descriptionGroup);
/*     */     }
/*     */
/*  94 */     TransactionManagement txMgmt = (TransactionManagement)this.finder.getAnnotation(beanClass, TransactionManagement.class);
/*  95 */     TransactionManagementType txType = TransactionManagementType.CONTAINER;
/*  96 */     if (txMgmt != null)
/*  97 */       txType = txMgmt.value();
/*  98 */     bean.setTransactionType(txType);
/*     */
/* 100 */     processTopLevel(bean, beanClass);
View Full Code Here

/* 229 */     return TransactionManagementType.CONTAINER;
/*     */   }
/*     */
/*     */   public boolean isCMT()
/*     */   {
/* 239 */     TransactionManagementType type = getTransactionType();
/* 240 */     if (type == null) {
/* 241 */       return true;
/*     */     }
/* 243 */     return type == TransactionManagementType.CONTAINER;
/*     */   }
View Full Code Here

/*      */   private void addTransactionAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, String ejbName)
/*      */     throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException
/*      */   {
/* 1144 */     if (enterpriseBean != null)
/*      */     {
/* 1146 */       TransactionManagementType transactionType = enterpriseBean.getTransactionType();
/* 1147 */       if (transactionType != null)
/*      */       {
/* 1149 */         TransactionManagementImpl annotation = new TransactionManagementImpl();
/* 1150 */         annotation.setValue(transactionType);
/* 1151 */         addClassAnnotation(container, TransactionManagement.class, annotation);
View Full Code Here

/* 107 */     this.policy = new Ejb3TxPolicy();
/*     */   }
/*     */
/*     */   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
/*     */   {
/* 113 */     TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
/* 114 */     if (type == TransactionManagementType.BEAN) {
/* 115 */       return new BMTInterceptor(TxUtil.getTransactionManager(), !(advisor instanceof StatefulContainer));
/*     */     }
/* 117 */     Method method = ((MethodJoinpoint)jp).getMethod();
/* 118 */     int timeout = resolveTransactionTimeout(advisor, method);
View Full Code Here

/* 300 */     return getContainer().getTimerService();
/*     */   }
/*     */
/*     */   public UserTransaction getUserTransaction() throws IllegalStateException
/*     */   {
/* 305 */     TransactionManagementType type = TxUtil.getTransactionManagementType((Advisor)getContainer());
/* 306 */     if (type != TransactionManagementType.BEAN) throw new IllegalStateException("Container " + getContainer().getEjbName() + ": it is illegal to inject UserTransaction into a CMT bean");
/*     */
/* 308 */     return new UserTransactionImpl();
/*     */   }
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.