2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.dom.spi;
10 import static java.util.Objects.requireNonNull;
12 import java.util.concurrent.locks.Lock;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.concepts.AbstractRegistration;
17 * A stable read-only snapshot of a {@link AbstractRegistrationTree}.
19 * @author Robert Varga
22 public final class RegistrationTreeSnapshot<T> extends AbstractRegistration {
23 private final RegistrationTreeNode<T> node;
24 private final Lock lock;
26 RegistrationTreeSnapshot(final Lock lock, final RegistrationTreeNode<T> node) {
27 this.lock = requireNonNull(lock);
28 this.node = requireNonNull(node);
31 public RegistrationTreeNode<T> getRootNode() {
36 protected void removeRegistration() {