Update LockableObject.java

This commit is contained in:
Robert von Burg 2013-10-28 15:40:21 +01:00
parent 9ea4929497
commit 549d8fb8a7
1 changed files with 1 additions and 1 deletions

View File

@ -35,12 +35,12 @@ public class LockableObject {
public void lock() {
try {
logger.info("locking " + this.toString()); //$NON-NLS-1$
if (!this.lock.tryLock(tryLockTime, TimeUnit.MILLISECONDS)) {
String msg = "Failed to acquire lock after {0} for {1}"; //$NON-NLS-1$
msg = MessageFormat.format(msg, StringHelper.formatMillisecondsDuration(tryLockTime), this.toString());
throw new XmlPersistenceException(msg);
}
logger.info("locked " + this.toString()); //$NON-NLS-1$
} catch (InterruptedException e) {
throw new XmlPersistenceException("Thread interrupted: " + e.getMessage(), e); //$NON-NLS-1$
}