From 44c317832a5dabafdeb0e55c45a3cdbce1daaa0e Mon Sep 17 00:00:00 2001 From: Michael Pilquist Date: Fri, 16 Nov 2012 12:55:27 -0500 Subject: [PATCH] Allow fallback classloader to be explicitly specified (cherry picked from commit f51a2894150e0f5cc6923b8e3aa42d7ebdd6663d) --- .../src/main/scala/akka/osgi/OsgiActorSystemFactory.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/akka-osgi/src/main/scala/akka/osgi/OsgiActorSystemFactory.scala b/akka-osgi/src/main/scala/akka/osgi/OsgiActorSystemFactory.scala index 859d671ed3..3f02936bfd 100644 --- a/akka-osgi/src/main/scala/akka/osgi/OsgiActorSystemFactory.scala +++ b/akka-osgi/src/main/scala/akka/osgi/OsgiActorSystemFactory.scala @@ -12,12 +12,12 @@ import org.osgi.framework.BundleContext * Factory class to create ActorSystem implementations in an OSGi environment. This mainly involves dealing with * bundle classloaders appropriately to ensure that configuration files and classes get loaded properly */ -class OsgiActorSystemFactory(val context: BundleContext) { +class OsgiActorSystemFactory(val context: BundleContext, val fallbackClassLoader: Option[ClassLoader]) { /* * Classloader that delegates to the bundle for which the factory is creating an ActorSystem */ - private val classloader = new BundleDelegatingClassLoader(context.getBundle, Some(classOf[ActorSystem].getClassLoader)) + private val classloader = new BundleDelegatingClassLoader(context.getBundle, fallbackClassLoader) /** * Creates the [[akka.actor.ActorSystem]], using the name specified @@ -52,5 +52,5 @@ object OsgiActorSystemFactory { /* * Create an [[OsgiActorSystemFactory]] instance to set up Akka in an OSGi environment */ - def apply(context: BundleContext): OsgiActorSystemFactory = new OsgiActorSystemFactory(context) + def apply(context: BundleContext): OsgiActorSystemFactory = new OsgiActorSystemFactory(context, Some(classOf[ActorSystem].getClassLoader)) }