} else {
// try to get a lock within the specified period.
try {
lockAcquired = lock.tryLock(accessTimeout.getTime(), accessTimeout.getUnit());
} catch (InterruptedException e) {
throw (ConcurrentAccessTimeoutException) new ConcurrentAccessTimeoutException("Unable to get " + (read ? "read" : "write") + " lock within specified time on '" + runMethod.getName() + "' method for: " + instance.bean.getClass().getName()).initCause(e);
}
}
// Did we acquire the lock to the current execution?
if (!lockAcquired) {
throw new ConcurrentAccessTimeoutException("Unable to get " + (read ? "read" : "write") + " lock on '" + runMethod.getName() + "' method for: " + instance.bean.getClass().getName());
}
return lock;
}