DualLoader
class DualLoader(parentA: ClassLoader, aOnlyClasses: String => Boolean, aOnlyResources: String => Boolean, parentB: ClassLoader, bOnlyClasses: String => Boolean, bOnlyResources: String => Boolean) extends ClassLoader
A ClassLoader with two parents parentA
and parentB
. The predicates direct lookups towards one parent or the other.
If aOnlyClasses
returns true
for a class name, class lookup delegates to parentA
only.
Otherwise, if bOnlyClasses
returns true
for a class name, class lookup delegates to parentB
only.
If both aOnlyClasses
and bOnlyClasses
are false
for a given class name, both class loaders must load the same Class or
a DifferentLoaders exception is thrown.
If aOnlyResources
is true
for a resource path, lookup delegates to parentA
only.
Otherwise, if bOnlyResources
is true
for a resource path, lookup delegates to parentB
only.
If neither are true
for a resource path and either parentA
or parentB
return a valid URL, that valid URL is returned.
class ClassLoader
class Object
trait Matchable
class Any
Value members
Constructors
def this(parentA: ClassLoader, aOnly: String => Boolean, parentB: ClassLoader, bOnly: String => Boolean)