Integration of MDSAL into distribution 07/1007/1
authorTony Tkacik <ttkacik@cisco.com>
Mon, 26 Aug 2013 17:27:57 +0000 (12:27 -0500)
committerTony Tkacik <ttkacik@cisco.com>
Mon, 26 Aug 2013 18:26:24 +0000 (11:26 -0700)
- Fixed Class Loader bug in runtime code generator

Change-Id: I8282b16247a9d80d74f8646d2ef56f364c2d349f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/utils/GeneratorUtils.xtend

index ff6b5a1cefe9cb5aafd082e51ee4531b7339ff49..7edee854597328aa46bf263c7a36862bc93ada67 100644 (file)
     <geminiweb.version>2.2.0.RELEASE</geminiweb.version>
     <checkstyle.version>2.10</checkstyle.version>
     <testvm.argLine>-Xmx1024m -XX:MaxPermSize=256m</testvm.argLine>
+    <yang.version>0.5.7-SNAPSHOT</yang.version>
+    <guava.version>14.0.1</guava.version>
+    <ietf-inet-types.version>2010.09.24-SNAPSHOT</ietf-inet-types.version>
+    <ietf-yang-types.version>2010.09.24-SNAPSHOT</ietf-yang-types.version>
+    <yang-ext.version>2013.09.07-SNAPSHOT</yang-ext.version>
+    <javassist.version>3.17.1-GA</javassist.version>
+    <sample-toaster.version>1.0-SNAPSHOT</sample-toaster.version>
   </properties>
 
   <pluginRepositories>
       <artifactId>jersey-json</artifactId>
       <version>${jersey.version}</version>
     </dependency>
+
+    <!-- yangtools -->
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-binding</artifactId>
+      <version>${yang.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-common</artifactId>
+      <version>${yang.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-data-api</artifactId>
+      <version>${yang.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-model-api</artifactId>
+      <version>${yang.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-data-util</artifactId>
+      <version>${yang.version}</version>
+    </dependency>
+
+    <!-- Models -->
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-inet-types</artifactId>
+      <version>${ietf-inet-types.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-yang-types</artifactId>
+      <version>${ietf-yang-types.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-ext</artifactId>
+      <version>${yang-ext.version}</version>
+    </dependency>
+
+    <!-- Other MDSAL dependencies -->
+
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
+      <groupId>org.javassist</groupId>
+      <artifactId>javassist</artifactId>
+      <version>${javassist.version}</version>
+    </dependency>
   </dependencies>
 </project>
index 1833b4ae592fa5867ccb58730dd8a7bb4feccf21..abf508efc2bb308f2727f69d9e4d8cc9b80da35e 100644 (file)
@@ -5,10 +5,10 @@
   <prerequisites>
     <maven>3.0</maven>
   </prerequisites>
-
   <scm>
-    <connection>scm:git:https://git.opendaylight.org/gerrit/p/controller.git</connection>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
   </scm>
   <parent>
     <groupId>org.opendaylight.controller</groupId>
@@ -67,6 +67,7 @@
     <module>../../../third-party/openflowj</module>
     <module>../../../third-party/net.sf.jung2</module>
     <module>../../../third-party/jersey-servlet</module>
+    <module>../../../third-party/commons/thirdparty</module>
 
     <!-- SAL bundles -->
     <module>../../sal/api</module>
@@ -78,6 +79,9 @@
     <module>../../sal/networkconfiguration/api</module>
     <module>../../sal/networkconfiguration/implementation</module>
 
+    <!-- MD-SAL bundles -->
+    <module>../../sal/yang-prototype</module>
+
     <!--  Web bundles -->
     <module>../../web/root</module>
     <module>../../web/flows</module>
     <module>../../samples/simpleforwarding</module>
     <module>../../samples/loadbalancer</module>
     <module>../../samples/northbound/loadbalancer</module>
+
+    <!-- Parents -->
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
     <module>../../commons/checkstyle</module>
     <module>../../commons/opendaylight</module>
+    <module>../../commons/parent</module>
   </modules>
 
   <build>
index e94c3759a9127fdb70a04954d7657a5bbfeb653e..c888121eb96ff995835297511122a076db8b95a3 100644 (file)
@@ -8,6 +8,8 @@
 package org.opendaylight.controller.sal.binding.impl.utils
 
 import javassist.ClassPool
+import javassist.NotFoundException
+import javassist.LoaderClassPath
 
 class GeneratorUtils {
 
@@ -16,8 +18,13 @@ class GeneratorUtils {
     public static def generatedName(Class<?> cls, String suffix) {
         '''«PREFIX»«cls.package.name».«cls.simpleName»$«suffix»'''.toString()
     }
-    
-    public static def get(ClassPool pool,Class<?> cls) {
-        pool.get(cls.name);
+
+    public static def get(ClassPool pool, Class<?> cls) {
+        try {
+            return pool.get(cls.name)
+        } catch (NotFoundException e) {
+            pool.appendClassPath(new LoaderClassPath(cls.classLoader));
+            return pool.get(cls.name)
+        }
     }
 }