2 * Copyright (c) 2014 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
9 package org.opendaylight.controller.cluster.datastore;
11 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
12 import org.opendaylight.yangtools.concepts.ListenerRegistration;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 * When a consumer registers a data change listener and no local shard is
18 * available to register that listener with then we return an instance of
19 * NoOpDataChangeListenerRegistration
23 * The NoOpDataChangeListenerRegistration as it's name suggests does
24 * nothing when an operation is invoked on it
26 public class NoOpDataChangeListenerRegistration
27 implements ListenerRegistration {
29 private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>
32 public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> NoOpDataChangeListenerRegistration(
33 AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener) {
35 this.listener = listener;
39 public AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> getInstance() {
43 @Override public void close() {