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 "*"