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.util.concurrent.ListenableFuture;
12 import java.util.concurrent.TimeUnit;
13 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
14 import org.opendaylight.yangtools.yang.binding.Notification;
15 import org.osgi.service.component.annotations.Activate;
16 import org.osgi.service.component.annotations.Component;
17 import org.osgi.service.component.annotations.Deactivate;
19 @Component(factory = OSGiNotificationPublishService.FACTORY_NAME)
20 public final class OSGiNotificationPublishService extends AbstractAdaptedService<NotificationPublishService>
21 implements NotificationPublishService {
22 // OSGi DS Component Factory name
23 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationPublishService";
26 public OSGiNotificationPublishService(final Map<String, ?> properties) {
27 super(NotificationPublishService.class, properties);
31 void deactivate(final int reason) {
36 public void putNotification(final Notification<?> notification) throws InterruptedException {
37 delegate.putNotification(notification);
41 public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification) {
42 return delegate.offerNotification(notification);
46 public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification, final int timeout,
47 final TimeUnit unit) throws InterruptedException {
48 return delegate.offerNotification(notification, timeout, unit);