if (beanContext.isBeanManagedConcurrency()) {
return;
}
final Logger log = Logger.getInstance(LogCategory.OPENEJB_STARTUP.createChild("attributes"), MethodConcurrencyBuilder.class);
final List<MethodConcurrencyInfo> lockInfos = new ArrayList<MethodConcurrencyInfo>();
final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<MethodConcurrencyInfo>();
MethodConcurrencyBuilder.normalize(methodConcurrencyInfos, lockInfos, accessTimeoutInfos);
Map<Method, MethodAttributeInfo> attributes;
// handle @Lock
attributes = MethodInfoUtil.resolveAttributes(lockInfos, beanContext);
if (log.isDebugEnabled()) {
for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
final Method method = entry.getKey();
final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
log.debug("Lock: " + method + " -- " + MethodInfoUtil.toString(value.methods.get(0)) +
" " + value.concurrencyAttribute);
}
}
for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
final MethodContext methodContext = beanContext.getMethodContext(entry.getKey());
final String s = value.concurrencyAttribute.toUpperCase();
methodContext.setLockType(LockType.valueOf(s));
}
// handle @AccessTimeout
attributes = MethodInfoUtil.resolveAttributes(accessTimeoutInfos, beanContext);
if (log.isDebugEnabled()) {
for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
final Method method = entry.getKey();
final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
log.debug("AccessTimeout: " + method + " -- " + MethodInfoUtil.toString(value.methods.get(0)) + " " +
" " + value.accessTimeout.time + " " + value.accessTimeout.unit);
}
}
for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {