this.directory = directory;
}
@Override
public boolean obtain() throws IOException {
LockDAO lockDAO = new LockDAO();
fi.foyt.hibernate.gae.search.persistence.domainmodel.Lock lock = lockDAO.findByDirectoryAndName(directory, lockName);
if (lock != null) {
return false;
}
lockDAO.create(directory, lockName);
return true;
}