コード例 #1
0
  public void lock(K key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);

    final Data keyData = toData(key);
    ClientMessage request =
        MultiMapLockCodec.encodeRequest(name, keyData, ThreadUtil.getThreadId(), -1);
    invoke(request, keyData);
  }
コード例 #2
0
  public void lock(K key, long leaseTime, TimeUnit timeUnit) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    checkPositive(leaseTime, "leaseTime should be positive");

    final Data keyData = toData(key);
    ClientMessage request =
        MultiMapLockCodec.encodeRequest(
            name, keyData, ThreadUtil.getThreadId(), getTimeInMillis(leaseTime, timeUnit));
    invoke(request, keyData);
  }