rework use of ClassLoaders, see #1736

This commit is contained in:
Roland 2012-01-27 13:30:43 +01:00
parent c5fc153a10
commit ac1ee9ae91
13 changed files with 54 additions and 67 deletions

View file

@ -321,8 +321,9 @@ abstract class MessageDispatcherConfigurator(val config: Config, val prerequisit
BoundedMailbox(capacity, duration)
}
case fqcn
val constructorSignature = Array[Class[_]](classOf[Config])
ReflectiveAccess.createInstance[MailboxType](fqcn, constructorSignature, Array[AnyRef](config)) match {
val args = Seq(classOf[Config] -> config)
val loader = Option(Thread.currentThread.getContextClassLoader) getOrElse getClass.getClassLoader
ReflectiveAccess.createInstance[MailboxType](fqcn, args, loader) match {
case Right(instance) instance
case Left(exception)
throw new IllegalArgumentException(