2 * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.config.yang.md.sal.binding.impl;
10 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
11 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
12 import org.opendaylight.controller.md.sal.binding.compat.HeliumNotificationProviderServiceAdapter;
13 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
14 import org.opendaylight.controller.sal.binding.impl.NotificationBrokerImpl;
19 public final class NotificationBrokerImplModule extends
20 org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractNotificationBrokerImplModule {
22 public NotificationBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
23 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
24 super(identifier, dependencyResolver);
27 public NotificationBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
28 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
29 final NotificationBrokerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
30 super(identifier, dependencyResolver, oldModule, oldInstance);
34 public void validate() {
36 // Add custom validation for module attributes here.
40 public java.lang.AutoCloseable createInstance() {
42 final NotificationPublishService notificationPublishService = getNotificationPublishAdapterDependency();
43 final NotificationService notificationService = getNotificationAdapterDependency();
45 if(notificationPublishService != null & notificationService != null) {
46 return new HeliumNotificationProviderServiceAdapter(notificationPublishService, notificationService);
50 * FIXME: Switch to new broker (which has different threading model)
51 * once this change is communicated with downstream users or
52 * we will have adapter implementation which will honor Helium
53 * threading model for notifications.
56 return new NotificationBrokerImpl(SingletonHolder.getDefaultNotificationExecutor());