Add MXBean to report shard registered DTCL/DCL info
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDataTreeChangeListenerRegistration.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.md.sal.binding.impl;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
12 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
13 import org.opendaylight.yangtools.concepts.ListenerRegistration;
14
15 class BindingDataTreeChangeListenerRegistration<L extends DataTreeChangeListener<?>> extends AbstractListenerRegistration<L> {
16
17     private final ListenerRegistration<?> domReg;
18
19     BindingDataTreeChangeListenerRegistration(final L listener, final ListenerRegistration<?> domReg) {
20         super(listener);
21         this.domReg = Preconditions.checkNotNull(domReg);
22     }
23
24     @Override
25     protected void removeRegistration() {
26         domReg.close();
27     }
28 }