protected boolean lock(String id) throws InterruptedException {
if (id == null || id.length() == 0) {
XLog.getLog(getClass()).warn("lock(): Id is null or empty :" + id + ":");
return false;
}
LockToken token = Services.get().get(MemoryLocksService.class).getWriteLock(id, LOCK_TIMEOUT);
if (token != null) {
locks.add(token);
return true;
}
else {