From 44638c17493281db45754881afb491a620481fe3 Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Mon, 26 Aug 2013 12:27:57 -0500 Subject: [PATCH] Integration of MDSAL into distribution - Fixed Class Loader bug in runtime code generator Change-Id: I8282b16247a9d80d74f8646d2ef56f364c2d349f Signed-off-by: Tony Tkacik --- opendaylight/commons/opendaylight/pom.xml | 67 +++++++++++++++++++ .../distribution/opendaylight/pom.xml | 11 ++- .../binding/impl/utils/GeneratorUtils.xtend | 13 +++- 3 files changed, 86 insertions(+), 5 deletions(-) diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index ff6b5a1cef..7edee85459 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -41,6 +41,13 @@ 2.2.0.RELEASE 2.10 -Xmx1024m -XX:MaxPermSize=256m + 0.5.7-SNAPSHOT + 14.0.1 + 2010.09.24-SNAPSHOT + 2010.09.24-SNAPSHOT + 2013.09.07-SNAPSHOT + 3.17.1-GA + 1.0-SNAPSHOT @@ -909,5 +916,65 @@ jersey-json ${jersey.version} + + + + + org.opendaylight.yangtools + yang-binding + ${yang.version} + + + org.opendaylight.yangtools + yang-common + ${yang.version} + + + org.opendaylight.yangtools + yang-data-api + ${yang.version} + + + org.opendaylight.yangtools + yang-model-api + ${yang.version} + + + org.opendaylight.yangtools + yang-data-util + ${yang.version} + + + + + + org.opendaylight.yangtools.model + ietf-inet-types + ${ietf-inet-types.version} + + + org.opendaylight.yangtools.model + ietf-yang-types + ${ietf-yang-types.version} + + + org.opendaylight.yangtools + yang-ext + ${yang-ext.version} + + + + + + com.google.guava + guava + ${guava.version} + jar + + + org.javassist + javassist + ${javassist.version} + diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml index 1833b4ae59..abf508efc2 100644 --- a/opendaylight/distribution/opendaylight/pom.xml +++ b/opendaylight/distribution/opendaylight/pom.xml @@ -5,10 +5,10 @@ 3.0 - - scm:git:https://git.opendaylight.org/gerrit/p/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main org.opendaylight.controller @@ -67,6 +67,7 @@ ../../../third-party/openflowj ../../../third-party/net.sf.jung2 ../../../third-party/jersey-servlet + ../../../third-party/commons/thirdparty ../../sal/api @@ -78,6 +79,9 @@ ../../sal/networkconfiguration/api ../../sal/networkconfiguration/implementation + + ../../sal/yang-prototype + ../../web/root ../../web/flows @@ -109,10 +113,13 @@ ../../samples/simpleforwarding ../../samples/loadbalancer ../../samples/northbound/loadbalancer + + ../../commons/concepts ../../commons/integrationtest ../../commons/checkstyle ../../commons/opendaylight + ../../commons/parent diff --git a/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/utils/GeneratorUtils.xtend b/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/utils/GeneratorUtils.xtend index e94c3759a9..c888121eb9 100644 --- a/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/utils/GeneratorUtils.xtend +++ b/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/utils/GeneratorUtils.xtend @@ -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) + } } } -- 2.36.6