Package javax.ejb

Examples of javax.ejb.Lock


    public void postProcessAnnotation(AnnotationInfo ainfo, EjbContext ejbContext)
            throws AnnotationProcessorException {
        EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor();

        Class classAn = (Class)ainfo.getAnnotatedElement();
        Lock lockAnn = (Lock) ainfo.getAnnotation();

        // At this point, all method-level specific annotations have been processed.
        // For non-private methods, find the ones from the EjbContext's
        // component definition view that are declared on this class.  This will correctly
        // eliminate any overridden methods and provide the most-derived version of each.
        // Use the Class's declared methods list to get the private methods.

        List<Method> toProcess = new ArrayList<Method>();
        for(Method m : ejbContext.getComponentDefinitionMethods()) {
            if( classAn.equals(m.getDeclaringClass())) {
                toProcess.add(m);
            }
        }
        for(Method m : classAn.getDeclaredMethods()) {
            if( Modifier.isPrivate(m.getModifiers()) ) {
                toProcess.add(m);
            }
        }

        for( Method m : toProcess ) {

            // If the method is declared on the same class as the TYPE-level default
            // and it hasn't already been assigned lock information from the deployment
            // descriptor, set it.
            if( !matchesExistingReadOrWriteLockMethod(m, ejbDesc) ) {
                MethodDescriptor newMethodDesc = new MethodDescriptor(m);
                if( lockAnn.value() == LockType.WRITE) {
                    ejbDesc.addWriteLockMethod(newMethodDesc);
                } else {
                    ejbDesc.addReadLockMethod(newMethodDesc);
                }
            }
View Full Code Here


        }

        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);
                }
View Full Code Here

        }

        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);
                }
View Full Code Here

    if (implementationMethod != null) {
      implementationClass = implementationMethod.getDeclaringClass();
    }

    Lock lockAttribute = getAnnotation(Lock.class, apiMethod, apiClass,
        implementationMethod, implementationClass);

    if (lockAttribute != null) {
      _lockType = lockAttribute.value();
    }

    AccessTimeout accessTimeoutAttribute
      = getAnnotation(AccessTimeout.class,
                      apiMethod, apiClass,
View Full Code Here

        }

        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);
                }
View Full Code Here

    if (concurrencyManagement != null) {
      _concurrencyManagement = concurrencyManagement.value();
    }

    Lock lock = beanType.getAnnotation(Lock.class);

    if (lock != null) {
      _classLockType = lock.value();
    }

    _classAccessTimeout = beanType.getAnnotation(AccessTimeout.class);
  }
View Full Code Here

    AnnotatedType<?> declaringType = method.getDeclaringType();

    LockType lockType = null;

    Lock methodLevelLock = method.getAnnotation(Lock.class);

    Lock declaringClassLock = (declaringType != null) ? declaringType
        .getAnnotation(Lock.class) : null;

    // The method-level annotation takes precedence.
    if (methodLevelLock != null) {
      lockType = methodLevelLock.value();
    }
    // Then the class-level annotation at the declaring class takes precedence.
    else if (declaringClassLock != null) {
      lockType = declaringClassLock.value();
    }
    // Finally, the top level class annotation takes effect.
    else {
      lockType = _classLockType;
    }
View Full Code Here

TOP

Related Classes of javax.ejb.Lock

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.