Deprecate all MD-SAL APIs
[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 @Deprecated
16 class BindingDataTreeChangeListenerRegistration<L extends DataTreeChangeListener<?>>
17         extends AbstractListenerRegistration<L> {
18
19     private final ListenerRegistration<?> domReg;
20
21     BindingDataTreeChangeListenerRegistration(final L listener, final ListenerRegistration<?> domReg) {
22         super(listener);
23         this.domReg = Preconditions.checkNotNull(domReg);
24     }
25
26     @Override
27     protected void removeRegistration() {
28         domReg.close();
29     }
30 }