}
private void setConcurrencyInvInfo(Method invInfoMethod, String methodIntf,
InvocationInfo invInfo) {
MethodLockInfo lockInfo = null;
// Set READ/WRITE lock info. Only applies to singleton beans.
if( isSingleton ) {
EjbSessionDescriptor singletonDesc = (EjbSessionDescriptor) ejbDescriptor;
List<MethodDescriptor> readLockMethods = singletonDesc.getReadLockMethods();
List<MethodDescriptor> writeLockMethods = singletonDesc.getWriteLockMethods();
for(MethodDescriptor readLockMethodDesc : readLockMethods) {
Method readLockMethod = readLockMethodDesc.getMethod(singletonDesc);
if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, readLockMethod)) {
lockInfo = new MethodLockInfo();
lockInfo.setLockType(LockType.READ);
break;
}
}
if( lockInfo == null ) {
for(MethodDescriptor writeLockMethodDesc : writeLockMethods) {
Method writeLockMethod = writeLockMethodDesc.getMethod(singletonDesc);
if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, writeLockMethod)) {
lockInfo = new MethodLockInfo();
lockInfo.setLockType(LockType.WRITE);
break;
}
}
}
}
// Set AccessTimeout info
if( isSingleton || isStatefulSession ) {
EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDescriptor;
List<EjbSessionDescriptor.AccessTimeoutHolder> accessTimeoutInfo =
sessionDesc.getAccessTimeoutInfo();
for(EjbSessionDescriptor.AccessTimeoutHolder accessTimeoutHolder : accessTimeoutInfo) {
MethodDescriptor accessTimeoutMethodDesc = accessTimeoutHolder.method;
Method accessTimeoutMethod = accessTimeoutMethodDesc.getMethod(sessionDesc);
if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, accessTimeoutMethod)) {
if( lockInfo == null ) {
lockInfo = new MethodLockInfo();
}
lockInfo.setTimeout(accessTimeoutHolder.value , accessTimeoutHolder.unit);
break;
}
}
}