protected void acquireLock( @Nonnull final String sessionId, final long retryInterval, final long maxRetryInterval, final long timeout, final long start ) throws InterruptedException, ExecutionException, TimeoutException { final Future<Boolean> result = _storage.add( _sessionIdFormat.createLockName( sessionId ), _manager.getLockExpiration(), LOCK_VALUE ); if ( result.get().booleanValue() ) { if ( _log.isDebugEnabled() ) { _log.debug( "Locked session " + sessionId ); } return; } else { checkTimeoutAndWait( sessionId, retryInterval, timeout, start ); acquireLock( sessionId, min( retryInterval * 2, maxRetryInterval ), maxRetryInterval, timeout, start ); } }
protected void acquireLock( @Nonnull final String sessionId, final long retryInterval, final long maxRetryInterval, final long timeout, final long start ) throws InterruptedException, ExecutionException, TimeoutException { final Future<Boolean> result = _storage.add( _sessionIdFormat.createLockName( sessionId ), _manager.getLockExpiration(), LOCK_VALUE ); if ( result.get().booleanValue() ) { if ( _log.isDebugEnabled() ) { _log.debug( "Locked session " + sessionId ); } return; } else { checkTimeoutAndWait( sessionId, retryInterval, timeout, start ); acquireLock( sessionId, min( retryInterval * 2, maxRetryInterval ), maxRetryInterval, timeout, start ); } }