Merge "Add missing copyright text"
[controller.git] / opendaylight / md-sal / sal-dom-xsql / src / main / java / org / opendaylight / yang / gen / v1 / http / netconfcentral / org / ns / xsql / rev140626 / XSQLModule.java
1 /*
2  * Copyright (c) 2015 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.yang.gen.v1.http.netconfcentral.org.ns.xsql.rev140626;
9
10 import org.opendaylight.controller.md.sal.dom.xsql.XSQLAdapter;
11 import org.opendaylight.xsql.XSQLProvider;
12 /**
13  * @author Sharon Aicler(saichler@gmail.com)
14  **/
15 public class XSQLModule extends org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.xsql.rev140626.AbstractXSQLModule {
16     private static final long SLEEP_TIME_BEFORE_CREATING_TRANSACTION = 10000;
17     public XSQLModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
18         super(identifier, dependencyResolver);
19     }
20
21     public XSQLModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.xsql.rev140626.XSQLModule oldModule, java.lang.AutoCloseable oldInstance) {
22         super(identifier, dependencyResolver, oldModule, oldInstance);
23     }
24
25     @Override
26     public void customValidation() {
27         // add custom validation form module attributes here.
28     }
29
30     @Override
31     public java.lang.AutoCloseable createInstance() {
32         XSQLAdapter xsqlAdapter = XSQLAdapter.getInstance();
33         getSchemaServiceDependency().registerSchemaContextListener(xsqlAdapter);
34         xsqlAdapter.setDataBroker(getAsyncDataBrokerDependency());
35         final XSQLProvider p = new XSQLProvider();
36         Runnable runthis = new Runnable() {
37             @Override
38             public void run() {
39                 try{Thread.sleep(SLEEP_TIME_BEFORE_CREATING_TRANSACTION);}catch(Exception err){}
40                 p.buildXSQL(getDataBrokerDependency());
41             }
42         };
43         return p;
44     }
45 }