2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.binding.dom.adapter.osgi;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.mdsal.binding.api.DataBroker;
13 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
14 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
15 import org.opendaylight.mdsal.binding.api.ReadTransaction;
16 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
17 import org.opendaylight.mdsal.binding.api.TransactionChain;
18 import org.opendaylight.mdsal.binding.api.WriteTransaction;
19 import org.opendaylight.yangtools.concepts.Registration;
20 import org.opendaylight.yangtools.yang.binding.DataObject;
21 import org.osgi.service.component.annotations.Activate;
22 import org.osgi.service.component.annotations.Component;
23 import org.osgi.service.component.annotations.Deactivate;
26 @Component(factory = OSGiDataBroker.FACTORY_NAME)
27 public final class OSGiDataBroker extends AbstractAdaptedService<DataBroker> implements DataBroker {
28 // OSGi DS Component Factory name
29 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiDataBroker";
32 public OSGiDataBroker(final Map<String, ?> properties) {
33 super(DataBroker.class, properties);
37 void deactivate(final int reason) {
42 public ReadTransaction newReadOnlyTransaction() {
43 return delegate.newReadOnlyTransaction();
47 public ReadWriteTransaction newReadWriteTransaction() {
48 return delegate.newReadWriteTransaction();
52 public WriteTransaction newWriteOnlyTransaction() {
53 return delegate.newWriteOnlyTransaction();
57 public TransactionChain createTransactionChain() {
58 return delegate.createTransactionChain();
62 public TransactionChain createMergingTransactionChain() {
63 return delegate.createMergingTransactionChain();
67 public <T extends DataObject> Registration registerTreeChangeListener(final DataTreeIdentifier<T> treeId,
68 final DataTreeChangeListener<T> listener) {
69 return delegate.registerTreeChangeListener(treeId, listener);
73 @Deprecated(since = "13.0.0", forRemoval = true)
74 public <T extends DataObject> Registration registerLegacyTreeChangeListener(final DataTreeIdentifier<T> treeId,
75 final DataTreeChangeListener<T> listener) {
76 return delegate.registerLegacyTreeChangeListener(treeId, listener);