Package javax.ejb

Examples of javax.ejb.LockType


      {
         return null;
      }
      JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) metaData;
      // get the bean level lock type
      LockType lockType = sessionBean.getLockType();
      // if no bean level lock type specified, then just return null
      if (lockType == null)
      {
         return null;
      }
View Full Code Here


         // set the method params on the named method metadata
         namedMethod.setMethodParams(methodParams);
      }
      // get the concurrency method metadata for this named method
      ConcurrentMethodMetaData concurrentMethodMetaData = sessionBean.getConcurrentMethods().get(namedMethod);
      LockType lockType = null;
      // if this named method did not have concurrency metadata or lock metadata, then
      // check for the method named "*" and see if that has the lock type set
      if (concurrentMethodMetaData == null || concurrentMethodMetaData.getLockType() == null)
      {
         // get lock type for method "*"
 
View Full Code Here

            lock.unlock();
        }
    }

    private Lock getLock(LockableComponent lockableComponent, Method method) {
        LockType lockType = lockableComponent.getLockType(method);
        switch (lockType) {
            case READ:
                return readWriteLock.readLock();
            case WRITE:
                return readWriteLock.writeLock();
View Full Code Here

    }

    @Override
    public LockType getLockType(Method method) {
        final EJBBusinessMethod ejbMethod = new EJBBusinessMethod(method);
        final LockType lockType = this.methodLockTypes.get(ejbMethod);
        if (lockType != null) {
            return lockType;
        }
        // check bean level lock type
        final LockType type = this.beanLevelLockType.get(method.getDeclaringClass().getName());
        if (type != null) {
            return type;
        }
        // default WRITE lock type
        return LockType.WRITE;
View Full Code Here

    }

    @Override
    public LockType getLockType(Method method) {
        final EJBBusinessMethod ejbMethod = new EJBBusinessMethod(method);
        final LockType lockType = this.methodLockTypes.get(ejbMethod);
        if (lockType != null) {
            return lockType;
        }
        // check bean level lock type
        final LockType type = this.beanLevelLockType.get(method.getDeclaringClass().getName());
        if (type != null) {
            return type;
        }
        // default WRITE lock type
        return LockType.WRITE;
View Full Code Here

      {
         return null;
      }
      JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) metaData;
      // get the bean level lock type
      LockType lockType = sessionBean.getLockType();
      // if no bean level lock type specified, then just return null
      if (lockType == null)
      {
         return null;
      }
View Full Code Here

         String declaringClass = method.getDeclaringClass();
         // the check here for @Singleton bean is for optimization, so as to avoid
         // doing additional checks for non @Singleton beans since only @Singleton beans have explicit @Lock
         if (sessionBean.isSingleton() && declaringClass != null && !sessionBean.getEjbClass().equals(declaringClass))
         {
            LockType lockType = sessionBean.getLockType(declaringClass);
            if (lockType == null)
            {
               lockType = LockType.WRITE;
            }
            Lock lock = new LockImpl(lockType);
            return annotationClass.cast(lock);
         }
         // the method was invoked on the bean class (and not on super class of bean).
         // So return null. Later resolveClassAnnotation will pick up the correct bean level
         // lock semantics (either via the annotation or via metadata)
         return null;
      }
      // get the concurrency method metadata for this named method
      ConcurrentMethodMetaData concurrentMethodMetaData = concurrentMethods.find(namedMethod);
      LockType lockType = null;
      // if this named method did not have concurrency metadata or lock metadata, then
      // check for the method named "*" and see if that has the lock type set
      if (concurrentMethodMetaData == null || concurrentMethodMetaData.getLockType() == null)
      {
         // get lock type for method "*"
 
View Full Code Here

            lock.unlock();
        }
    }

    private Lock getLock(LockableComponent lockableComponent, Method method) {
        LockType lockType = lockableComponent.getLockType(method);
        switch (lockType) {
            case READ:
                return readWriteLock.readLock();
            case WRITE:
                return readWriteLock.writeLock();
View Full Code Here

    }

    @Override
    public LockType getLockType(Method method) {
        final EJBBusinessMethod ejbMethod = new EJBBusinessMethod(method);
        final LockType lockType = this.methodLockTypes.get(ejbMethod);
        if (lockType != null) {
            return lockType;
        }
        // check bean level lock type
        final LockType type = this.beanLevelLockType.get(method.getDeclaringClass().getName());
        if (type != null) {
            return type;
        }
        // default WRITE lock type
        return LockType.WRITE;
View Full Code Here

            lock.unlock();
        }
    }

    private Lock getLock(LockableComponent lockableComponent, Method method) {
        LockType lockType = lockableComponent.getLockType(method);
        switch (lockType) {
            case READ:
                return readWriteLock.readLock();
            case WRITE:
                return readWriteLock.writeLock();
View Full Code Here

TOP

Related Classes of javax.ejb.LockType

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.