public LockFactory(AspectBeanFactory<X> beanFactory, AspectFactory<X> next) { super(beanFactory, next); AnnotatedType<X> beanType = beanFactory.getBeanType(); ConcurrencyManagement concurrencyManagement = beanType .getAnnotation(ConcurrencyManagement.class); if (concurrencyManagement != null) { _concurrencyManagement = concurrencyManagement.value(); } Lock lock = beanType.getAnnotation(Lock.class); if (lock != null) { _classLockType = lock.value(); } _classAccessTimeout = beanType.getAnnotation(AccessTimeout.class); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { ConcurrencyManagement cmAn = (ConcurrencyManagement) ainfo.getAnnotation(); ConcurrencyManagementType cmType = cmAn.value(); for (EjbContext ejbContext : ejbContexts) { EjbDescriptor ejbDesc = ejbContext.getDescriptor(); if (ejbDesc instanceof EjbSessionDescriptor) { EjbSessionDescriptor.ConcurrencyManagementType descCMType; switch(cmType) { case CONTAINER : descCMType = EjbSessionDescriptor.ConcurrencyManagementType.Container; break; case BEAN : descCMType = EjbSessionDescriptor.ConcurrencyManagementType.Bean; break; default : throw new AnnotationProcessorException("Unsupported concurrency management " + "type = " + cmType); } EjbSessionDescriptor sDesc = (EjbSessionDescriptor) ejbDesc; // Set value on descriptor unless it has been set by .xml sDesc.setConcurrencyManagementTypeIfNotSet(descCMType); } } return getDefaultProcessedResult(); }
@Override protected void fillClassDefaults() { AnnotatedTypeImpl<X> ejbClass = getAnnotatedType(); ConcurrencyManagement concurrencyManagementAttribute = ejbClass .getAnnotation(ConcurrencyManagement.class); if ((concurrencyManagementAttribute == null) || (concurrencyManagementAttribute.value() == ConcurrencyManagementType.CONTAINER)) { Lock lockingAttribute = ejbClass.getAnnotation(Lock.class); if (lockingAttribute == null) { ejbClass.addAnnotation(new LockingAttributeLiteral(LockType.WRITE)); } } super.fillClassDefaults(); } }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { ConcurrencyManagement cmAn = (ConcurrencyManagement) ainfo.getAnnotation(); ConcurrencyManagementType cmType = cmAn.value(); for (EjbContext ejbContext : ejbContexts) { EjbDescriptor ejbDesc = ejbContext.getDescriptor(); if (ejbDesc instanceof EjbSessionDescriptor) { EjbSessionDescriptor.ConcurrencyManagementType descCMType; switch(cmType) { case CONTAINER : descCMType = EjbSessionDescriptor.ConcurrencyManagementType.Container; break; case BEAN : descCMType = EjbSessionDescriptor.ConcurrencyManagementType.Bean; break; default : throw new AnnotationProcessorException("Unsupported concurrency management " + "type = " + cmType); } EjbSessionDescriptor sDesc = (EjbSessionDescriptor) ejbDesc; // Set value on descriptor unless it has been set by .xml sDesc.setConcurrencyManagementTypeIfNotSet(descCMType); } } return getDefaultProcessedResult(); }
ConcurrencyManagementType concurrencyType = ConcurrencyManagementType.CONTAINER; if (tx != null) { concurrencyType = tx.value();
javax.ejb.ConcurrencyManagementType concurrencyType = javax.ejb.ConcurrencyManagementType.CONTAINER; if (tx != null) { concurrencyType = tx.value();
javax.ejb.ConcurrencyManagementType concurrencyType = javax.ejb.ConcurrencyManagementType.CONTAINER; if (tx != null) { concurrencyType = tx.value();