Updates the lock's <code>expiration</code> and <code>lockType</code> in the underlying store.
Param <code>lockType</code> may be null.

@param lock
@param newExpiration java.util.Date
@param newLockType Integer
332689
@Override
    public void update(IEntityLock lock, Date newExpiration, Integer newLockType)
            throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            if (newLockType != null) {
                primDeleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey(), conn);
            }
            primUpdate(lock, newExpiration, newLockType, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem updating " + lock, sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
452005
void expireAfterWrite(String key, @Nullable String value) {
    requireArgument(expireAfterWriteDuration == UNSET_INT, "expireAfterWrite was already set");
    expireAfterWriteDuration = parseDuration(key, value);
    expireAfterWriteTimeUnit = parseTimeUnit(key, value);
  }
400332
public void doAddNew() throws DBException
    {
        if (this.lockOnDBTrxType(null, DBConstants.ADD_TYPE, false))  // ADD_TYPE = Add new; Should I do the unlock in my code?
            this.unlockIfLocked(this.getRecord(), null);    // Release any locks
    }
1200089
protected void updateLockHolder(String clientId, long lockDurationMs) {
        this.clientId = clientId;
        this.timestampExpiry = System.currentTimeMillis() + lockDurationMs;
    }
155194
@Override
    public void release(IEntityLock lock) throws LockingException {
        getLockStore().delete(lock);
        ((EntityLockImpl) lock).setExpirationTime(new Date(0));
    }
168389
public Lock getLock(String lockName, LockType type, String comment) {
		Lock lock = new SimpleLock(lockName,type,comment, getSleepTime(), this);
		return lock;
	}
743909
@GuardedBy("evictionLock")
  void expireEntries() {
    long now = expirationTicker().read();
    expireAfterAccessEntries(now);
    expireAfterWriteEntries(now);
    expireVariableEntries(now);
  }
411781
private boolean isLocked(Class entityType, String entityKey) throws LockingException {
        return isLocked(entityType, entityKey, null);
    }
153328
@Override
    public CompletableFuture<Void> setExpireSecondsAsync(String key, int expireSeconds) {
        return (CompletableFuture) send("EXPIRE", null, (Type) null, key, key.getBytes(UTF8), String.valueOf(expireSeconds).getBytes(UTF8));
    }
1096176
@Override
    public void renew(IEntityLock lock, int duration) throws LockingException {
        if (isValid(lock)) {
            Date newExpiration = getNewExpiration(duration);
            getLockStore().update(lock, newExpiration);
            ((EntityLockImpl) lock).setExpirationTime(newExpiration);
        } else {
            throw new LockingException("Could not renew " + lock + " : lock is invalid.");
        }
    }
1282782
private void initialize() throws LockingException {
        Date expiration = new Date(System.currentTimeMillis() - (60 * 60 * 1000));
        deleteExpired(expiration, null, null);
    }
1025212
@Override
    public void delete(IEntityLock lock) throws LockingException {
        Map m = getLockCache(lock.getEntityType());
        synchronized (m) {
            m.remove(getCacheKey(lock));
        }
    }
1220188
protected void handleLockExpiry(SharedSessionContractImplementor session, Object key, Lockable lock) {
        long ts = region.nextTimestamp() + region.getTimeout();
        // create new lock that times out immediately
        Lock newLock = new Lock(ts, uuid, nextLockId.getAndIncrement(), null);
        newLock.unlock(ts);
        region.put(session, key, newLock);
    }
432625
protected void updateLockHolder(JedisCommands jedisCommands) {
        String key = getName();
        String clientId = jedisCommands.get(key);
        setClientId(clientId);
        if (!StringUtils.isBlank(clientId)) {
            Long ttl = jedisCommands.pttl(key);
            if (ttl != null && ttl.longValue() != -2) {
                setTimestampExpiry(ttl.longValue() != -1
                        ? System.currentTimeMillis() + ttl.longValue() : Integer.MAX_VALUE);
            } else {
                setTimestampExpiry(Integer.MAX_VALUE);
            }
        } else {
            setTimestampExpiry(0);
        }
    }
232144
private void primAdd(IEntityLock lock, Date expiration) throws LockingException {
        long now = System.currentTimeMillis();
        long willExpire = expiration.getTime();
        long cacheIntervalSecs = (willExpire - now) / 1000;

        if (cacheIntervalSecs > 0) {
            SmartCache sc = (SmartCache) getLockCache(lock.getEntityType());

            synchronized (sc) {
                sc.put(getCacheKey(lock), lock, (cacheIntervalSecs));
            }
        }
        // Else the lock has already expired.
    }
1092763
@Override
    public void add(IEntityLock lock) throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            primDeleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey(), conn);
            primAdd(lock, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem creating " + lock, sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
269155
CompletableFuture<Boolean> actualRemoveMaxIdleExpireEntry(K key, V value, long maxIdle, boolean skipLocking) {
      CompletableFuture<Boolean> completableFuture = new CompletableFuture<>();
      Object expiringObject = expiring.putIfAbsent(key, completableFuture);
      if (expiringObject == null) {
         if (trace) {
            log.tracef("Submitting expiration removal for key %s which had maxIdle of %s", toStr(key), maxIdle);
         }
         completableFuture.whenComplete((b, t) -> expiring.remove(key, completableFuture));
         try {
            AdvancedCache<K, V> cacheToUse = skipLocking ? cache.withFlags(Flag.SKIP_LOCKING) : cache;
            CompletableFuture<Boolean> expired = cacheToUse.removeMaxIdleExpired(key, value);
            expired.whenComplete((b, t) -> {
               if (t != null) {
                  completableFuture.completeExceptionally(t);
               } else {
                  completableFuture.complete(b);
               }
            });
            return completableFuture;
         } catch (Throwable t) {
            completableFuture.completeExceptionally(t);
            throw t;
         }
      } else if (expiringObject instanceof CompletableFuture) {
         // This means there was another thread that found it had expired via max idle
         return (CompletableFuture<Boolean>) expiringObject;
      } else {
         // If it wasn't a CompletableFuture we had a lifespan removal occurring so it will be removed for sure
         return CompletableFutures.completedTrue();
      }
   }