class LockManager {

	public boolean get(String lockName, String transactionId) {
		GregorianCalendar cal = new GregorianCalendar();
		cal.add(Calendar.SECOND, config.getInt("lock.wait"));
		Date ldDate = cal.getTime();
		while (new Date().before(ldDate)) {
			if (getInternal(lockName, transactionId)) {
				log.debug("Acquired lock " + lockName);
				return true;
			} else
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
				}
		}

		log.warn("Unable to get lock " + lockName);
		return false;
	}

}