Beispiel #1
0
  private boolean removeChild(AdvancedCache cache, Object childName) {
    startAtomic();
    try {
      AtomicMap<Object, Fqn> s = getStructure(cache);
      Fqn childFqn = s.remove(childName);
      if (childFqn != null) {
        Node<K, V> child = new NodeImpl<K, V>(childFqn, cache, batchContainer);
        child.removeChildren();
        child
            .clearData(); // this is necessary in case we have a remove and then an add on the same
                          // node, in the same tx.
        cache.remove(new NodeKey(childFqn, NodeKey.Type.DATA));
        cache.remove(new NodeKey(childFqn, NodeKey.Type.STRUCTURE));
        return true;
      }

      return false;
    } finally {
      endAtomic();
    }
  }