8fc9039940469f5b56ce7cfa1d4e8357ac6f0e31
[ovsdb.git] / library / impl / src / main / java / org / opendaylight / yang / gen / v1 / urn / opendaylight / params / xml / ns / yang / library / impl / rev141210 / LibraryModule.java
1 /*
2  * Copyright © 2015 Red Hat, 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.library.impl.rev141210;
9
10 import org.opendaylight.controller.config.api.DependencyResolver;
11 import org.opendaylight.controller.config.api.ModuleIdentifier;
12 import org.opendaylight.ovsdb.lib.impl.LibraryProvider;
13 import org.osgi.framework.BundleContext;
14
15 import com.google.common.base.Preconditions;
16
17 public class LibraryModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.library.impl.rev141210.AbstractLibraryModule {
18     private BundleContext bundleContext;
19
20     public LibraryModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
21         super(identifier, dependencyResolver);
22     }
23
24     public LibraryModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, LibraryModule oldModule, AutoCloseable oldInstance) {
25         super(identifier, dependencyResolver, oldModule, oldInstance);
26     }
27
28     @Override
29     public void customValidation() {
30         // add custom validation form module attributes here.
31         Preconditions.checkNotNull(bundleContext);
32     }
33
34     @Override
35     public java.lang.AutoCloseable createInstance() {
36         LibraryProvider provider = new LibraryProvider(bundleContext);
37         getBrokerDependency().registerProvider(provider);
38         return provider;
39     }
40
41     public void setBundleContext(BundleContext bundleContext) {
42         this.bundleContext = bundleContext;
43     }
44 }