diff --git a/akka-core/src/main/scala/actor/ActorRegistry.scala b/akka-core/src/main/scala/actor/ActorRegistry.scala
index 88113a30a0..57b27f08b0 100644
--- a/akka-core/src/main/scala/actor/ActorRegistry.scala
+++ b/akka-core/src/main/scala/actor/ActorRegistry.scala
@@ -159,7 +159,7 @@ object ActorRegistry extends ListenerManagement {
/**
* Shuts down and unregisters all actors in the system.
*/
- def shutdownAll = {
+ def shutdownAll() {
log.info("Shutting down all actors in the system...")
foreach(_.stop)
actorsByUUID.clear
diff --git a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
index 33b1c04a73..eef60784a0 100644
--- a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
+++ b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
@@ -72,7 +72,7 @@ private [akka] object RedisStorageBackend extends
// need an explicit definition in akka-conf
val nodes = config.getList("akka.storage.redis.cluster")
- val db =
+ def connect() =
nodes match {
case Seq() =>
// no cluster defined
@@ -89,6 +89,8 @@ private [akka] object RedisStorageBackend extends
}
}
+ var db = connect()
+
/**
* Map storage in Redis.
*
@@ -411,6 +413,10 @@ private [akka] object RedisStorageBackend extends
try {
body
} catch {
+ case e: RedisConnectionException => {
+ db = connect()
+ body
+ }
case e: java.lang.NullPointerException =>
throw new StorageException("Could not connect to Redis server")
case e =>
diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala b/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
deleted file mode 100644
index 04c7f165b9..0000000000
--- a/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (C) 2009-2010 Scalable Solutions AB
- */
-
-package sample.osgi
-
-import org.osgi.framework.{BundleActivator, BundleContext}
-
-
-class Activator extends BundleActivator {
-
- def start(context: BundleContext) {
- println("Start")
- val osgiActor = new OSGiActor
- //osgiActor ! "Hello"
- Unit
- }
-
- def stop(context: BundleContext) {
- println("stop")
- }
-
-}
-
diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala b/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
deleted file mode 100644
index 90bd521d7b..0000000000
--- a/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-package sample.osgi
-
-import se.scalablesolutions.akka.actor.Actor
-
-
-class OSGiActor extends Actor {
- def receive = {
- case msg: String =>
- println("Got message: " + msg)
- }
-}
-
diff --git a/akka-samples/akka-sample-osgi/src/main/scala/osgiExample.scala b/akka-samples/akka-sample-osgi/src/main/scala/osgiExample.scala
new file mode 100644
index 0000000000..0cef797c47
--- /dev/null
+++ b/akka-samples/akka-sample-osgi/src/main/scala/osgiExample.scala
@@ -0,0 +1,33 @@
+/**
+ * Copyright (C) 2009-2010 Scalable Solutions AB
+ */
+
+package se.scalablesolutions.akka
+package sample.osgi
+
+import actor.{ Actor, ActorRegistry }
+import actor.Actor._
+
+import org.osgi.framework.{ BundleActivator, BundleContext }
+
+class Activator extends BundleActivator {
+
+ def start(context: BundleContext) {
+ println("Starting the OSGi example ...")
+ val echo = actorOf[EchoActor].start
+ val answer = (echo !! "OSGi example")
+ println(answer getOrElse "No answer!")
+ }
+
+ def stop(context: BundleContext) {
+ ActorRegistry.shutdownAll()
+ println("Stopped the OSGi example.")
+ }
+}
+
+class EchoActor extends Actor {
+
+ override def receive = {
+ case x => self reply x
+ }
+}
diff --git a/embedded-repo/com/redis/redisclient/2.8.0-1.4/redisclient-2.8.0-1.4.jar b/embedded-repo/com/redis/redisclient/2.8.0-1.4/redisclient-2.8.0-1.4.jar
index a5c824b19e..b811e6ab92 100644
Binary files a/embedded-repo/com/redis/redisclient/2.8.0-1.4/redisclient-2.8.0-1.4.jar and b/embedded-repo/com/redis/redisclient/2.8.0-1.4/redisclient-2.8.0-1.4.jar differ
diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala
index b24f477d75..6c770d4e54 100644
--- a/project/build/AkkaProject.scala
+++ b/project/build/AkkaProject.scala
@@ -170,6 +170,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "2.3.0" % "compile"
+ lazy val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
+
lazy val rabbit = "com.rabbitmq" % "amqp-client" % "1.8.1" % "compile"
lazy val redis = "com.redis" % "redisclient" % "2.8.0-1.4" % "compile"
@@ -646,13 +648,9 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
}
class AkkaSampleOSGiProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
- override def bndClasspath = compileClasspath
-
- val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
-
- override def bndBundleActivator = Some("sample.osgi.Activator")
- override def bndPrivatePackage = Nil
- override def bndExportPackage = Seq("sample.osgi.*;version=0.9")
+ val osgi_core = Dependencies.osgi_core
+ override lazy val bndBundleActivator = Some("se.scalablesolutions.akka.sample.osgi.Activator")
+ override lazy val bndExportPackage = Nil // Necessary because of mixing-in AkkaDefaultProject which exports all ...akka.* packages!
}
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {