コード例 #1
0
  protected boolean addUnsynchronized(Object o)
      throws KeeperException, InterruptedException, IOException {
    this.keeper.create(
        this.znode + "/entry-",
        Transformer.objectToBytes(o, elementClass),
        this.acl,
        this.createMode);

    return true;
  }
コード例 #2
0
  protected boolean removeUnsynchronized(Object o)
      throws InterruptedException, KeeperException, IOException {
    for (String s : this.keeper.getChildren(this.znode, this.watcher))
      if (Arrays.equals(
          this.keeper.getData(this.znode + '/' + s, false, null),
          Transformer.objectToBytes(o, elementClass))) {
        this.keeper.delete(this.znode + '/' + s, -1);

        return true;
      }

    return false;
  }