public Object[] createNodes(Fqn fqn) { List<NodeSPI> result = new ArrayList<NodeSPI>(fqn.size()); Fqn tmpFqn = Fqn.ROOT; int size = fqn.size(); // root node NodeSPI n = root; for (int i = 0; i < size; i++) { Object childName = fqn.get(i); tmpFqn = Fqn.fromRelativeElements(tmpFqn, childName); NodeSPI childNode; Map children = n.getChildrenMapDirect(); childNode = (NodeSPI) children.get(childName); if (childNode == null) { childNode = n.addChildDirect(Fqn.fromElements(childName)); result.add(childNode); } n = childNode; } return new Object[]{result, n}; }
NodeSPI child = node.addChildDirect(childFqn); if ((isMove || isActivation) && recursive)
private Object handlePutCommand(InvocationContext ctx, DataCommand command, boolean zeroAcquisitionTimeout) throws Throwable { if ((ctx.isLockingSuppressed()) || configuration.getIsolationLevel() == IsolationLevel.NONE) { if (trace) log.trace("Suppressing locking, creating nodes if necessary"); int treeNodeSize = command.getFqn().size(); NodeSPI n = dataContainer.getRoot(); for (int i = 0; i < treeNodeSize; i++) { Object childName = command.getFqn().get(i); Fqn childFqn = Fqn.fromElements(childName); NodeSPI childNode = n.getChildDirect(childFqn); if (childNode == null) childNode = n.addChildDirect(childFqn); LockUtil.manageReverseRemove(ctx, childNode, true, null, commandsFactory); n = childNode; } } else { lockManager.lockPessimistically(ctx, command.getFqn(), WRITE, true, zeroAcquisitionTimeout, false, true, null, false); } return invokeNextInterceptor(ctx, command); }
underlyingNode.addChildDirect(childNode); childNode.setValid(true, false);