All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rinoto.migramongo.dao.LockService Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package com.rinoto.migramongo.dao;

import com.rinoto.migramongo.LockEntry;

/**
 * Acquires and releases locks.
 * 

* To avoid concurrent executions in migramongo. * */ public interface LockService { /** * Acquires the lock *

* IMPORTANT The lock MUST be explicitly released by the * client * * @return true if the lock could be acquired. false if not (i.e. someone * else alredy acquired it before, and it has not released it yet) */ boolean acquireLock(); /** * Releases the lock * * @return true if the release of the lock was succesful */ boolean releaseLock(); /** * It gets the current lockEntry with usefull information (isLocked, * latestLockDate, ...) * * @return null if none */ LockEntry getLockInformation(); /** * It destroys the lock and inits it again - useful in cases where the lock * is corrupted and it stays in locked state */ void destroyLock(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy