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;
11 import com.google.common.util.concurrent.ListenableFuture;
13 import java.util.concurrent.TimeUnit;
14 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
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;
21 @Component(factory = OSGiNotificationPublishService.FACTORY_NAME)
22 public final class OSGiNotificationPublishService extends AbstractAdaptedService<NotificationPublishService>
23 implements NotificationPublishService {
24 // OSGi DS Component Factory name
25 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationPublishService";
27 public OSGiNotificationPublishService() {
28 super(NotificationPublishService.class);
32 public void putNotification(final Notification notification) throws InterruptedException {
33 delegate().putNotification(notification);
37 public ListenableFuture<? extends Object> offerNotification(final Notification notification) {
38 return delegate().offerNotification(notification);
42 public ListenableFuture<? extends Object> offerNotification(final Notification notification, final int timeout,
43 final TimeUnit unit) throws InterruptedException {
44 return delegate().offerNotification(notification, timeout, unit);
48 void activate(final Map<String, ?> properties) {