File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
mleap-core/src/main/scala/ml/combust/mleap/core/reflection Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,17 @@ trait MleapReflection {
152
152
153
153
object MleapReflection extends MleapReflection {
154
154
override val universe : scala.reflect.runtime.universe.type = scala.reflect.runtime.universe
155
+ private var classLoader : Option [ClassLoader ] = None
156
+
157
+ def setClassLoader (cl : ClassLoader ) = MleapReflectionLock .synchronized {
158
+ classLoader = Some (cl)
159
+ }
160
+
161
+ def getClassLoader (): ClassLoader = MleapReflectionLock .synchronized {
162
+ classLoader.getOrElse(Thread .currentThread().getContextClassLoader)
163
+ }
164
+
155
165
override def mirror : universe.Mirror = MleapReflectionLock .synchronized {
156
- universe.runtimeMirror(Thread .currentThread().getContextClassLoader )
166
+ universe.runtimeMirror(getClassLoader() )
157
167
}
158
168
}
You can’t perform that action at this time.
0 commit comments