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;
10 import com.google.common.annotations.Beta;
12 import java.util.concurrent.Executor;
13 import org.opendaylight.mdsal.binding.api.NotificationService;
14 import org.opendaylight.mdsal.binding.api.NotificationService.Listener;
15 import org.opendaylight.yangtools.concepts.ListenerRegistration;
16 import org.opendaylight.yangtools.concepts.Registration;
17 import org.opendaylight.yangtools.yang.binding.DataObject;
18 import org.opendaylight.yangtools.yang.binding.Notification;
19 import org.opendaylight.yangtools.yang.binding.NotificationListener;
20 import org.osgi.service.component.annotations.Activate;
21 import org.osgi.service.component.annotations.Component;
22 import org.osgi.service.component.annotations.Deactivate;
25 @Component(factory = OSGiNotificationService.FACTORY_NAME)
26 public final class OSGiNotificationService extends AbstractAdaptedService<NotificationService>
27 implements NotificationService {
28 // OSGi DS Component Factory name
29 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationService";
31 public OSGiNotificationService() {
32 super(NotificationService.class);
36 public <T extends NotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener) {
37 return delegate().registerNotificationListener(listener);
41 public <N extends Notification<N> & DataObject> Registration registerListener(final Class<N> type,
42 final Listener<N> listener, final Executor executor) {
43 return delegate().registerListener(type, listener, executor);
47 void activate(final Map<String, ?> properties) {
52 void deactivate(final int reason) {