Fix build breakage in akka-osgi-aries due to last commit

(cherry picked from commit 68b60745f2d7b30d9ccd57536cd9427b04303b84)
This commit is contained in:
Michael Pilquist 2012-11-16 13:41:36 -05:00 committed by Patrik Nordwall
parent 44c317832a
commit 608d04c050
2 changed files with 10 additions and 3 deletions

View file

@ -15,7 +15,9 @@ import com.typesafe.config.{ Config, ConfigFactory }
* If you're looking for a way to set up Akka using Blueprint without the namespace handler, you should use
* [[akka.osgi.OsgiActorSystemFactory]] instead.
*/
class BlueprintActorSystemFactory(context: BundleContext, name: String) extends OsgiActorSystemFactory(context) {
class BlueprintActorSystemFactory(context: BundleContext, name: String, fallbackClassLoader: Option[ClassLoader]) extends OsgiActorSystemFactory(context, fallbackClassLoader) {
def this(context: BundleContext, name: String) = this(context, name, Some(OsgiActorSystemFactory.akkaActorClassLoader))
var config: Option[String] = None

View file

@ -37,7 +37,7 @@ class OsgiActorSystemFactory(val context: BundleContext, val fallbackClassLoader
* loaded from the akka-actor bundle.
*/
def actorSystemConfig(context: BundleContext): Config =
ConfigFactory.load(classloader).withFallback(ConfigFactory.defaultReference(classOf[ActorSystem].getClassLoader))
ConfigFactory.load(classloader).withFallback(ConfigFactory.defaultReference(OsgiActorSystemFactory.akkaActorClassLoader))
/**
* Determine the name for the [[akka.actor.ActorSystem]]
@ -49,8 +49,13 @@ class OsgiActorSystemFactory(val context: BundleContext, val fallbackClassLoader
}
object OsgiActorSystemFactory {
/**
* Class loader of akka-actor bundle.
*/
def akkaActorClassLoader = classOf[ActorSystem].getClassLoader
/*
* Create an [[OsgiActorSystemFactory]] instance to set up Akka in an OSGi environment
*/
def apply(context: BundleContext): OsgiActorSystemFactory = new OsgiActorSystemFactory(context, Some(classOf[ActorSystem].getClassLoader))
def apply(context: BundleContext): OsgiActorSystemFactory = new OsgiActorSystemFactory(context, Some(akkaActorClassLoader))
}