Base integration of Binding Aware Broker with Config Subsystem
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / BindingBrokerImplSingletonModule.java
1 /*
2  * Copyright (c) 2013 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 org.opendaylight.controller.sal.binding.impl.BindingAwareBrokerImpl;
11 import org.osgi.framework.BundleContext;
12
13 import com.google.common.base.Preconditions;
14
15 /**
16 *
17 */
18 public final class BindingBrokerImplSingletonModule extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplSingletonModule
19 {
20
21     private BundleContext bundleContext;
22
23     public BindingBrokerImplSingletonModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
24         super(identifier, dependencyResolver);
25     }
26
27     public BindingBrokerImplSingletonModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, BindingBrokerImplSingletonModule oldModule, java.lang.AutoCloseable oldInstance) {
28         super(identifier, dependencyResolver, oldModule, oldInstance);
29     }
30
31     @Override
32     public void validate() {
33         super.validate();
34         Preconditions.checkNotNull(getBundleContext());
35     }
36
37     
38     
39     
40     
41     public java.lang.AutoCloseable createInstance() {
42         BindingAwareBrokerImpl broker = new BindingAwareBrokerImpl(getBundleContext());
43         broker.start();
44         return broker;
45     }
46
47     public BundleContext getBundleContext() {
48         return bundleContext;
49     }
50
51     public void setBundleContext(BundleContext bundleContext) {
52         this.bundleContext = bundleContext;
53     }
54 }