private ConcurrentLockType toLock(final Lock annotation) { if (LockType.READ.equals(annotation.value())) { return ConcurrentLockType.READ; } else if (LockType.WRITE.equals(annotation.value())) { return ConcurrentLockType.WRITE; } else { throw new IllegalArgumentException("Unknown lock annotation: " + annotation.value()); } }
private ConcurrentLockType toLock(final Lock annotation) { if (LockType.READ.equals(annotation.value())) { return ConcurrentLockType.READ; } else if (LockType.WRITE.equals(annotation.value())) { return ConcurrentLockType.WRITE; } else { throw new IllegalArgumentException("Unknown lock annotation: " + annotation.value()); } }
public void addClassLevelDeclaration(javax.ejb.Lock attribute, Class type) { ContainerConcurrency ctx = new ContainerConcurrency(cast(attribute.value()), type.getName(), ejbName, "*"); assemblyDescriptor.getContainerConcurrency().add(ctx); }
public void addMethodLevelDeclaration(javax.ejb.Lock attribute, Method method) { ContainerConcurrency ctx = new ContainerConcurrency(cast(attribute.value()), ejbName, method); assemblyDescriptor.getContainerConcurrency().add(ctx); }
if( lockAnn.value() == LockType.WRITE) { ejbDesc.addWriteLockMethod(newMethodDesc); } else {
private void initDefaultLock() { if (!BeanType.SINGLETON.equals(this.componentType)) { return; } final ArrayList<Class> classes = new ArrayList<Class>(); for (final Class local : businessRemotes) { classes.add(local); } for (final Class local : businessLocals) { classes.add(local); } classes.add(this.beanClass); for (final Class c : classes) { Lock lock = null; try { lock = (Lock) c.getAnnotation(Lock.class); this.getSingleton().lockType = lock.value(); if (logger.isDebugEnabled()) { logger.debug("Declared Lock for " + c.getName() + " is " + this.getSingleton().lockType); } } catch (final NullPointerException e) { //Ignore } catch (final Throwable e) { logger.warning("Failed to determine from: " + lock); } } if (logger.isDebugEnabled()) { logger.debug("Default Lock for " + this.beanClass.getName() + " is " + this.getSingleton().lockType); } }
if( lockAnn.value() == LockType.WRITE) { ejbDesc.addWriteLockMethod(newMethodDesc); } else {
private void initDefaultLock() { if (!BeanType.SINGLETON.equals(this.componentType)) { return; } final ArrayList<Class> classes = new ArrayList<Class>(); for (final Class local : businessRemotes) { classes.add(local); } for (final Class local : businessLocals) { classes.add(local); } classes.add(this.beanClass); for (final Class c : classes) { Lock lock = null; try { lock = (Lock) c.getAnnotation(Lock.class); this.getSingleton().lockType = lock.value(); if (logger.isDebugEnabled()) { logger.debug("Declared Lock for " + c.getName() + " is " + this.getSingleton().lockType); } } catch (final NullPointerException e) { //Ignore } catch (final Throwable e) { logger.warning("Failed to determine from: " + lock); } } if (logger.isDebugEnabled()) { logger.debug("Default Lock for " + this.beanClass.getName() + " is " + this.getSingleton().lockType); } }
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); }
if( lockAnn.value() == LockType.WRITE) { singletonDesc.addWriteLockMethod(newMethodDesc); } else {