diff --git a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala index 32aeb69303..14ab2301df 100644 --- a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala +++ b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala @@ -1,11 +1,12 @@ /** * Copyright (C) 2009-2010 Scalable Solutions AB */ - + package se.scalablesolutions.akka.actor import java.io.File -import java.net.URLClassLoader +import java.net.{URL, URLClassLoader} +import java.util.jar.JarFile import se.scalablesolutions.akka.util.{Bootable, Logging} import se.scalablesolutions.akka.config.Config._ @@ -17,7 +18,7 @@ trait BootableActorLoaderService extends Bootable with Logging { val BOOT_CLASSES = config.getList("akka.boot") lazy val applicationLoader: Option[ClassLoader] = createApplicationClassLoader - + protected def createApplicationClassLoader : Option[ClassLoader] = { Some( if (HOME.isDefined) { @@ -28,9 +29,21 @@ trait BootableActorLoaderService extends Bootable with Logging { log.error("Could not find a deploy directory at [%s]", DEPLOY) System.exit(-1) } - val toDeploy = for (f <- DEPLOY_DIR.listFiles().toArray.toList.asInstanceOf[List[File]]) yield f.toURI.toURL - log.info("Deploying applications from [%s]: [%s]", DEPLOY, toDeploy.toArray.toList) - new URLClassLoader(toDeploy.toArray, getClass.getClassLoader) + val filesToDeploy = DEPLOY_DIR.listFiles.toArray.toList.asInstanceOf[List[File]].filter(_.getName.endsWith(".jar")) + var dependencyJars: List[URL] = Nil + filesToDeploy.map { file => + val jarFile = new JarFile(file) + val en = jarFile.entries + while (en.hasMoreElements) { + val name = en.nextElement.getName + if (name.endsWith(".jar")) dependencyJars ::= new File(String.format("jar:file:%s!/%s", jarFile.getName, name)).toURI.toURL + } + } + val toDeploy = filesToDeploy.map(_.toURI.toURL) + log.info("Deploying applications from [%s]: [%s]", DEPLOY, toDeploy) + log.debug("Loading dependencies [%s]", dependencyJars) + val allJars = toDeploy ::: dependencyJars + new URLClassLoader(allJars.toArray.asInstanceOf[Array[URL]] , getClass.getClassLoader) } else getClass.getClassLoader) } @@ -41,6 +54,6 @@ trait BootableActorLoaderService extends Bootable with Logging { } super.onLoad } - + abstract override def onUnload = ActorRegistry.shutdownAll } diff --git a/akka-core/src/test/scala/StmSpec.scala b/akka-core/src/test/scala/StmSpec.scala index 121407426a..1b6732b295 100644 --- a/akka-core/src/test/scala/StmSpec.scala +++ b/akka-core/src/test/scala/StmSpec.scala @@ -1,6 +1,5 @@ package se.scalablesolutions.akka.actor -import se.scalablesolutions.akka.stm.Transaction.Local._ import se.scalablesolutions.akka.stm._ import org.scalatest.Spec @@ -11,13 +10,14 @@ import org.scalatest.junit.JUnitRunner import org.junit.runner.RunWith @RunWith(classOf[JUnitRunner]) -class StmSpec extends - Spec with - ShouldMatchers with +class StmSpec extends + Spec with + ShouldMatchers with BeforeAndAfterAll { - - describe("STM outside actors") { + + describe("Transaction.Local") { it("should be able to do multiple consecutive atomic {..} statements") { + import Transaction.Local._ lazy val ref = TransactionalState.newRef[Int] @@ -36,6 +36,7 @@ class StmSpec extends } it("should be able to do nested atomic {..} statements") { + import Transaction.Local._ lazy val ref = TransactionalState.newRef[Int] @@ -45,10 +46,10 @@ class StmSpec extends def total: Int = atomic { ref.get.getOrElse(0) } - + atomic { increment - increment + increment } atomic { increment @@ -57,6 +58,7 @@ class StmSpec extends } it("should roll back failing nested atomic {..} statements") { + import Transaction.Local._ lazy val ref = TransactionalState.newRef[Int] @@ -71,7 +73,7 @@ class StmSpec extends increment increment throw new Exception - } + } } catch { case e => {} } diff --git a/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom new file mode 100755 index 0000000000..898a59f413 --- /dev/null +++ b/embedded-repo/com/redis/redisclient/2.8.0.Beta1-1.3-SNAPSHOT/redisclient-2.8.0.Beta1-1.3-SNAPSHOT.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + com.redis + redisclient + 2.8.0.Beta1-1.3-SNAPSHOT + jar +