Remove OSGiBindingAdapterFactory
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / 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.mdsal.binding.dom.adapter;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
13 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
14 import org.opendaylight.yangtools.concepts.ListenerRegistration;
15
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 = requireNonNull(domReg);
24     }
25
26     @Override
27     protected void removeRegistration() {
28         domReg.close();
29     }
30 }