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 java.util.concurrent.Executor;
12 import org.opendaylight.mdsal.binding.api.NotificationService;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.Notification;
16 import org.osgi.service.component.annotations.Activate;
17 import org.osgi.service.component.annotations.Component;
18 import org.osgi.service.component.annotations.Deactivate;
20 @Component(factory = OSGiNotificationService.FACTORY_NAME)
21 public final class OSGiNotificationService extends AbstractAdaptedService<NotificationService>
22 implements NotificationService {
23 // OSGi DS Component Factory name
24 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationService";
27 public OSGiNotificationService(final Map<String, ?> properties) {
28 super(NotificationService.class, properties);
32 void deactivate(final int reason) {
37 public <N extends Notification<N> & DataObject> Registration registerListener(final Class<N> type,
38 final NotificationService.Listener<N> listener, final Executor executor) {
39 return delegate.registerListener(type, listener, executor);
43 public Registration registerCompositeListener(final NotificationService.CompositeListener listener,
44 final Executor executor) {
45 return delegate.registerCompositeListener(listener, executor);