Bug 2578 - Added Binding Adapters for new Notification Broker
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / NotificationBrokerImplModule.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
9
10 import com.google.common.util.concurrent.ListeningExecutorService;
11 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
12 import org.opendaylight.controller.sal.binding.impl.NotificationBrokerImpl;
13
14 /**
15 *
16 */
17 public final class NotificationBrokerImplModule extends
18         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractNotificationBrokerImplModule {
19
20     public NotificationBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
21             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
22         super(identifier, dependencyResolver);
23     }
24
25     public NotificationBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
26             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
27             NotificationBrokerImplModule oldModule, java.lang.AutoCloseable oldInstance) {
28         super(identifier, dependencyResolver, oldModule, oldInstance);
29     }
30
31     @Override
32     public void validate() {
33         super.validate();
34         // Add custom validation for module attributes here.
35     }
36
37     @Override
38     public java.lang.AutoCloseable createInstance() {
39
40         /*
41          *  FIXME: Switch to new broker (which has different threading model)
42          *  once this change is communicated with downstream users or
43          *  we will have adapter implementation which will honor Helium
44          *  threading model for notifications.
45          */
46         ListeningExecutorService listeningExecutor = SingletonHolder.getDefaultNotificationExecutor();
47         NotificationBrokerImpl broker = new NotificationBrokerImpl(listeningExecutor);
48         return broker;
49     }
50 }