public boolean acquire(String resourceId, Long ttl) throws LightblueException { return acquire(callerId, resourceId, ttl); }
public boolean release(String resourceId) throws LightblueException { return release(callerId, resourceId); }
public int getLockCount() throws LightblueException { return Locking.this.getLockCount(resourceId); }
public boolean ping(String resourceId) throws LightblueException { return ping(callerId, resourceId); }
public Lock lock(String resourceId) throws LightblueException { return lock(resourceId, null); }
public boolean ping() throws LightblueException { return Locking.this.ping(resourceId); }
public boolean acquire(String resourceId) throws LightblueException { return acquire(callerId, resourceId, null); }
public boolean release() throws LightblueException { return Locking.this.release(resourceId); }
public int getLockCount(String resourceId) throws LightblueException { return getLockCount(callerId, resourceId); }
public Lock lock(String resourceId, Long ttl) throws LightblueException { if (acquire(resourceId, ttl)) { return new Lock(resourceId); } return null; }
public void unlock(String id) { LOGGER.debug("Unlocking {}", id); try { locking.release(id); } catch (Exception e) { LOGGER.error("Error unlocking {}", id, e); } myLocks.remove(id); Breakpoint.checkpoint("MigratorController:unlock"); }
/** * Attempts to lock a migration job. If successful, return the migration job * and the active execution */ public ActiveExecution lock(String id) throws Exception { LOGGER.debug("locking {}", id); if (!myLocks.contains(id)) { if (locking.acquire(id, null)) { myLocks.add(id); ActiveExecution ae = new ActiveExecution(); ae.setMigrationJobId(id); ae.set_id(id); ae.setStartTime(new Date()); return ae; } } return null; }