From 81f5f8f07ebbbf661f313c8bb7e0edb1536d0dec Mon Sep 17 00:00:00 2001 From: peter hausel Date: Mon, 1 Mar 2010 01:38:23 -0500 Subject: [PATCH 01/21] initial sbt support --- .gitignore | 3 ++ akka-core/project/build.properties | 7 +++++ akka-core/project/build/AkkaCore.scala | 29 +++++++++++++++++++ akka-util-java/project/build.properties | 7 +++++ .../project/build/AkkaJavaUtilProject.scala | 18 ++++++++++++ akka-util/project/build.properties | 7 +++++ akka-util/project/build/AkkaUtilProject.scala | 17 +++++++++++ project/build.properties | 7 +++++ project/build/AkkaParent.scala | 7 +++++ 9 files changed, 102 insertions(+) create mode 100644 akka-core/project/build.properties create mode 100644 akka-core/project/build/AkkaCore.scala create mode 100644 akka-util-java/project/build.properties create mode 100644 akka-util-java/project/build/AkkaJavaUtilProject.scala create mode 100644 akka-util/project/build.properties create mode 100644 akka-util/project/build/AkkaUtilProject.scala create mode 100644 project/build.properties create mode 100644 project/build/AkkaParent.scala diff --git a/.gitignore b/.gitignore index 22379bef4c..d716ab14ea 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *~ *# +project/build/target +project/boot +lib_managed etags TAGS reports diff --git a/akka-core/project/build.properties b/akka-core/project/build.properties new file mode 100644 index 0000000000..7338d79aa0 --- /dev/null +++ b/akka-core/project/build.properties @@ -0,0 +1,7 @@ +project.organization=se.scalablesolutions.akka +project.name=akka-core +project.version=0.7-SNAPSHOT +scala.version=2.7.7 +sbt.version=0.7.1 +def.scala.version=2.7.7 +build.scala.versions=2.7.7 diff --git a/akka-core/project/build/AkkaCore.scala b/akka-core/project/build/AkkaCore.scala new file mode 100644 index 0000000000..709ab6b2f6 --- /dev/null +++ b/akka-core/project/build/AkkaCore.scala @@ -0,0 +1,29 @@ +import sbt._ + +class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { + + val akkautil = "se.scalablesolutions.akka" % "akka-util" % "0.7-SNAPSHOT" % "compile" + val akkautiljava = "se.scalablesolutions.akka" % "akka-util-java" % "0.7-SNAPSHOT" % "compile" + + val akka_databinder = "DataBinder" at "http://databinder.net/repo" + val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" + + val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val commonsio = "commons-io" % "commons-io" % "1.4" % "compile" + val netdatabinder = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" + val netdatabinderhttp = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" + val sbinary = "sbinary" % "sbinary" % "0.3" % "compile" + val jack = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" + val jackcore = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" + val volde = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" + val scalajavautil = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" + val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" + + val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val junit = "junit" % "junit" % "4.5" % "test" + override def packageDocsJar = defaultJarPath("-javadoc.jar") + override def packageSrcJar= defaultJarPath("-sources.jar") + +} diff --git a/akka-util-java/project/build.properties b/akka-util-java/project/build.properties new file mode 100644 index 0000000000..f9ec63abf2 --- /dev/null +++ b/akka-util-java/project/build.properties @@ -0,0 +1,7 @@ +project.organization=se.scalablesolutions.akka +project.name=akka-util-java +project.version=0.7-SNAPSHOT +scala.version=2.7.7 +sbt.version=0.7.1 +def.scala.version=2.7.7 +build.scala.versions=2.7.7 diff --git a/akka-util-java/project/build/AkkaJavaUtilProject.scala b/akka-util-java/project/build/AkkaJavaUtilProject.scala new file mode 100644 index 0000000000..08308f5984 --- /dev/null +++ b/akka-util-java/project/build/AkkaJavaUtilProject.scala @@ -0,0 +1,18 @@ +import sbt._ + +class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { + + val akka_databinder = "DataBinder" at "http://databinder.net/repo" + val akka_configgy = "Configgy" at "http://www.lag.net/repo" + val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" + val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" + + val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" + val proto = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" + val multi = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" + + override def packageDocsJar = defaultJarPath("-javadoc.jar") + override def packageSrcJar= defaultJarPath("-sources.jar") + +} diff --git a/akka-util/project/build.properties b/akka-util/project/build.properties new file mode 100644 index 0000000000..a25350528e --- /dev/null +++ b/akka-util/project/build.properties @@ -0,0 +1,7 @@ +project.organization=se.scalablesolutions.akka +project.name=akka-util +project.version=0.7-SNAPSHOT +scala.version=2.7.7 +sbt.version=0.7.1 +def.scala.version=2.7.7 +build.scala.versions=2.7.7 diff --git a/akka-util/project/build/AkkaUtilProject.scala b/akka-util/project/build/AkkaUtilProject.scala new file mode 100644 index 0000000000..a7ca8a7c01 --- /dev/null +++ b/akka-util/project/build/AkkaUtilProject.scala @@ -0,0 +1,17 @@ +import sbt._ + +class AkkaUtilProject(info: ProjectInfo) extends DefaultProject(info) { + + val akka_databinder = "DataBinder" at "http://databinder.net/repo" + val akka_configgy = "Configgy" at "http://www.lag.net/repo" + val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" + + val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val configgy = "net.lag" % "configgy" % "1.4.7" % "compile" + + override def packageDocsJar = defaultJarPath("-javadoc.jar") + override def packageSrcJar= defaultJarPath("-sources.jar") + +} diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000000..9f7e717580 --- /dev/null +++ b/project/build.properties @@ -0,0 +1,7 @@ +project.organization=se.scalablesolutions.akka +project.name=akka +project.version=0.7-SNAPSHOT +scala.version=2.7.7 +sbt.version=0.7.1 +def.scala.version=2.7.7 +build.scala.versions=2.7.7 diff --git a/project/build/AkkaParent.scala b/project/build/AkkaParent.scala new file mode 100644 index 0000000000..db0f68f5c2 --- /dev/null +++ b/project/build/AkkaParent.scala @@ -0,0 +1,7 @@ +import sbt._ + +class AkkaParent(info: ProjectInfo) extends ParentProject(info) { + lazy val javautil = project("akka-util-java", "akka java util") + lazy val util = project("akka-util", "akka util") + lazy val core = project("akka-core", "akka core", util,javautil) +} From 927edd970ea1d3753bb8d532014a24efd3b8ace4 Mon Sep 17 00:00:00 2001 From: peter hausel Date: Tue, 2 Mar 2010 00:30:14 -0500 Subject: [PATCH 02/21] second phase --- .gitignore | 4 +- akka-core/project/build.properties | 7 --- akka-core/project/build/AkkaCore.scala | 29 ------------- akka-persistence/pom.xml | 43 ------------------- akka-util/project/build.properties | 7 --- akka-util/project/build/AkkaUtilProject.scala | 17 -------- project/build/AkkaParent.scala | 7 --- 7 files changed, 2 insertions(+), 112 deletions(-) delete mode 100644 akka-core/project/build.properties delete mode 100644 akka-core/project/build/AkkaCore.scala delete mode 100644 akka-persistence/pom.xml delete mode 100644 akka-util/project/build.properties delete mode 100644 akka-util/project/build/AkkaUtilProject.scala delete mode 100644 project/build/AkkaParent.scala diff --git a/.gitignore b/.gitignore index d716ab14ea..9ae8cf1ee8 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *~ *# -project/build/target -project/boot +*/project/build/target +*/project/boot lib_managed etags TAGS diff --git a/akka-core/project/build.properties b/akka-core/project/build.properties deleted file mode 100644 index 7338d79aa0..0000000000 --- a/akka-core/project/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -project.organization=se.scalablesolutions.akka -project.name=akka-core -project.version=0.7-SNAPSHOT -scala.version=2.7.7 -sbt.version=0.7.1 -def.scala.version=2.7.7 -build.scala.versions=2.7.7 diff --git a/akka-core/project/build/AkkaCore.scala b/akka-core/project/build/AkkaCore.scala deleted file mode 100644 index 709ab6b2f6..0000000000 --- a/akka-core/project/build/AkkaCore.scala +++ /dev/null @@ -1,29 +0,0 @@ -import sbt._ - -class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { - - val akkautil = "se.scalablesolutions.akka" % "akka-util" % "0.7-SNAPSHOT" % "compile" - val akkautiljava = "se.scalablesolutions.akka" % "akka-util-java" % "0.7-SNAPSHOT" % "compile" - - val akka_databinder = "DataBinder" at "http://databinder.net/repo" - val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" - val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" - - val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" - val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" - val commonsio = "commons-io" % "commons-io" % "1.4" % "compile" - val netdatabinder = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" - val netdatabinderhttp = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" - val sbinary = "sbinary" % "sbinary" % "0.3" % "compile" - val jack = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" - val jackcore = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" - val volde = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" - val scalajavautil = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" - val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" - - val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" - val junit = "junit" % "junit" % "4.5" % "test" - override def packageDocsJar = defaultJarPath("-javadoc.jar") - override def packageSrcJar= defaultJarPath("-sources.jar") - -} diff --git a/akka-persistence/pom.xml b/akka-persistence/pom.xml deleted file mode 100644 index cad4757353..0000000000 --- a/akka-persistence/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - - akka-persistence-parent - Akka Persistence Modules - - pom - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - akka-persistence-common - akka-persistence-redis - akka-persistence-mongo - akka-persistence-cassandra - - - - - akka-core - ${project.groupId} - ${project.version} - - - - org.scalatest - scalatest - 1.0 - test - - - junit - junit - 4.5 - test - - - diff --git a/akka-util/project/build.properties b/akka-util/project/build.properties deleted file mode 100644 index a25350528e..0000000000 --- a/akka-util/project/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -project.organization=se.scalablesolutions.akka -project.name=akka-util -project.version=0.7-SNAPSHOT -scala.version=2.7.7 -sbt.version=0.7.1 -def.scala.version=2.7.7 -build.scala.versions=2.7.7 diff --git a/akka-util/project/build/AkkaUtilProject.scala b/akka-util/project/build/AkkaUtilProject.scala deleted file mode 100644 index a7ca8a7c01..0000000000 --- a/akka-util/project/build/AkkaUtilProject.scala +++ /dev/null @@ -1,17 +0,0 @@ -import sbt._ - -class AkkaUtilProject(info: ProjectInfo) extends DefaultProject(info) { - - val akka_databinder = "DataBinder" at "http://databinder.net/repo" - val akka_configgy = "Configgy" at "http://www.lag.net/repo" - val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" - val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" - - val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" - val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" - val configgy = "net.lag" % "configgy" % "1.4.7" % "compile" - - override def packageDocsJar = defaultJarPath("-javadoc.jar") - override def packageSrcJar= defaultJarPath("-sources.jar") - -} diff --git a/project/build/AkkaParent.scala b/project/build/AkkaParent.scala deleted file mode 100644 index db0f68f5c2..0000000000 --- a/project/build/AkkaParent.scala +++ /dev/null @@ -1,7 +0,0 @@ -import sbt._ - -class AkkaParent(info: ProjectInfo) extends ParentProject(info) { - lazy val javautil = project("akka-util-java", "akka java util") - lazy val util = project("akka-util", "akka util") - lazy val core = project("akka-core", "akka core", util,javautil) -} From 71b82c54488d693769c816cfc11d517ec9ea102d Mon Sep 17 00:00:00 2001 From: peter hausel Date: Tue, 2 Mar 2010 00:34:14 -0500 Subject: [PATCH 03/21] new master parent --- project/build/AkkaProject.scala | 131 ++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 project/build/AkkaProject.scala diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala new file mode 100644 index 0000000000..4eaef68963 --- /dev/null +++ b/project/build/AkkaProject.scala @@ -0,0 +1,131 @@ +import sbt._ + +class AkkaParent(info: ProjectInfo) extends ParentProject(info) { + //repos + val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" + val databinder = "DataBinder" at "http://databinder.net/repo" + val configgy = "Configgy" at "http://www.lag.net/repo" + val multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val jboss = "jBoss" at "http://repository.jboss.org/maven2" + val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" + val embeddedrepo = "embedded repo" at "http://guice-maven.googlecode.com/svn/trunk" + val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" + val m2 = "m2" at "http://download.java.net/maven/2" + + //project versions + val JERSEYVERSION = "1.1.5" + val ATMOVERSION = "0.6-SNAPSHOT" + val CASSANDRAVERSION = "0.5.0" + + //project defintions + lazy val javautil = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) + lazy val util = project("akka-util", "akka-util",new AkkaUtilProject(_)) + lazy val core = project("akka-core", "akka-core", new AkkaCoreProject(_), util, javautil) + lazy val amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), core) + lazy val rest = project("akka-rest", "akka-rest", new AkkaRestProject(_), core) + lazy val comet = project("akka-comet", "akka-comet",new AkkaCometProject(_), rest) + lazy val patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), core) + lazy val security = project("akka-security", "akka-security", new AkkaSecurityProject(_), core) + lazy val persitence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) + + // subprojects + class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { + val sjson = "sjson.json" % "sjson" % "0.4" % "compile" + val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val commonsio = "commons-io" % "commons-io" % "1.4" % "compile" + val netdatabinder = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" + val netdatabinderhttp = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" + val sbinary = "sbinary" % "sbinary" % "0.3" % "compile" + val jack = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" + val jackcore = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" + val volde = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" + val scalajavautil = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" + val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" + //testing + val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val junit = "junit" % "junit" % "4.5" % "test" + } + + class AkkaUtilProject(info: ProjectInfo) extends DefaultProject(info) { + val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val configgy = "net.lag" % "configgy" % "1.4.7" % "compile" + } + + class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { + val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" + val proto = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" + val multi = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" + } + + class AkkaAMQPProject(info:ProjectInfo) extends DefaultProject(info) { + val rabbit = "com.rabbitmq" % "amqp-client" % "1.7.2" + } + + class AkkaRestProject(info:ProjectInfo) extends DefaultProject(info) { + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + val jersey = "com.sun.jersey" % "jersey-core" % JERSEYVERSION % "compile" + val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" + val jerseyjson = "com.sun.jersey" % "jersey-json" % JERSEYVERSION % "compile" + val jerseycontrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEYVERSION % "compile" + val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + } + + class AkkaCometProject(info:ProjectInfo) extends DefaultProject(info) { + val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMOVERSION % "compile" + val atmojersey = "org.atmosphere" % "atmosphere-jersey" % ATMOVERSION % "compile" + val atmoruntime = "org.atmosphere" % "atmosphere-runtime" % ATMOVERSION % "compile" + } + + class AkkaPatternsProject(info:ProjectInfo) extends DefaultProject(info) { + //testing + val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val junit = "junit" % "junit" % "4.5" % "test" + } + + class AkkaSecurityProject(info:ProjectInfo) extends DefaultProject(info) { + val annotation = "javax.annotation" % "jsr250-api" % "1.0" + val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" + val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val lift = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" + //testing + val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val junit = "junit" % "junit" % "4.5" % "test" + val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" + } + + + class AkkaPersistenceCommonProject(info:ProjectInfo) extends DefaultProject(info) { + val facebook = "com.facebook" % "thrift" % "1.0" % "compile" + val commonspool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" + } + class AkkaRedisProject(info:ProjectInfo) extends DefaultProject(info) { + val redis = "com.redis" % "redisclient" % "1.0.1" % "compile" + } + + class AkkaMongoProject(info:ProjectInfo) extends DefaultProject(info) { + val mongo = "org.mongodb" % "mongo-java-driver" % "1.1" % "compile" + } + + class AkkaCassandraProject(info:ProjectInfo) extends DefaultProject(info) { + val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRAVERSION % "compile" + val cassandralib = "org.apache.cassandra" % "high-scale-lib" % CASSANDRAVERSION % "test" + val cassandraclhm = "org.apache.cassandra" % "clhm-production" % CASSANDRAVERSION % "test" + val commonscoll = "commons-collections" % "commons-collections" % "3.2.1" % "test" + val googlecoll = "com.google.collections" % "google-collections" % "1.0" % "test" + val slf4j = "org.slf4j" % "slf4j-api" % "1.5.8" % "test" + val slf4jlog4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" + val log4j = "log4j" % "log4j" % "1.2.15" % "test" + } + + class AkkaPersistenceParentProject(info:ProjectInfo) extends ParentProject(info) { + lazy val akkapersistencecommon = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_)) + lazy val redis = project("akka-persistence-redis","akka-persistence-redis", new AkkaRedisProject(_),akkapersistencecommon) + lazy val mongo = project("akka-persistence-mongo","akka-persistence-mongo", new AkkaMongoProject(_),akkapersistencecommon) + lazy val cassandra = project("akka-persistence-cassandra","akka-persistence-cassandra", new AkkaCassandraProject(_),akkapersistencecommon) + + } +} From 399ee1da50bf77212afbfe9eb26e7c3b6299153a Mon Sep 17 00:00:00 2001 From: peter hausel Date: Tue, 2 Mar 2010 23:44:16 -0500 Subject: [PATCH 04/21] added remaining projects --- .gitignore | 1 + project/build/AkkaProject.scala | 79 +++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9ae8cf1ee8..69dd6d55c9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ *# +project/boot/* */project/build/target */project/boot lib_managed diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 4eaef68963..b865af998a 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -26,7 +26,13 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val comet = project("akka-comet", "akka-comet",new AkkaCometProject(_), rest) lazy val patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), core) lazy val security = project("akka-security", "akka-security", new AkkaSecurityProject(_), core) - lazy val persitence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) + lazy val persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) + lazy val cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) + lazy val kernel = project("akka-kernel","akka-kernel", new AkkaKernelProject(_),core,rest,persistence,cluster,amqp,security,comet) + //examples + lazy val funtest = project("akka-fun-test-java","akka-fun-test-java", new AkkaFunTestProject(_),kernel) + lazy val samples = project("akka-samples","akka-samples", new AkkaSamplesParentProject(_)) + // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { @@ -90,7 +96,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val annotation = "javax.annotation" % "jsr250-api" % "1.0" val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" - val lift = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" + val liftutil = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" //testing val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" @@ -103,7 +109,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val commonspool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" } class AkkaRedisProject(info:ProjectInfo) extends DefaultProject(info) { - val redis = "com.redis" % "redisclient" % "1.0.1" % "compile" + val redis = "com.redis" % "redisclient" % "1.1" % "compile" } class AkkaMongoProject(info:ProjectInfo) extends DefaultProject(info) { @@ -118,14 +124,79 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val googlecoll = "com.google.collections" % "google-collections" % "1.0" % "test" val slf4j = "org.slf4j" % "slf4j-api" % "1.5.8" % "test" val slf4jlog4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" + val log4j = "log4j" % "log4j" % "1.2.15" % "test" } class AkkaPersistenceParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val akkapersistencecommon = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_)) + lazy val akkapersistencecommon = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_),core) lazy val redis = project("akka-persistence-redis","akka-persistence-redis", new AkkaRedisProject(_),akkapersistencecommon) lazy val mongo = project("akka-persistence-mongo","akka-persistence-mongo", new AkkaMongoProject(_),akkapersistencecommon) lazy val cassandra = project("akka-persistence-cassandra","akka-persistence-cassandra", new AkkaCassandraProject(_),akkapersistencecommon) } + + class AkkaJgroupsProject(info:ProjectInfo) extends DefaultProject(info) { + val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" + } + + class AkkaShoalProject(info:ProjectInfo) extends DefaultProject(info) { + val shoal = "shoal-jxta" % "shoal" % "1.1-20090818" % "compile" + val shoalextra = "shoal-jxta" % "jxta" % "1.1-20090818" % "compile" + } + + class AkkaClusterParentProject(info:ProjectInfo) extends ParentProject(info) { + lazy val jgroups = project("akka-cluster-jgroups","akka-cluster-jgroups", new AkkaJgroupsProject(_),core) + lazy val shoal = project("akka-cluster-shoal","akka-cluster-shoal", new AkkaShoalProject(_),core) + } + + class AkkaKernelProject(info:ProjectInfo) extends DefaultProject(info) { + val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" + val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMOVERSION % "compile" + val atmojersey = "org.atmosphere" % "atmosphere-jersey" % ATMOVERSION % "compile" + val atmoruntime = "org.atmosphere" % "atmosphere-runtime" % ATMOVERSION % "compile" + } + + //examples + class AkkaFunTestProject(info:ProjectInfo) extends DefaultProject(info) { + val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" + val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" + val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" + val jerseyjson = "com.sun.jersey" % "jersey-json" % JERSEYVERSION % "compile" + val jerseyatom = "com.sun.jersey" % "jersey-atom" % JERSEYVERSION % "compile" + //testing + val junit = "junit" % "junit" % "4.5" % "test" + val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" + } + + + class AkkaSampleChatProject(info:ProjectInfo) extends DefaultProject(info) + + class AkkaSampleLiftProject(info:ProjectInfo) extends DefaultProject(info) { + val liftutil = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" + val lift = "net.liftweb" % "lift-webkit" % "1.1-M6" % "compile" + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + //testing + val jetty = "org.mortbay.jetty" % "jetty" % "6.1.6" % "test" + val junit = "junit" % "junit" % "4.5" % "test" + } + + class AkkaSampleRestJavaProject(info:ProjectInfo) extends DefaultProject(info) + + class AkkaSampleRestScalaProject(info:ProjectInfo) extends DefaultProject(info) { + val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + } + + class AkkaSampleSecurityProject(info:ProjectInfo) extends DefaultProject(info) { + val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val annotation = "javax.annotation" % "jsr250-api" % "1.0" + } + + class AkkaSamplesParentProject(info:ProjectInfo) extends ParentProject(info) { + lazy val chat = project("akka-sample-chat","akka-sample-chat",new AkkaSampleChatProject(_),kernel) + lazy val lift = project("akka-sample-lift","akka-sample-lift",new AkkaSampleLiftProject(_),kernel) + lazy val restjava = project("akka-sample-rest-java","akka-sample-rest-java",new AkkaSampleRestJavaProject(_),kernel) + lazy val restscala = project("akka-sample-rest-scala","akka-sample-rest-scala",new AkkaSampleRestScalaProject(_),kernel) + lazy val security = project("akka-sample-security","akka-sample-security",new AkkaSampleSecurityProject(_),kernel) + } } From 53d9158825ae95221de4f8635ad80c22a0d3d671 Mon Sep 17 00:00:00 2001 From: peter hausel Date: Tue, 2 Mar 2010 23:45:26 -0500 Subject: [PATCH 05/21] remove pom files --- akka-amqp/pom.xml | 29 - akka-cluster/akka-cluster-jgroups/pom.xml | 24 - akka-cluster/akka-cluster-shoal/pom.xml | 34 -- akka-cluster/akka-cluster-tribes/pom.xml | 24 - akka-cluster/pom.xml | 42 -- akka-comet/pom.xml | 54 -- akka-core/pom.xml | 111 ---- akka-fun-test-java/pom.xml | 123 ---- akka-kernel/pom.xml | 136 ----- akka-patterns/pom.xml | 39 -- .../akka-persistence-cassandra/pom.xml | 86 --- .../akka-persistence-common/pom.xml | 29 - .../akka-persistence-mongo/pom.xml | 31 - .../akka-persistence-redis/pom.xml | 31 - akka-rest/pom.xml | 57 -- akka-samples/akka-sample-chat/pom.xml | 38 -- akka-samples/akka-sample-lift/pom.xml | 50 -- akka-samples/akka-sample-rest-java/pom.xml | 49 -- akka-samples/akka-sample-rest-scala/pom.xml | 46 -- akka-samples/akka-sample-security/pom.xml | 52 -- akka-samples/pom.xml | 56 -- akka-security/pom.xml | 63 -- akka-util-java/pom.xml | 74 --- akka-util/pom.xml | 39 -- pom.xml | 565 ------------------ 25 files changed, 1882 deletions(-) delete mode 100644 akka-amqp/pom.xml delete mode 100644 akka-cluster/akka-cluster-jgroups/pom.xml delete mode 100644 akka-cluster/akka-cluster-shoal/pom.xml delete mode 100644 akka-cluster/akka-cluster-tribes/pom.xml delete mode 100644 akka-cluster/pom.xml delete mode 100644 akka-comet/pom.xml delete mode 100644 akka-core/pom.xml delete mode 100644 akka-fun-test-java/pom.xml delete mode 100644 akka-kernel/pom.xml delete mode 100644 akka-patterns/pom.xml delete mode 100644 akka-persistence/akka-persistence-cassandra/pom.xml delete mode 100644 akka-persistence/akka-persistence-common/pom.xml delete mode 100644 akka-persistence/akka-persistence-mongo/pom.xml delete mode 100644 akka-persistence/akka-persistence-redis/pom.xml delete mode 100644 akka-rest/pom.xml delete mode 100644 akka-samples/akka-sample-chat/pom.xml delete mode 100644 akka-samples/akka-sample-lift/pom.xml delete mode 100644 akka-samples/akka-sample-rest-java/pom.xml delete mode 100644 akka-samples/akka-sample-rest-scala/pom.xml delete mode 100644 akka-samples/akka-sample-security/pom.xml delete mode 100644 akka-samples/pom.xml delete mode 100644 akka-security/pom.xml delete mode 100644 akka-util-java/pom.xml delete mode 100644 akka-util/pom.xml delete mode 100644 pom.xml diff --git a/akka-amqp/pom.xml b/akka-amqp/pom.xml deleted file mode 100644 index aa569958a6..0000000000 --- a/akka-amqp/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - 4.0.0 - - akka-amqp - Akka AMQP Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-core - ${project.groupId} - ${project.version} - - - com.rabbitmq - amqp-client - 1.7.0 - - - - diff --git a/akka-cluster/akka-cluster-jgroups/pom.xml b/akka-cluster/akka-cluster-jgroups/pom.xml deleted file mode 100644 index 85d25e2330..0000000000 --- a/akka-cluster/akka-cluster-jgroups/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - 4.0.0 - - akka-cluster-jgroups - Akka Cluster JGroups Module - - jar - - - akka-cluster-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - jgroups - jgroups - 2.8.0.CR7 - - - - diff --git a/akka-cluster/akka-cluster-shoal/pom.xml b/akka-cluster/akka-cluster-shoal/pom.xml deleted file mode 100644 index b58e77dcf5..0000000000 --- a/akka-cluster/akka-cluster-shoal/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - 4.0.0 - - akka-cluster-shoal - Akka Cluster Shoal Module - - jar - - - akka-cluster-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - shoal-jxta - shoal - 1.1-20090818 - - - shoal-jxta - jxta - 1.1-20090818 - - - - diff --git a/akka-cluster/akka-cluster-tribes/pom.xml b/akka-cluster/akka-cluster-tribes/pom.xml deleted file mode 100644 index efcea51aa8..0000000000 --- a/akka-cluster/akka-cluster-tribes/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - 4.0.0 - - akka-cluster-tribes - Akka Cluster Tribes Module - - jar - - - akka-cluster-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - org.apache.tomcat - tribes - 6.0.20 - - - - diff --git a/akka-cluster/pom.xml b/akka-cluster/pom.xml deleted file mode 100644 index 9d7bd42000..0000000000 --- a/akka-cluster/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - 4.0.0 - - akka-cluster-parent - Akka Cluster Modules - - pom - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - akka-cluster-jgroups - - akka-cluster-shoal - - - - - akka-core - ${project.groupId} - ${project.version} - - - - org.scalatest - scalatest - 1.0 - test - - - junit - junit - 4.5 - test - - - diff --git a/akka-comet/pom.xml b/akka-comet/pom.xml deleted file mode 100644 index 88cdc0cf57..0000000000 --- a/akka-comet/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - 4.0.0 - - akka-comet - Akka Comet Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - akka-rest - ${project.groupId} - ${project.version} - - - - - com.sun.grizzly - grizzly-comet-webserver - ${grizzly.version} - - - - - javax.servlet - servlet-api - 2.5 - - - org.atmosphere - atmosphere-annotations - ${atmosphere.version} - - - org.atmosphere - atmosphere-jersey - ${atmosphere.version} - - - org.atmosphere - atmosphere-runtime - ${atmosphere.version} - - - diff --git a/akka-core/pom.xml b/akka-core/pom.xml deleted file mode 100644 index d6ca57ebfe..0000000000 --- a/akka-core/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - 4.0.0 - - akka-core - Akka Core - Actors, Remote Actors, Transactors and STM Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - akka-util-java - ${project.groupId} - ${project.version} - - - akka-util - ${project.groupId} - ${project.version} - - - org.scala-lang - scala-library - ${scala.version} - - - org.codehaus.aspectwerkz - aspectwerkz-nodeps-jdk5 - 2.1 - - - org.codehaus.aspectwerkz - aspectwerkz-jdk5 - 2.1 - - - org.jboss.netty - netty - 3.2.0.ALPHA3 - - - org.scala-tools - javautils - 2.7.4-0.1 - - - - - voldemort.store.compress - h2-lzf - 1.0 - - - org.codehaus.jackson - jackson-core-asl - 1.2.1 - - - org.codehaus.jackson - jackson-mapper-asl - 1.2.1 - - - sbinary - sbinary - 0.3 - - - net.databinder - dispatch-json_2.7.7 - 0.6.4 - - - commons-io - commons-io - 1.4 - - - net.databinder - dispatch-http_2.7.7 - 0.6.4 - - - sjson.json - sjson - 0.4 - - - - - org.scalatest - scalatest - 1.0 - test - - - junit - junit - 4.5 - test - - - diff --git a/akka-fun-test-java/pom.xml b/akka-fun-test-java/pom.xml deleted file mode 100644 index beb19f25c5..0000000000 --- a/akka-fun-test-java/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - 4.0.0 - - Akka Functional Tests in Java - akka-fun-test-java - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-kernel - ${project.groupId} - ${project.version} - - - ${project.groupId} - akka-persistence-cassandra - ${project.version} - - - com.google.protobuf - protobuf-java - 2.2.0 - - - com.sun.grizzly - grizzly-servlet-webserver - ${grizzly.version} - test - - - com.sun.jersey - jersey-server - ${jersey.version} - test - - - com.sun.jersey - jersey-json - ${jersey.version} - test - - - com.sun.jersey - jersey-client - ${jersey.version} - test - - - com.sun.jersey - jersey-atom - ${jersey.version} - test - - - junit - junit - 4.5 - test - - - org.jmock - jmock - 2.4.0 - test - - - - - src/main/java - src/test/java - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - **/* - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/InMemNestedStateTest* - **/*Persistent* - - - - - - - false - src/test/resources - - - false - src/test/java - - ** - - - **/*.java - - - - - - - - diff --git a/akka-kernel/pom.xml b/akka-kernel/pom.xml deleted file mode 100644 index 4b1d114d45..0000000000 --- a/akka-kernel/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - 4.0.0 - - akka-kernel - Akka Kernel Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - akka-rest - ${project.groupId} - ${project.version} - - - akka-amqp - ${project.groupId} - ${project.version} - - - akka-security - ${project.groupId} - ${project.version} - - - akka-persistence-cassandra - ${project.groupId} - ${project.version} - - - akka-persistence-mongo - ${project.groupId} - ${project.version} - - - akka-persistence-redis - ${project.groupId} - ${project.version} - - - akka-comet - ${project.groupId} - ${project.version} - - - akka-cluster-jgroups - ${project.groupId} - ${project.version} - - - - - - com.sun.jersey - jersey-server - ${jersey.version} - - - org.atmosphere - atmosphere-annotations - ${atmosphere.version} - - - org.atmosphere - atmosphere-jersey - ${atmosphere.version} - - - org.atmosphere - atmosphere-runtime - ${atmosphere.version} - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 1.2.1 - - - install - - shade - - - - - junit:junit - - - - - - - se.scalablesolutions.akka.Main - - - - - - - - maven-antrun-plugin - - - install - - - - - - - run - - - - - - - diff --git a/akka-patterns/pom.xml b/akka-patterns/pom.xml deleted file mode 100644 index 6d3f8e0b41..0000000000 --- a/akka-patterns/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - 4.0.0 - - akka-patterns - Akka Patterns Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - akka-core - ${project.groupId} - ${project.version} - - - - - org.scalatest - scalatest - 1.0 - test - - - junit - junit - 4.5 - test - - - diff --git a/akka-persistence/akka-persistence-cassandra/pom.xml b/akka-persistence/akka-persistence-cassandra/pom.xml deleted file mode 100644 index d8490382d5..0000000000 --- a/akka-persistence/akka-persistence-cassandra/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ - - 4.0.0 - - akka-persistence-cassandra - Akka Persistence Cassandra Module - - jar - - - akka-persistence-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-persistence-common - ${project.groupId} - ${project.version} - - - com.google.code.google-collections - google-collect - - - - - - - org.apache.cassandra - cassandra - 0.5.0 - - - org.apache.cassandra - high-scale-lib - 0.5.0 - test - - - org.apache.cassandra - clhm-production - 0.5.0 - test - - - com.google.collections - google-collections - 1.0-rc1 - test - - - commons-collections - commons-collections - 3.2.1 - test - - - commons-lang - commons-lang - 2.4 - test - - - org.slf4j - slf4j-api - 1.5.8 - test - - - org.slf4j - slf4j-log4j12 - 1.5.8 - test - - - - - log4j - log4j - 1.2.13 - - - - diff --git a/akka-persistence/akka-persistence-common/pom.xml b/akka-persistence/akka-persistence-common/pom.xml deleted file mode 100644 index 623fbea571..0000000000 --- a/akka-persistence/akka-persistence-common/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - 4.0.0 - - akka-persistence-common - Akka Persistence Common Module - - jar - - - akka-persistence-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - com.facebook - thrift - 1.0 - - - commons-pool - commons-pool - 1.5.1 - - - - diff --git a/akka-persistence/akka-persistence-mongo/pom.xml b/akka-persistence/akka-persistence-mongo/pom.xml deleted file mode 100644 index 616deb7492..0000000000 --- a/akka-persistence/akka-persistence-mongo/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - 4.0.0 - - akka-persistence-mongo - Akka Persistence Mongo Module - - jar - - - akka-persistence-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-persistence-common - ${project.groupId} - ${project.version} - - - - - org.mongodb - mongo-java-driver - 1.1 - - - - diff --git a/akka-persistence/akka-persistence-redis/pom.xml b/akka-persistence/akka-persistence-redis/pom.xml deleted file mode 100644 index 112d4764cb..0000000000 --- a/akka-persistence/akka-persistence-redis/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - 4.0.0 - - akka-persistence-redis - Akka Persistence Redis Module - - jar - - - akka-persistence-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-persistence-common - ${project.groupId} - ${project.version} - - - - - com.redis - redisclient - 1.1 - - - - diff --git a/akka-rest/pom.xml b/akka-rest/pom.xml deleted file mode 100644 index 4e875cb310..0000000000 --- a/akka-rest/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - 4.0.0 - - akka-rest - Akka REST Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - - akka-core - ${project.groupId} - ${project.version} - - - - - javax.servlet - servlet-api - 2.5 - - - com.sun.jersey - jersey-core - ${jersey.version} - - - com.sun.jersey - jersey-server - ${jersey.version} - - - com.sun.jersey - jersey-json - ${jersey.version} - - - javax.ws.rs - jsr311-api - 1.1 - - - com.sun.jersey.contribs - jersey-scala - ${jersey.version} - - - diff --git a/akka-samples/akka-sample-chat/pom.xml b/akka-samples/akka-sample-chat/pom.xml deleted file mode 100644 index 20ee421978..0000000000 --- a/akka-samples/akka-sample-chat/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - 4.0.0 - - akka-sample-chat - Akka Chat Sample Module - - jar - - - akka-samples-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - src/main/scala - - - maven-antrun-plugin - - - install - - - - - - - run - - - - - - - diff --git a/akka-samples/akka-sample-lift/pom.xml b/akka-samples/akka-sample-lift/pom.xml deleted file mode 100644 index a07c288e31..0000000000 --- a/akka-samples/akka-sample-lift/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - akka-sample-lift - Akka Lift Sample Module - - war - - - akka-samples-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - 1.1-M6 - - - - - net.liftweb - lift-util - ${lift.version} - - - net.liftweb - lift-webkit - ${lift.version} - - - javax.servlet - servlet-api - 2.5 - provided - - - junit - junit - 4.5 - test - - - org.mortbay.jetty - jetty - [6.1.6,) - test - - - diff --git a/akka-samples/akka-sample-rest-java/pom.xml b/akka-samples/akka-sample-rest-java/pom.xml deleted file mode 100644 index 6539a0234b..0000000000 --- a/akka-samples/akka-sample-rest-java/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - 4.0.0 - - akka-sample-rest-java - Akka REST Java Sample Module - - jar - - - akka-samples-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - **/* - - - - - maven-antrun-plugin - - - install - - - - - - - run - - - - - - - diff --git a/akka-samples/akka-sample-rest-scala/pom.xml b/akka-samples/akka-sample-rest-scala/pom.xml deleted file mode 100644 index e62a329f8c..0000000000 --- a/akka-samples/akka-sample-rest-scala/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - - akka-sample-rest-scala - Akka REST Scala Sample Module - - jar - - - akka-samples-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - javax.ws.rs - jsr311-api - 1.0 - - - - - src/main/scala - - - maven-antrun-plugin - - - install - - - - - - - run - - - - - - - diff --git a/akka-samples/akka-sample-security/pom.xml b/akka-samples/akka-sample-security/pom.xml deleted file mode 100644 index 86f331fd65..0000000000 --- a/akka-samples/akka-sample-security/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - 4.0.0 - - akka-sample-security - Akka Sample Security Module - - jar - - - akka-samples-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - javax.ws.rs - jsr311-api - 1.0 - - - javax.annotation - jsr250-api - 1.0 - - - - - - src/main/scala - - - maven-antrun-plugin - - - install - - - - - - - run - - - - - - - diff --git a/akka-samples/pom.xml b/akka-samples/pom.xml deleted file mode 100644 index ad94fc8aab..0000000000 --- a/akka-samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - 4.0.0 - - akka-samples-parent - Akka Sample Modules - - pom - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - akka-sample-chat - akka-sample-lift - akka-sample-security - akka-sample-rest-scala - akka-sample-rest-java - - - - - akka-core - ${project.groupId} - ${project.version} - - - akka-persistence-cassandra - ${project.groupId} - ${project.version} - - - akka-persistence-redis - ${project.groupId} - ${project.version} - - - akka-rest - ${project.groupId} - ${project.version} - - - akka-comet - ${project.groupId} - ${project.version} - - - akka-security - ${project.groupId} - ${project.version} - - - diff --git a/akka-security/pom.xml b/akka-security/pom.xml deleted file mode 100644 index 8d7c66a5f7..0000000000 --- a/akka-security/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - 4.0.0 - - akka-security - Akka Security Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-core - ${project.groupId} - ${project.version} - - - javax.annotation - jsr250-api - 1.0 - - - com.sun.jersey - jersey-server - 1.1.3-ea - - - javax.ws.rs - jsr311-api - 1.0 - - - net.liftweb - lift-util - 1.1-M6 - - - - - org.scalatest - scalatest - 1.0 - test - - - junit - junit - 4.5 - test - - - org.mockito - mockito-all - 1.8.0 - test - - - diff --git a/akka-util-java/pom.xml b/akka-util-java/pom.xml deleted file mode 100644 index e0a729491b..0000000000 --- a/akka-util-java/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - 4.0.0 - - akka-util-java - Akka Java Utilities Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - org.guiceyfruit - guice-core - 2.0-beta-4 - - - com.google.protobuf - protobuf-java - 2.2.0 - - - org.multiverse - multiverse-alpha - 0.3 - jar-with-dependencies - - - org.multiverse - multiverse-core - - - asm - asm-tree - - - asm - asm-analysis - - - asm - asm-commons - - - asm - asm-util - - - - - - - src/main/java - src/test/java - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - **/* - - - - - - diff --git a/akka-util/pom.xml b/akka-util/pom.xml deleted file mode 100644 index 9b22090ee9..0000000000 --- a/akka-util/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - 4.0.0 - - akka-util - Akka Util Module - - jar - - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - org.scala-lang - scala-library - ${scala.version} - - - org.codehaus.aspectwerkz - aspectwerkz-nodeps-jdk5 - 2.1 - - - org.codehaus.aspectwerkz - aspectwerkz-jdk5 - 2.1 - - - net.lag - configgy - 1.4.7 - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 3cfc2839a8..0000000000 --- a/pom.xml +++ /dev/null @@ -1,565 +0,0 @@ - - - 4.0.0 - - Akka Project - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - 2009 - http://akkasource.org - pom - - - Akka implements a unique hybrid of: - * Actors , which gives you: - * Simple and high-level abstractions for concurrency and parallelism. - * Asynchronous, non-blocking and highly performant event-driven programming model. - * Very lightweight event-driven processes (create ~6.5 million actors on 4 G RAM). - * Supervision hierarchies with let-it-crash semantics. For writing highly fault-tolerant systems that never stop, systems that self-heal. - * Software Transactional Memory (STM). (Distributed transactions coming soon). - * Transactors: combine actors and STM into transactional actors. Allows you to compose atomic message flows with automatic rollback and retry. - * Remoting: highly performant distributed actors with remote supervision and error management. - * Cluster membership management. - - Akka also has a set of add-on modules: - * Persistence: A set of pluggable back-end storage modules that works in sync with the STM. - * Cassandra distributed and highly scalable database. - * MongoDB document database. - * Redis data structures database (upcoming) - * REST (JAX-RS): Expose actors as REST services. - * Comet: Expose actors as Comet services. - * Security: Digest and Kerberos based security. - * Microkernel: Run Akka as a stand-alone kernel. - - - - 2.7.7 - UTF-8 - 1.5 - ${maven.compiler.source} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - 0.5.2 - 1.1.5 - 1.9.18-i - - - - akka-util-java - akka-util - akka-cluster - akka-core - akka-persistence - akka-rest - akka-comet - akka-amqp - akka-security - akka-patterns - akka-kernel - akka-fun-test-java - akka-samples - - - - Scalable Solutions AB - http://scalablesolutions.se - - - - - The Apache License, ASL Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - jboner - Jonas Bonér - +1 - jonas [REMOVE] AT jonasboner DOT com - - Founder - Hacker - Despot - - - - viktorklang - Viktor Klang - +1 - viktor.klang [REMOVE] AT gmail DOT com - - Apostle - - - - - - scm:git:git://github.com/jboner/akka.git - scm:git:git@github.com:jboner/akka.git - http://github.com/jboner/akka - - - - assembla - http://assembla.com/spaces/akka/ - - - - hudson - http://hudson.scala-tools.org/job/akka/ - - - - - - - - - User and Developer Discussion List - http://groups.google.com/group/akka-user - akka-user@googlegroups.com - akka-user+subscribe@googlegroups.com - akka-user+unsubscribe@googlegroups.com - - - - - - project.embedded.module - Project Embedded Repository - file://${env.AKKA_HOME}/embedded-repo - - - repo1.maven - Maven Main Repository - http://repo1.maven.org/maven2 - - - scala-tools-snapshots - Scala-Tools Maven2 Snapshot Repository - http://scala-tools.org/repo-snapshots - - - scala-tools - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - lag - Configgy's' Repository - http://www.lag.net/repo - - - multiverse-releases - http://multiverse.googlecode.com/svn/maven-repository/releases - - false - - - - multiverse-snaphosts - http://multiverse.googlecode.com/svn/maven-repository/snapshots - - - maven2-repository.dev.java.net - Java.net Repository for Maven - http://download.java.net/maven/2 - - - java.net - Java.net Legacy Repository for Maven - http://download.java.net/maven/1 - legacy - - - guiceyfruit.release - GuiceyFruit Release Repository - http://guiceyfruit.googlecode.com/svn/repo/releases/ - - false - - - true - - - - guiceyfruit.snapshot - GuiceyFruit Snapshot Repository - http://guiceyfruit.googlecode.com/svn/repo/snapshots/ - - true - - - false - - - - guice-maven - guice maven - http://guice-maven.googlecode.com/svn/trunk - - - google-maven-repository - Google Maven Repository - http://google-maven-repository.googlecode.com/svn/repository/ - - - repository.codehaus.org - Codehaus Maven Repository - http://repository.codehaus.org - - true - - - - repository.jboss.org - JBoss Repository for Maven - http://repository.jboss.org/maven2 - - false - - - - nexus.griddynamics.net - Grid Dynamics Maven Repository - https://nexus.griddynamics.net/nexus/content/groups/public - - false - - - - databinder.net/repo/ - dbDispatch Repository for Maven - http://databinder.net/repo - - false - - - - - - - onejar-maven-plugin.googlecode.com - http://onejar-maven-plugin.googlecode.com/svn/mavenrepo - - - scala-tools.org - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - - - src/main/scala - src/test/scala - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0-beta-1 - - - enforce-akka-home - - enforce - - - - - env.AKKA_HOME - "You must have set AKKA_HOME!" - - - - ${env.AKKA_HOME}/embedded-repo - - - - true - - - - enforce-java - - enforce - - - - - 1.6.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.4.2 - - - **/*Test.java - - - - **/InMemNestedStateTest.java - - - - akka.home - ${basedir}/.. - - - org.multiverse.api.exceptions.WriteConflictException.reuse - true - - - - - - org.mortbay.jetty - maven-jetty-plugin - - / - 5 - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - org.scala-tools - maven-scala-plugin - 2.10.1 - - - - compile - testCompile - - - - - - -Xmx1024m - - - ${scala.version} - - - - true - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.0 - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - ${project.version} - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0-beta-1 - - - org.apache.felix - maven-bundle-plugin - 2.0.0 - true - - - J2SE-1.5 - <_versionpolicy>[$(@),$(version;=+;$(@))) - - - - - create-bundle - package - - bundle - - - - bundle-install - install - - install - - - - - - - - - - - org.codehaus.mojo - taglist-maven-plugin - 2.3 - - - FIXME - TODO - XXX - @fixme - @todo - @deprecated - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.1.2 - - - - cim - dependencies - dependency-convergence - - index - issue-tracking - license - mailing-list - - plugins - project-team - scm - summary - - - - - - org.scala-tools - maven-scala-plugin - 2.12.2 - - ${project.build.sourceEncoding} - - 1.2-SNAPSHOT - ${scala.version} - - -Xmx1024m - -DpackageLinkDefs=file://${project.build.directory}/packageLinkDefs.properties - - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.1 - - - - changes-report - - - - - ${basedir}/changes.xml - - - - maven-surefire-report-plugin - - - - - report-only - - - - - - - - - release - - - scala-tools.org - http://nexus.scala-tools.org/content/repositories/releases - - - scala-tools.org - file://${user.home}/.m2/mvnsites/akka - - - - - hudson - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots - false - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/mvnsites-snapshots/akka - - - - - From 4aabc07be27ade6c746771da3b1eeb4b5f0e4993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Fri, 5 Mar 2010 09:17:15 +0100 Subject: [PATCH 06/21] cleaned up buildfile --- project/build/AkkaProject.scala | 166 ++++++++++++++++---------------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index b865af998a..f3ef2987de 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -1,7 +1,7 @@ import sbt._ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { - //repos + // repos val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" val databinder = "DataBinder" at "http://databinder.net/repo" val configgy = "Configgy" at "http://www.lag.net/repo" @@ -12,57 +12,58 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" val m2 = "m2" at "http://download.java.net/maven/2" - //project versions - val JERSEYVERSION = "1.1.5" - val ATMOVERSION = "0.6-SNAPSHOT" - val CASSANDRAVERSION = "0.5.0" + // project versions + val JERSEY_VERSION = "1.1.5" + val ATMO_VERSION = "0.6-SNAPSHOT" + val CASSANDRA_VERSION = "0.5.0" - //project defintions - lazy val javautil = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) - lazy val util = project("akka-util", "akka-util",new AkkaUtilProject(_)) - lazy val core = project("akka-core", "akka-core", new AkkaCoreProject(_), util, javautil) - lazy val amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), core) - lazy val rest = project("akka-rest", "akka-rest", new AkkaRestProject(_), core) - lazy val comet = project("akka-comet", "akka-comet",new AkkaCometProject(_), rest) - lazy val patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), core) - lazy val security = project("akka-security", "akka-security", new AkkaSecurityProject(_), core) - lazy val persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) - lazy val cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) - lazy val kernel = project("akka-kernel","akka-kernel", new AkkaKernelProject(_),core,rest,persistence,cluster,amqp,security,comet) - //examples - lazy val funtest = project("akka-fun-test-java","akka-fun-test-java", new AkkaFunTestProject(_),kernel) - lazy val samples = project("akka-samples","akka-samples", new AkkaSamplesParentProject(_)) + // project defintions + lazy val akka_java_util = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) + lazy val akka_util = project("akka-util", "akka-util",new AkkaUtilProject(_)) + lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_), akka_util, akka_java_util) + lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core) + lazy val akka_rest = project("akka-rest", "akka-rest", new AkkaRestProject(_), akka_core) + lazy val akka_comet = project("akka-comet", "akka-comet",new AkkaCometProject(_), akka_rest) + lazy val akka_patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), akka_core) + lazy val akka_security = project("akka-security", "akka-security", new AkkaSecurityProject(_), akka_core) + lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) + lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) + lazy val akka_kernel = project("akka-kernel","akka-kernel", new AkkaKernelProject(_),akka_core,akka_rest,akka_persistence,akka_cluster,akka_amqp,akka_security,akka_comet) + + // examples + lazy val akka_fun_test = project("akka-fun-test-java","akka-fun-test-java", new AkkaFunTestProject(_),akka_kernel) + lazy val akka_samples = project("akka-samples","akka-samples", new AkkaSamplesParentProject(_)) // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { val sjson = "sjson.json" % "sjson" % "0.4" % "compile" - val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" - val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" - val commonsio = "commons-io" % "commons-io" % "1.4" % "compile" - val netdatabinder = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" - val netdatabinderhttp = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" + val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" + val dispatch_json = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" + val dispatch_http = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" val sbinary = "sbinary" % "sbinary" % "0.3" % "compile" - val jack = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" - val jackcore = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" - val volde = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" - val scalajavautil = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" + val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" + val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" + val voldemort = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" + val javautils = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" - //testing + // testing val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" } class AkkaUtilProject(info: ProjectInfo) extends DefaultProject(info) { - val aspec = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" - val apsec_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" + val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" val configgy = "net.lag" % "configgy" % "1.4.7" % "compile" } class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" - val proto = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" - val multi = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" + val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" + val multiverse = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" } class AkkaAMQPProject(info:ProjectInfo) extends DefaultProject(info) { @@ -71,43 +72,43 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { class AkkaRestProject(info:ProjectInfo) extends DefaultProject(info) { val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" - val jersey = "com.sun.jersey" % "jersey-core" % JERSEYVERSION % "compile" - val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" - val jerseyjson = "com.sun.jersey" % "jersey-json" % JERSEYVERSION % "compile" - val jerseycontrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEYVERSION % "compile" - val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" + val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" + val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" + val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile" + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" } class AkkaCometProject(info:ProjectInfo) extends DefaultProject(info) { val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" - val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMOVERSION % "compile" - val atmojersey = "org.atmosphere" % "atmosphere-jersey" % ATMOVERSION % "compile" - val atmoruntime = "org.atmosphere" % "atmosphere-runtime" % ATMOVERSION % "compile" + val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" + val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" + val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" } class AkkaPatternsProject(info:ProjectInfo) extends DefaultProject(info) { - //testing + // testing val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" } class AkkaSecurityProject(info:ProjectInfo) extends DefaultProject(info) { val annotation = "javax.annotation" % "jsr250-api" % "1.0" - val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" - val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" - val liftutil = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" - //testing + val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val lift_util = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" + // testing val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" } - class AkkaPersistenceCommonProject(info:ProjectInfo) extends DefaultProject(info) { - val facebook = "com.facebook" % "thrift" % "1.0" % "compile" - val commonspool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" + val thrift = "com.facebook" % "thrift" % "1.0" % "compile" + val commons_pool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" } + class AkkaRedisProject(info:ProjectInfo) extends DefaultProject(info) { val redis = "com.redis" % "redisclient" % "1.1" % "compile" } @@ -117,22 +118,21 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { } class AkkaCassandraProject(info:ProjectInfo) extends DefaultProject(info) { - val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRAVERSION % "compile" - val cassandralib = "org.apache.cassandra" % "high-scale-lib" % CASSANDRAVERSION % "test" - val cassandraclhm = "org.apache.cassandra" % "clhm-production" % CASSANDRAVERSION % "test" - val commonscoll = "commons-collections" % "commons-collections" % "3.2.1" % "test" - val googlecoll = "com.google.collections" % "google-collections" % "1.0" % "test" + val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRA_VERSION % "compile" + val high_scale = "org.apache.cassandra" % "high-scale-lib" % CASSANDRA_VERSION % "test" + val cassandra_clhm = "org.apache.cassandra" % "clhm-production" % CASSANDRA_VERSION % "test" + val commons_coll = "commons-collections" % "commons-collections" % "3.2.1" % "test" + val google_coll = "com.google.collections" % "google-collections" % "1.0" % "test" val slf4j = "org.slf4j" % "slf4j-api" % "1.5.8" % "test" - val slf4jlog4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" - + val slf4j_log4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" val log4j = "log4j" % "log4j" % "1.2.15" % "test" } class AkkaPersistenceParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val akkapersistencecommon = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_),core) - lazy val redis = project("akka-persistence-redis","akka-persistence-redis", new AkkaRedisProject(_),akkapersistencecommon) - lazy val mongo = project("akka-persistence-mongo","akka-persistence-mongo", new AkkaMongoProject(_),akkapersistencecommon) - lazy val cassandra = project("akka-persistence-cassandra","akka-persistence-cassandra", new AkkaCassandraProject(_),akkapersistencecommon) + lazy val akka_persistence_common = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_),akka_core) + lazy val akka_persistence_redis = project("akka-persistence-redis","akka-persistence-redis", new AkkaRedisProject(_),akka_persistence_common) + lazy val akka_persistence_mongo = project("akka-persistence-mongo","akka-persistence-mongo", new AkkaMongoProject(_),akka_persistence_common) + lazy val akka_persistence_cassandra = project("akka-persistence-cassandra","akka-persistence-cassandra", new AkkaCassandraProject(_),akka_persistence_common) } @@ -142,29 +142,29 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { class AkkaShoalProject(info:ProjectInfo) extends DefaultProject(info) { val shoal = "shoal-jxta" % "shoal" % "1.1-20090818" % "compile" - val shoalextra = "shoal-jxta" % "jxta" % "1.1-20090818" % "compile" + val shoal_extra = "shoal-jxta" % "jxta" % "1.1-20090818" % "compile" } class AkkaClusterParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val jgroups = project("akka-cluster-jgroups","akka-cluster-jgroups", new AkkaJgroupsProject(_),core) - lazy val shoal = project("akka-cluster-shoal","akka-cluster-shoal", new AkkaShoalProject(_),core) + lazy val akka_cluster_jgroups = project("akka-cluster-jgroups","akka-cluster-jgroups", new AkkaJgroupsProject(_),akka_core) + lazy val akka_cluster_shoal = project("akka-cluster-shoal","akka-cluster-shoal", new AkkaShoalProject(_),akka_core) } class AkkaKernelProject(info:ProjectInfo) extends DefaultProject(info) { - val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" - val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMOVERSION % "compile" - val atmojersey = "org.atmosphere" % "atmosphere-jersey" % ATMOVERSION % "compile" - val atmoruntime = "org.atmosphere" % "atmosphere-runtime" % ATMOVERSION % "compile" + val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" + val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" + val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" + val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" } - //examples + // examples class AkkaFunTestProject(info:ProjectInfo) extends DefaultProject(info) { val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" - val jerseyserver = "com.sun.jersey" % "jersey-server" % JERSEYVERSION % "compile" - val jerseyjson = "com.sun.jersey" % "jersey-json" % JERSEYVERSION % "compile" - val jerseyatom = "com.sun.jersey" % "jersey-atom" % JERSEYVERSION % "compile" - //testing + val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" + val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" + val jersey_atom = "com.sun.jersey" % "jersey-atom" % JERSEY_VERSION % "compile" + // testing val junit = "junit" % "junit" % "4.5" % "test" val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" } @@ -173,10 +173,10 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { class AkkaSampleChatProject(info:ProjectInfo) extends DefaultProject(info) class AkkaSampleLiftProject(info:ProjectInfo) extends DefaultProject(info) { - val liftutil = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" val lift = "net.liftweb" % "lift-webkit" % "1.1-M6" % "compile" + val lift_util = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" - //testing + // testing val jetty = "org.mortbay.jetty" % "jetty" % "6.1.6" % "test" val junit = "junit" % "junit" % "4.5" % "test" } @@ -184,19 +184,19 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { class AkkaSampleRestJavaProject(info:ProjectInfo) extends DefaultProject(info) class AkkaSampleRestScalaProject(info:ProjectInfo) extends DefaultProject(info) { - val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" } class AkkaSampleSecurityProject(info:ProjectInfo) extends DefaultProject(info) { - val jsr = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" - val annotation = "javax.annotation" % "jsr250-api" % "1.0" + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" } class AkkaSamplesParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val chat = project("akka-sample-chat","akka-sample-chat",new AkkaSampleChatProject(_),kernel) - lazy val lift = project("akka-sample-lift","akka-sample-lift",new AkkaSampleLiftProject(_),kernel) - lazy val restjava = project("akka-sample-rest-java","akka-sample-rest-java",new AkkaSampleRestJavaProject(_),kernel) - lazy val restscala = project("akka-sample-rest-scala","akka-sample-rest-scala",new AkkaSampleRestScalaProject(_),kernel) - lazy val security = project("akka-sample-security","akka-sample-security",new AkkaSampleSecurityProject(_),kernel) + lazy val akka_sample_chat = project("akka-sample-chat","akka-sample-chat",new AkkaSampleChatProject(_),akka_kernel) + lazy val akka_sample_lift = project("akka-sample-lift","akka-sample-lift",new AkkaSampleLiftProject(_),akka_kernel) + lazy val akka_sample_rest_java = project("akka-sample-rest-java","akka-sample-rest-java",new AkkaSampleRestJavaProject(_),akka_kernel) + lazy val akka_sample_rest_scala = project("akka-sample-rest-scala","akka-sample-rest-scala",new AkkaSampleRestScalaProject(_),akka_kernel) + lazy val akka_sample_security = project("akka-sample-security","akka-sample-security",new AkkaSampleSecurityProject(_),akka_kernel) } } From 9705ee52c5fc830ba670173935de3ebd31f4ec9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Fri, 5 Mar 2010 14:33:14 +0100 Subject: [PATCH 07/21] added test filter to filter away all tests that end with Spec --- .../test/scala/RemoteClientShutdownTest.scala | 3 +- project/build/AkkaProject.scala | 167 +++++++++--------- 2 files changed, 88 insertions(+), 82 deletions(-) diff --git a/akka-core/src/test/scala/RemoteClientShutdownTest.scala b/akka-core/src/test/scala/RemoteClientShutdownTest.scala index f6fbea1bb9..d330dce5ce 100644 --- a/akka-core/src/test/scala/RemoteClientShutdownTest.scala +++ b/akka-core/src/test/scala/RemoteClientShutdownTest.scala @@ -6,7 +6,7 @@ import Actor.Sender.Self import org.scalatest.junit.JUnitSuite import org.junit.Test - +/* class RemoteClientShutdownTest extends JUnitSuite { @Test def shouldShutdownRemoteClient = { RemoteNode.start("localhost", 9999) @@ -28,3 +28,4 @@ class TravelingActor extends RemoteActor("localhost", 9999) { case _ => log.info("message received") } } +*/ \ No newline at end of file diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index f3ef2987de..b11dc3e682 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -1,43 +1,43 @@ import sbt._ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { - // repos - val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" - val databinder = "DataBinder" at "http://databinder.net/repo" - val configgy = "Configgy" at "http://www.lag.net/repo" - val multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" - val jboss = "jBoss" at "http://repository.jboss.org/maven2" - val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" - val embeddedrepo = "embedded repo" at "http://guice-maven.googlecode.com/svn/trunk" - val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" - val m2 = "m2" at "http://download.java.net/maven/2" + // repos + val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" + val databinder = "DataBinder" at "http://databinder.net/repo" + val configgy = "Configgy" at "http://www.lag.net/repo" + val multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val jboss = "jBoss" at "http://repository.jboss.org/maven2" + val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" + val embeddedrepo = "embedded repo" at "http://guice-maven.googlecode.com/svn/trunk" + val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" + val m2 = "m2" at "http://download.java.net/maven/2" - // project versions - val JERSEY_VERSION = "1.1.5" - val ATMO_VERSION = "0.6-SNAPSHOT" - val CASSANDRA_VERSION = "0.5.0" + // project versions + val JERSEY_VERSION = "1.1.5" + val ATMO_VERSION = "0.6-SNAPSHOT" + val CASSANDRA_VERSION = "0.5.0" - // project defintions - lazy val akka_java_util = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) - lazy val akka_util = project("akka-util", "akka-util",new AkkaUtilProject(_)) - lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_), akka_util, akka_java_util) - lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core) - lazy val akka_rest = project("akka-rest", "akka-rest", new AkkaRestProject(_), akka_core) - lazy val akka_comet = project("akka-comet", "akka-comet",new AkkaCometProject(_), akka_rest) - lazy val akka_patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), akka_core) - lazy val akka_security = project("akka-security", "akka-security", new AkkaSecurityProject(_), akka_core) - lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) - lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) - lazy val akka_kernel = project("akka-kernel","akka-kernel", new AkkaKernelProject(_),akka_core,akka_rest,akka_persistence,akka_cluster,akka_amqp,akka_security,akka_comet) + // project defintions + lazy val akka_java_util = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) + lazy val akka_util = project("akka-util", "akka-util", new AkkaUtilProject(_)) + lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_), akka_util, akka_java_util) + lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core) + lazy val akka_rest = project("akka-rest", "akka-rest", new AkkaRestProject(_), akka_core) + lazy val akka_comet = project("akka-comet", "akka-comet", new AkkaCometProject(_), akka_rest) + lazy val akka_patterns = project("akka-patterns", "akka-patterns", new AkkaPatternsProject(_), akka_core) + lazy val akka_security = project("akka-security", "akka-security", new AkkaSecurityProject(_), akka_core) + lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) + lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) + lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_rest, akka_persistence, akka_cluster, akka_amqp, akka_security, akka_comet) - // examples - lazy val akka_fun_test = project("akka-fun-test-java","akka-fun-test-java", new AkkaFunTestProject(_),akka_kernel) - lazy val akka_samples = project("akka-samples","akka-samples", new AkkaSamplesParentProject(_)) + // examples + lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) + lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { - val sjson = "sjson.json" % "sjson" % "0.4" % "compile" + val sjson = "sjson.json" % "sjson" % "0.4" % "compile" val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" @@ -50,7 +50,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val javautils = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" // testing - val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" } @@ -66,11 +66,11 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val multiverse = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" } - class AkkaAMQPProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaAMQPProject(info: ProjectInfo) extends DefaultProject(info) { val rabbit = "com.rabbitmq" % "amqp-client" % "1.7.2" } - class AkkaRestProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaRestProject(info: ProjectInfo) extends DefaultProject(info) { val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" @@ -79,7 +79,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" } - class AkkaCometProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaCometProject(info: ProjectInfo) extends DefaultProject(info) { val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" @@ -87,37 +87,39 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" } - class AkkaPatternsProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaPatternsProject(info: ProjectInfo) extends DefaultProject(info) { // testing - val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" } - class AkkaSecurityProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaSecurityProject(info: ProjectInfo) extends DefaultProject(info) { val annotation = "javax.annotation" % "jsr250-api" % "1.0" val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" val lift_util = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" // testing - val scalatest= "org.scalatest" % "scalatest" % "1.0" % "test" + val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" } - class AkkaPersistenceCommonProject(info:ProjectInfo) extends DefaultProject(info) { - val thrift = "com.facebook" % "thrift" % "1.0" % "compile" - val commons_pool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" + class AkkaPersistenceCommonProject(info: ProjectInfo) extends DefaultProject(info) { + val thrift = "com.facebook" % "thrift" % "1.0" % "compile" + val commons_pool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" } - - class AkkaRedisProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaRedisProject(info: ProjectInfo) extends DefaultProject(info) { val redis = "com.redis" % "redisclient" % "1.1" % "compile" + override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil } - class AkkaMongoProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaMongoProject(info: ProjectInfo) extends DefaultProject(info) { val mongo = "org.mongodb" % "mongo-java-driver" % "1.1" % "compile" + override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil } - class AkkaCassandraProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaCassandraProject(info: ProjectInfo) extends DefaultProject(info) { val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRA_VERSION % "compile" val high_scale = "org.apache.cassandra" % "high-scale-lib" % CASSANDRA_VERSION % "test" val cassandra_clhm = "org.apache.cassandra" % "clhm-production" % CASSANDRA_VERSION % "test" @@ -125,40 +127,43 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val google_coll = "com.google.collections" % "google-collections" % "1.0" % "test" val slf4j = "org.slf4j" % "slf4j-api" % "1.5.8" % "test" val slf4j_log4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" - val log4j = "log4j" % "log4j" % "1.2.15" % "test" + val log4j = "log4j" % "log4j" % "1.2.15" % "test" + override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil } - - class AkkaPersistenceParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val akka_persistence_common = project ("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_),akka_core) - lazy val akka_persistence_redis = project("akka-persistence-redis","akka-persistence-redis", new AkkaRedisProject(_),akka_persistence_common) - lazy val akka_persistence_mongo = project("akka-persistence-mongo","akka-persistence-mongo", new AkkaMongoProject(_),akka_persistence_common) - lazy val akka_persistence_cassandra = project("akka-persistence-cassandra","akka-persistence-cassandra", new AkkaCassandraProject(_),akka_persistence_common) + class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val akka_persistence_common = project("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_), akka_core) + lazy val akka_persistence_redis = project("akka-persistence-redis", "akka-persistence-redis", new AkkaRedisProject(_), akka_persistence_common) + lazy val akka_persistence_mongo = project("akka-persistence-mongo", "akka-persistence-mongo", new AkkaMongoProject(_), akka_persistence_common) + lazy val akka_persistence_cassandra = project("akka-persistence-cassandra", "akka-persistence-cassandra", new AkkaCassandraProject(_), akka_persistence_common) } - - class AkkaJgroupsProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaJgroupsProject(info: ProjectInfo) extends DefaultProject(info) { val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" } - - class AkkaShoalProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaShoalProject(info: ProjectInfo) extends DefaultProject(info) { val shoal = "shoal-jxta" % "shoal" % "1.1-20090818" % "compile" val shoal_extra = "shoal-jxta" % "jxta" % "1.1-20090818" % "compile" } - - class AkkaClusterParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val akka_cluster_jgroups = project("akka-cluster-jgroups","akka-cluster-jgroups", new AkkaJgroupsProject(_),akka_core) - lazy val akka_cluster_shoal = project("akka-cluster-shoal","akka-cluster-shoal", new AkkaShoalProject(_),akka_core) + + class AkkaClusterParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val akka_cluster_jgroups = project("akka-cluster-jgroups", "akka-cluster-jgroups", new AkkaJgroupsProject(_), akka_core) + lazy val akka_cluster_shoal = project("akka-cluster-shoal", "akka-cluster-shoal", new AkkaShoalProject(_), akka_core) } - - class AkkaKernelProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaKernelProject(info: ProjectInfo) extends DefaultProject(info) { val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" + + def mainMethod = Some("se.scalablesolutions.akka.Main") + override def packageOptions: Seq[PackageOption] = MainClass("se.scalablesolutions.akka.Main") :: Nil } // examples - class AkkaFunTestProject(info:ProjectInfo) extends DefaultProject(info) { + class AkkaFunTestProject(info: ProjectInfo) extends DefaultProject(info) { val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" @@ -168,35 +173,35 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val junit = "junit" % "junit" % "4.5" % "test" val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" } - - - class AkkaSampleChatProject(info:ProjectInfo) extends DefaultProject(info) - - class AkkaSampleLiftProject(info:ProjectInfo) extends DefaultProject(info) { + + + class AkkaSampleChatProject(info: ProjectInfo) extends DefaultProject(info) + + class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultProject(info) { val lift = "net.liftweb" % "lift-webkit" % "1.1-M6" % "compile" val lift_util = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" // testing - val jetty = "org.mortbay.jetty" % "jetty" % "6.1.6" % "test" + val jetty = "org.mortbay.jetty" % "jetty" % "6.1.6" % "test" val junit = "junit" % "junit" % "4.5" % "test" } - - class AkkaSampleRestJavaProject(info:ProjectInfo) extends DefaultProject(info) - - class AkkaSampleRestScalaProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaSampleRestJavaProject(info: ProjectInfo) extends DefaultProject(info) + + class AkkaSampleRestScalaProject(info: ProjectInfo) extends DefaultProject(info) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" } - - class AkkaSampleSecurityProject(info:ProjectInfo) extends DefaultProject(info) { + + class AkkaSampleSecurityProject(info: ProjectInfo) extends DefaultProject(info) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" } - class AkkaSamplesParentProject(info:ProjectInfo) extends ParentProject(info) { - lazy val akka_sample_chat = project("akka-sample-chat","akka-sample-chat",new AkkaSampleChatProject(_),akka_kernel) - lazy val akka_sample_lift = project("akka-sample-lift","akka-sample-lift",new AkkaSampleLiftProject(_),akka_kernel) - lazy val akka_sample_rest_java = project("akka-sample-rest-java","akka-sample-rest-java",new AkkaSampleRestJavaProject(_),akka_kernel) - lazy val akka_sample_rest_scala = project("akka-sample-rest-scala","akka-sample-rest-scala",new AkkaSampleRestScalaProject(_),akka_kernel) - lazy val akka_sample_security = project("akka-sample-security","akka-sample-security",new AkkaSampleSecurityProject(_),akka_kernel) + class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val akka_sample_chat = project("akka-sample-chat", "akka-sample-chat", new AkkaSampleChatProject(_), akka_kernel) + lazy val akka_sample_lift = project("akka-sample-lift", "akka-sample-lift", new AkkaSampleLiftProject(_), akka_kernel) + lazy val akka_sample_rest_java = project("akka-sample-rest-java", "akka-sample-rest-java", new AkkaSampleRestJavaProject(_), akka_kernel) + lazy val akka_sample_rest_scala = project("akka-sample-rest-scala", "akka-sample-rest-scala", new AkkaSampleRestScalaProject(_), akka_kernel) + lazy val akka_sample_security = project("akka-sample-security", "akka-sample-security", new AkkaSampleSecurityProject(_), akka_kernel) } } From 38251f6361d5909cb327e864f69a479eaefa61b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Sun, 7 Mar 2010 11:14:56 +0100 Subject: [PATCH 08/21] added java fun tests back to sbt project --- akka-fun-test-java/pom.xml | 134 ++++++++++++++++++++++++++++++++ project/build/AkkaProject.scala | 2 +- 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100755 akka-fun-test-java/pom.xml diff --git a/akka-fun-test-java/pom.xml b/akka-fun-test-java/pom.xml new file mode 100755 index 0000000000..5c55cf0be5 --- /dev/null +++ b/akka-fun-test-java/pom.xml @@ -0,0 +1,134 @@ + + 4.0.0 + + Akka Functional Tests in Java + akka-fun-test-java + se.scalablesolutions.akka + 0.7-SNAPSHOT + jar + + + 2.7.7 + 0.5.2 + 1.1.5 + 1.9.18-i + + + + + akka-kernel + se.scalablesolutions.akka + 0.7-SNAPSHOT + + + se.scalablesolutions.akka + akka-persistence-cassandra + 0.7-SNAPSHOT + + + com.google.protobuf + protobuf-java + 2.2.0 + + + org.codehaus.jackson + jackson-core-asl + 1.2.1 + + + org.codehaus.jackson + jackson-mapper-asl + 1.2.1 + + + com.sun.grizzly + grizzly-servlet-webserver + ${grizzly.version} + test + + + com.sun.jersey + jersey-server + ${jersey.version} + test + + + com.sun.jersey + jersey-json + ${jersey.version} + test + + + com.sun.jersey + jersey-client + ${jersey.version} + test + + + com.sun.jersey + jersey-atom + ${jersey.version} + test + + + junit + junit + 4.5 + test + + + org.jmock + jmock + 2.4.0 + test + + + + + src/main/java + src/test/java + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + **/* + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*Persistent* + + + + + + + false + src/test/resources + + + false + src/test/java + + ** + + + **/*.java + + + + + + + + diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 25779c260f..2af245cdc4 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -85,7 +85,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" val voldemort = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" val javautils = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" - val netty = "org.jboss.netty" % "netty" % "3.2.0.ALPHA3" % "compile" + val netty = "org.jboss.netty" % "netty" % "3.2.0.BETA1" % "compile" // testing val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" From 7873a7a9e0426fafc5b38f6702afa3413596918b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Sun, 7 Mar 2010 14:07:59 +0100 Subject: [PATCH 09/21] added assembly task and dist task to package distribution --- config/akka-reference.conf | 2 +- project/build/AkkaProject.scala | 36 ++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/config/akka-reference.conf b/config/akka-reference.conf index 5a1c33497b..d59134d909 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -51,7 +51,7 @@ service = on # FIXME add 'service = on' for name = "default" # The name of the cluster - #actor = "se.scalablesolutions.akka.remote.JGroupsClusterActor" # FQN of an implementation of ClusterActor + actor = "se.scalablesolutions.akka.remote.JGroupsClusterActor" # FQN of an implementation of ClusterActor serializer = "se.scalablesolutions.akka.serialization.Serializer$Java" # FQN of the serializer class diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 2af245cdc4..ca3099cee0 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -71,6 +71,11 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) + def akkaHome = { + val home = System.getenv("AKKA_HOME") + if (home == null) throw new Error("You need to set the $AKKA_HOME environment variable to the root of the Akka distribution") + home + } // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { @@ -189,12 +194,13 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_cluster_shoal = project("akka-cluster-shoal", "akka-cluster-shoal", new AkkaShoalProject(_), akka_core) } - class AkkaKernelProject(info: ProjectInfo) extends DefaultProject(info) { + class AkkaKernelProject(info: ProjectInfo) extends DefaultProject(info) with AssemblyProject { val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" + val assemblyDistPath = Path.fromFile(new java.io.File(akkaHome + "/dist/akka-" + version.toString + ".jar")) def mainMethod = Some("se.scalablesolutions.akka.Main") override def packageOptions: Seq[PackageOption] = MainClass("se.scalablesolutions.akka.Main") :: Nil } @@ -240,5 +246,33 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_sample_rest_java = project("akka-sample-rest-java", "akka-sample-rest-java", new AkkaSampleRestJavaProject(_), akka_kernel) lazy val akka_sample_rest_scala = project("akka-sample-rest-scala", "akka-sample-rest-scala", new AkkaSampleRestScalaProject(_), akka_kernel) lazy val akka_sample_security = project("akka-sample-security", "akka-sample-security", new AkkaSampleSecurityProject(_), akka_kernel) + + //FileUtilities.copyFile(assemblyOutputPath, assemblyDistPath, log) + } +} + +trait AssemblyProject extends BasicScalaProject { + val assemblyDistPath: Path + + def assemblyExclude(base: PathFinder) = base / "META-INF" ** "*" + def assemblyOutputPath = outputPath / assemblyJarName + def assemblyJarName = artifactID + "-assembly-" + version + ".jar" + def assemblyTemporaryPath = outputPath / "assembly-libs" + def assemblyClasspath = runClasspath + def assemblyExtraJars = mainDependencies.scalaJars + + def assemblyPaths(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = { + val (libs, directories) = classpath.get.toList.partition(ClasspathUtilities.isArchive) + for(jar <- extraJars.get ++ libs) FileUtilities.unzip(jar, tempDir, log) + val base = (Path.lazyPathFinder(tempDir :: directories) ##) + (descendents(base, "*") --- exclude(base)).get + } + + lazy val assembly = assemblyTask(assemblyTemporaryPath, assemblyClasspath, assemblyExtraJars, assemblyExclude) dependsOn(compile) describedAs("Packaging assembly") + + lazy val dist = task({ log.info("Creating distribution " + assemblyDistPath); FileUtilities.copyFile(assemblyOutputPath, assemblyDistPath, log) }) dependsOn(assembly) describedAs("Creating distribution") + + def assemblyTask(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = { + packageTask(Path.lazyPathFinder(assemblyPaths(tempDir, classpath, extraJars, exclude)), assemblyOutputPath, packageOptions) } } From 5e7f928cb0492b056ba90e4a861e2afaad70daf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Tue, 9 Mar 2010 22:07:14 +0100 Subject: [PATCH 10/21] added final tasks (package up distribution and executable JAR) to SBT build --- akka-kernel/src/main/scala/Kernel.scala | 2 +- .../src/main/scala/ChatServer.scala | 202 ------------------ .../akka-sample-lift/config/akka.conf | 64 ------ .../src/main/resources/akka.conf | 35 --- .../project/build/AkkaJavaUtilProject.scala | 21 +- project/build/AkkaProject.scala | 163 ++++++++++---- 6 files changed, 134 insertions(+), 353 deletions(-) delete mode 100644 akka-samples/akka-sample-lift/config/akka.conf delete mode 100644 akka-samples/akka-sample-security/src/main/resources/akka.conf diff --git a/akka-kernel/src/main/scala/Kernel.scala b/akka-kernel/src/main/scala/Kernel.scala index 7b2b2e4693..2cafa6be6a 100644 --- a/akka-kernel/src/main/scala/Kernel.scala +++ b/akka-kernel/src/main/scala/Kernel.scala @@ -79,7 +79,7 @@ object Kernel extends Logging { (____ /__|_ \__|_ \(____ / \/ \/ \/ \/ """) - log.info(" Running version %s", Config.VERSION) + log.info(" Running version %s", Config.VERSION) log.info("==============================") } } diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala index d03c209706..a489de2ca5 100644 --- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala +++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala @@ -2,205 +2,3 @@ * Copyright (C) 2009-2010 Scalable Solutions AB . */ -package se.scalablesolutions.akka.sample.chat - -import se.scalablesolutions.akka.actor.{SupervisorFactory, Actor, RemoteActor} -import se.scalablesolutions.akka.stm.Transaction._ -import se.scalablesolutions.akka.remote.RemoteServer -import se.scalablesolutions.akka.util.Logging -import se.scalablesolutions.akka.config.ScalaConfig._ -import se.scalablesolutions.akka.config.OneForOneStrategy -import scala.collection.mutable.HashMap -import se.scalablesolutions.akka.state.{PersistentVector, RedisStorage} - -/****************************************************************************** - To run the sample: - 1. Run 'mvn install' (builds and deploys jar to AKKA_HOME/deploy) - 2. In another shell run 'java -jar ./dist/akka-0.6.jar' to start up Akka microkernel - 3. In the first shell run 'mvn scala:console -o' - 4. In the REPL you get execute: - - scala> import se.scalablesolutions.akka.sample.chat._ - - scala> Runner.run - 5. See the chat simulation run - 6. Run it again to see full speed after first initialization -******************************************************************************/ - -/** - * ChatServer's internal events. - */ -sealed trait Event -case class Login(user: String) extends Event -case class Logout(user: String) extends Event -case class GetChatLog(from: String) extends Event -case class ChatLog(log: List[String]) extends Event -case class ChatMessage(from: String, message: String) extends Event - -/** - * Chat client. - */ -class ChatClient(val name: String) { - import Actor.Sender.Self - def login = ChatService ! Login(name) - def logout = ChatService ! Logout(name) - def post(message: String) = ChatService ! ChatMessage(name, name + ": " + message) - def chatLog: ChatLog = (ChatService !! GetChatLog(name)).getOrElse(throw new Exception("Couldn't get the chat log from ChatServer")) -} - -/** - * Internal chat client session. - */ -class Session(user: String, storage: Actor) extends Actor { - private val loginTime = System.currentTimeMillis - private var userLog: List[String] = Nil - - log.info("New session for user [%s] has been created at [%s]", user, loginTime) - - def receive = { - case msg @ ChatMessage(from, message) => - userLog ::= message - storage ! msg - - case msg @ GetChatLog(_) => - storage forward msg - } -} - -/** - * Abstraction of chat storage holding the chat log. - */ -trait ChatStorage extends Actor - -/** - * Redis-backed chat storage implementation. - */ -class RedisChatStorage extends ChatStorage { - lifeCycle = Some(LifeCycle(Permanent)) - - private var chatLog = atomic { RedisStorage.getVector("akka.chat.log") } - - log.info("Redis-based chat storage is starting up...") - - def receive = { - case msg @ ChatMessage(from, message) => - log.debug("New chat message [%s]", message) - atomic { - chatLog + message.getBytes("UTF-8") - } - - case GetChatLog(_) => - val messageList = atomic { - chatLog.map(bytes => new String(bytes, "UTF-8")).toList - } - reply(ChatLog(messageList)) - } - - override def postRestart(reason: Throwable) = chatLog = RedisStorage.getVector("akka.chat.log") -} - -/** - * Implements user session management. - *

- * Uses self-type annotation (this: Actor =>) to declare that it needs to be mixed in with an Actor. - */ -trait SessionManagement { this: Actor => - - val storage: ChatStorage // needs someone to provide the ChatStorage - val sessions = new HashMap[String, Actor] - - protected def sessionManagement: PartialFunction[Any, Unit] = { - case Login(username) => - log.info("User [%s] has logged in", username) - val session = new Session(username, storage) - session.start - sessions += (username -> session) - - case Logout(username) => - log.info("User [%s] has logged out", username) - val session = sessions(username) - session.stop - sessions -= username - } - - protected def shutdownSessions = - sessions.foreach { case (_, session) => session.stop } -} - -/** - * Implements chat management, e.g. chat message dispatch. - *

- * Uses self-type annotation (this: Actor =>) to declare that it needs to be mixed in with an Actor. - */ -trait ChatManagement { this: Actor => - val sessions: HashMap[String, Actor] // needs someone to provide the Session map - - protected def chatManagement: PartialFunction[Any, Unit] = { - case msg @ ChatMessage(from, _) => sessions(from) ! msg - case msg @ GetChatLog(from) => sessions(from) forward msg - } -} - -/** - * Creates and links a RedisChatStorage. - */ -trait RedisChatStorageFactory { this: Actor => - val storage: ChatStorage = spawnLink(classOf[RedisChatStorage]) // starts and links ChatStorage -} - -/** - * Chat server. Manages sessions and redirects all other messages to the Session for the client. - */ -trait ChatServer extends Actor { - faultHandler = Some(OneForOneStrategy(5, 5000)) - trapExit = List(classOf[Exception]) - - val storage: ChatStorage - - log.info("Chat service is starting up...") - - // actor message handler - def receive = sessionManagement orElse chatManagement - - // abstract methods to be defined somewhere else - protected def chatManagement: PartialFunction[Any, Unit] - protected def sessionManagement: PartialFunction[Any, Unit] - protected def shutdownSessions: Unit - - override def shutdown = { - log.info("Chat server is shutting down...") - shutdownSessions - unlink(storage) - storage.stop - } -} - -/** - * Object encapsulating the full Chat Service. - */ -object ChatService extends - ChatServer with - SessionManagement with - ChatManagement with - RedisChatStorageFactory - -/** - * Test runner emulating a chat session. - */ -object Runner { - // create a handle to the remote ChatService - ChatService.makeRemote("localhost", 9999) - ChatService.start - - def run = { - val client = new ChatClient("jonas") - - client.login - - client.post("Hi there") - println("CHAT LOG:\n\t" + client.chatLog.log.mkString("\n\t")) - - client.post("Hi again") - println("CHAT LOG:\n\t" + client.chatLog.log.mkString("\n\t")) - - client.logout - } -} \ No newline at end of file diff --git a/akka-samples/akka-sample-lift/config/akka.conf b/akka-samples/akka-sample-lift/config/akka.conf deleted file mode 100644 index 4a02b208bb..0000000000 --- a/akka-samples/akka-sample-lift/config/akka.conf +++ /dev/null @@ -1,64 +0,0 @@ -##################### -# Akka Config File # -################### - -# This file has all the default settings, so all these could be removed with no visible effect. -# Modify as needed. - - - filename = "./logs/akka.log" - roll = "daily" # Options: never, hourly, daily, sunday/monday/... - level = "debug" # Options: fatal, critical, error, warning, info, debug, trace - console = on - # syslog_host = "" - # syslog_server_name = "" - - - - version = "0.7-SNAPSHOT" - - - timeout = 5000 # default timeout for future based invocations - concurrent-mode = off # if turned on, then the same actor instance is allowed to execute concurrently - - # e.g. departing from the actor model for better performance - serialize-messages = on # does a deep clone of (non-primitive) messages to ensure immutability - - - - service = on - restart-on-collision = off # (not implemented yet) if 'on' then it reschedules the transaction, - # if 'off' then throws an exception or rollback for user to handle - wait-for-completion = 100 # how long time in millis a transaction should be given time to complete when a collision is detected - wait-nr-of-times = 3 # the number of times it should check for completion of a pending transaction upon collision - distributed = off # not implemented yet - - - - service = on - hostname = "localhost" - port = 9999 - connection-timeout = 1000 # in millis - - - - service = on - hostname = "localhost" - port = 9998 - - - - system = "cassandra" # Options: cassandra (coming: terracotta, redis, tokyo-cabinet, tokyo-tyrant, voldemort, memcached, hazelcast) - - - service = on - storage-format = "java" # Options: java, scala-json, java-json - blocking = false # inserts and queries should be blocking or not - - - service = on - pidfile = "akka.pid" - - - - - diff --git a/akka-samples/akka-sample-security/src/main/resources/akka.conf b/akka-samples/akka-sample-security/src/main/resources/akka.conf deleted file mode 100644 index 60f68a64ec..0000000000 --- a/akka-samples/akka-sample-security/src/main/resources/akka.conf +++ /dev/null @@ -1,35 +0,0 @@ -#################### -# Akka Config File # -#################### - -# This file has all the default settings, so all these could be removed with no visible effect. -# Modify as needed. - - - version = "0.7-SNAPSHOT" - - boot = ["se.scalablesolutions.akka.security.samples.Boot"] # FQN to the class doing initial active object/actor - # supervisor bootstrap, should be defined in default constructor - - - filters = "se.scalablesolutions.akka.security.AkkaSecurityFilterFactory" - - # only one authenticator can be enabled for the security filter factory - authenticator = "se.scalablesolutions.akka.security.samples.BasicAuthenticationService" -# authenticator = "se.scalablesolutions.akka.security.samples.DigestAuthenticationService" -# authenticator = "se.scalablesolutions.akka.security.samples.SpnegoAuthenticationService" - -# -# -# servicePrincipal = "HTTP/localhost@EXAMPLE.COM" -# keyTabLocation = "URL to keytab" -# kerberosDebug = "true" -# realm = "EXAMPLE.COM" -# - - # service = on - # hostname = "localhost" - # port = 9998 - - - diff --git a/akka-util-java/project/build/AkkaJavaUtilProject.scala b/akka-util-java/project/build/AkkaJavaUtilProject.scala index 08308f5984..0376ff83d9 100644 --- a/akka-util-java/project/build/AkkaJavaUtilProject.scala +++ b/akka-util-java/project/build/AkkaJavaUtilProject.scala @@ -2,17 +2,16 @@ import sbt._ class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { - val akka_databinder = "DataBinder" at "http://databinder.net/repo" - val akka_configgy = "Configgy" at "http://www.lag.net/repo" - val akka_multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" - val akka_jBoss = "jBoss" at "http://repository.jboss.org/maven2" - val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" + val databinder = "DataBinder" at "http://databinder.net/repo" + val configgy = "Configgy" at "http://www.lag.net/repo" + val multiverse = "Multiverse" at "http://multiverse.googlecode.com/svn/maven-repository/releases" + val jBoss = "jBoss" at "http://repository.jboss.org/maven2" + val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/" - val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" - val proto = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" - val multi = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" - - override def packageDocsJar = defaultJarPath("-javadoc.jar") - override def packageSrcJar= defaultJarPath("-sources.jar") + val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" + val proto = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" + val multi = "org.multiverse" % "multiverse-alpha" % "0.3" % "compile" + override def packageDocsJar = defaultJarPath("-javadoc.jar") + override def packageSrcJar= defaultJarPath("-sources.jar") } diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index ca3099cee0..0595468955 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -35,8 +35,14 @@ -------------------------------------------------------------------------------*/ import sbt._ +import java.util.jar.Attributes + +class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { + // project versions + val JERSEY_VERSION = "1.1.5" + val ATMO_VERSION = "0.6-SNAPSHOT" + val CASSANDRA_VERSION = "0.5.0" -class AkkaParent(info: ProjectInfo) extends ParentProject(info) { // repos val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" val databinder = "DataBinder" at "http://databinder.net/repo" @@ -49,13 +55,8 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" val m2 = "m2" at "http://download.java.net/maven/2" - // project versions - val JERSEY_VERSION = "1.1.5" - val ATMO_VERSION = "0.6-SNAPSHOT" - val CASSANDRA_VERSION = "0.5.0" - // project defintions - lazy val akka_java_util = project("akka-util-java", "akka-java-util", new AkkaJavaUtilProject(_)) + lazy val akka_java_util = project("akka-util-java", "akka-util-java", new AkkaJavaUtilProject(_)) lazy val akka_util = project("akka-util", "akka-util", new AkkaUtilProject(_)) lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_), akka_util, akka_java_util) lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core) @@ -65,74 +66,153 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_security = project("akka-security", "akka-security", new AkkaSecurityProject(_), akka_core) lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) - lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_rest, akka_persistence, akka_cluster, akka_amqp, akka_security, akka_comet) + lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_rest, akka_persistence, akka_cluster, akka_amqp, akka_security, akka_comet, akka_patterns) // examples lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) - def akkaHome = { + def distName = "%s-%s.zip".format(name, version) + + lazy val akkaHome = { val home = System.getenv("AKKA_HOME") if (home == null) throw new Error("You need to set the $AKKA_HOME environment variable to the root of the Akka distribution") home } + lazy val deployPath = Path.fromFile(new java.io.File(akkaHome + "/deploy")) + lazy val distPath = Path.fromFile(new java.io.File(akkaHome + "/dist")) + + override def mainClass = Some("se.scalablesolutions.akka.Main") + + override def packageOptions = + manifestClassPath.map(cp => ManifestAttributes((Attributes.Name.CLASS_PATH, cp))).toList ::: + getMainClass(false).map(MainClass(_)).toList + + override def manifestClassPath = Some(allArtifacts.getFiles + .filter(_.getName.endsWith(".jar")) + .map("lib_managed/scala_%s/compile/".format(defScalaVersion.value) + _.getName) + .mkString(" ") + + " dist/akka-util_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-util-java_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-core_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-rest_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-comet_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-security_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-common_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-redis_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-cassandra_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-mongo_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-cluster-jgroups_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-cluster-shoal_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-amqp_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-patterns_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-kernel_%s-%s.jar".format(defScalaVersion.value, version) + ) + /* + override def manifestClassPath = Some(allArtifacts.getFiles + .filter(_.getName.endsWith(".jar")) + .map { jar => + println("------- " + jar) + if (jar.getName.contains("akka")) "dist/" + jar.getName + else "lib_managed/scala_2.7.7/compile/" + jar.getName + }.mkString(" ")) +*/ + def removeDupEntries(paths: PathFinder) = + Path.lazyPathFinder { + val mapped = paths.get map { p => (p.relativePath, p) } + (Map() ++ mapped).values.toList + } + + def allArtifacts = { + removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) +++ + ((outputPath ##) / defaultJarName) +++ + mainResources +++ + mainDependencies.scalaJars +++ + descendents(info.projectPath, "*.conf") +++ + descendents(info.projectPath / "dist", "*.jar") +++ + descendents(path("lib") ##, "*.jar") +++ + descendents(configurationPath(Configurations.Compile) ##, "*.jar") + } + + def deployTask(info: ProjectInfo, toDir: Path) = task { + val projectPath = info.projectPath.toString + val moduleName = projectPath.substring(projectPath.lastIndexOf('/') + 1, projectPath.length) + + // FIXME need to find out a way to grab these paths from the sbt system + val JAR_FILE_NAME = moduleName + "_%s-%s.jar".format(defScalaVersion.value, version) + val JAR_FILE_PATH = projectPath + "/target/scala_%s/".format(defScalaVersion.value) + JAR_FILE_NAME + + val from = Path.fromFile(new java.io.File(JAR_FILE_PATH)) + val to = Path.fromFile(new java.io.File(toDir + "/" + JAR_FILE_NAME)) + + log.info("Deploying " + to) + FileUtilities.copyFile(from, to, log) + } + + lazy val dist = zipTask(allArtifacts, "dist", distName) dependsOn (`package`) describedAs("Zips up the distribution.") + // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { - val sjson = "sjson.json" % "sjson" % "0.4" % "compile" - val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" - val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" + val netty = "org.jboss.netty" % "netty" % "3.2.0.BETA1" % "compile" val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" val dispatch_json = "net.databinder" % "dispatch-json_2.7.7" % "0.6.4" % "compile" - val dispatch_http = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" + val dispatch_htdisttp = "net.databinder" % "dispatch-http_2.7.7" % "0.6.4" % "compile" + val sjson = "sjson.json" % "sjson" % "0.4" % "compile" val sbinary = "sbinary" % "sbinary" % "0.3" % "compile" val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" val voldemort = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" val javautils = "org.scala-tools" % "javautils" % "2.7.4-0.1" % "compile" - val netty = "org.jboss.netty" % "netty" % "3.2.0.BETA1" % "compile" // testing val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaUtilProject(info: ProjectInfo) extends DefaultProject(info) { val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile" val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile" val configgy = "net.lag" % "configgy" % "1.4.7" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { val guicey = "org.guiceyfruit" % "guice-core" % "2.0-beta-4" % "compile" val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" val multiverse = "org.multiverse" % "multiverse-alpha" % "0.4-SNAPSHOT" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaAMQPProject(info: ProjectInfo) extends DefaultProject(info) { val rabbit = "com.rabbitmq" % "amqp-client" % "1.7.2" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaRestProject(info: ProjectInfo) extends DefaultProject(info) { - val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile" val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile" val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaCometProject(info: ProjectInfo) extends DefaultProject(info) { val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" - val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile" val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaPatternsProject(info: ProjectInfo) extends DefaultProject(info) { // testing val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaSecurityProject(info: ProjectInfo) extends DefaultProject(info) { @@ -144,21 +224,25 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" val junit = "junit" % "junit" % "4.5" % "test" val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaPersistenceCommonProject(info: ProjectInfo) extends DefaultProject(info) { val thrift = "com.facebook" % "thrift" % "1.0" % "compile" val commons_pool = "commons-pool" % "commons-pool" % "1.5.1" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaRedisProject(info: ProjectInfo) extends DefaultProject(info) { val redis = "com.redis" % "redisclient" % "1.1" % "compile" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaMongoProject(info: ProjectInfo) extends DefaultProject(info) { val mongo = "org.mongodb" % "mongo-java-driver" % "1.1" % "compile" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaCassandraProject(info: ProjectInfo) extends DefaultProject(info) { @@ -171,6 +255,7 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val slf4j_log4j = "org.slf4j" % "slf4j-log4j12" % "1.5.8" % "test" val log4j = "log4j" % "log4j" % "1.2.15" % "test" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) { @@ -182,11 +267,13 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { class AkkaJgroupsProject(info: ProjectInfo) extends DefaultProject(info) { val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaShoalProject(info: ProjectInfo) extends DefaultProject(info) { val shoal = "shoal-jxta" % "shoal" % "1.1-20090818" % "compile" val shoal_extra = "shoal-jxta" % "jxta" % "1.1-20090818" % "compile" + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } class AkkaClusterParentProject(info: ProjectInfo) extends ParentProject(info) { @@ -194,15 +281,8 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_cluster_shoal = project("akka-cluster-shoal", "akka-cluster-shoal", new AkkaShoalProject(_), akka_core) } - class AkkaKernelProject(info: ProjectInfo) extends DefaultProject(info) with AssemblyProject { - val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" - val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile" - val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile" - val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile" - - val assemblyDistPath = Path.fromFile(new java.io.File(akkaHome + "/dist/akka-" + version.toString + ".jar")) - def mainMethod = Some("se.scalablesolutions.akka.Main") - override def packageOptions: Seq[PackageOption] = MainClass("se.scalablesolutions.akka.Main") :: Nil + class AkkaKernelProject(info: ProjectInfo) extends DefaultProject(info) { + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") } // examples @@ -217,27 +297,33 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" } - - class AkkaSampleChatProject(info: ProjectInfo) extends DefaultProject(info) + class AkkaSampleChatProject(info: ProjectInfo) extends DefaultProject(info) { + lazy val dist = deployTask(info, deployPath) dependsOn(`package`) describedAs("Deploying") + } class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultProject(info) { val lift = "net.liftweb" % "lift-webkit" % "1.1-M6" % "compile" val lift_util = "net.liftweb" % "lift-util" % "1.1-M6" % "compile" - val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided" + val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile" // testing val jetty = "org.mortbay.jetty" % "jetty" % "6.1.6" % "test" val junit = "junit" % "junit" % "4.5" % "test" + lazy val dist = deployTask(info, deployPath) dependsOn(`package`) describedAs("Deploying") } - class AkkaSampleRestJavaProject(info: ProjectInfo) extends DefaultProject(info) + class AkkaSampleRestJavaProject(info: ProjectInfo) extends DefaultProject(info) { + lazy val dist = deployTask(info, deployPath) dependsOn(`package`) describedAs("Deploying") + } class AkkaSampleRestScalaProject(info: ProjectInfo) extends DefaultProject(info) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + lazy val dist = deployTask(info, deployPath) dependsOn(`package`) describedAs("Deploying") } class AkkaSampleSecurityProject(info: ProjectInfo) extends DefaultProject(info) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" + lazy val dist = deployTask(info, deployPath) dependsOn(`package`) describedAs("Deploying") } class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) { @@ -246,15 +332,12 @@ class AkkaParent(info: ProjectInfo) extends ParentProject(info) { lazy val akka_sample_rest_java = project("akka-sample-rest-java", "akka-sample-rest-java", new AkkaSampleRestJavaProject(_), akka_kernel) lazy val akka_sample_rest_scala = project("akka-sample-rest-scala", "akka-sample-rest-scala", new AkkaSampleRestScalaProject(_), akka_kernel) lazy val akka_sample_security = project("akka-sample-security", "akka-sample-security", new AkkaSampleSecurityProject(_), akka_kernel) - - //FileUtilities.copyFile(assemblyOutputPath, assemblyDistPath, log) } } trait AssemblyProject extends BasicScalaProject { - val assemblyDistPath: Path - - def assemblyExclude(base: PathFinder) = base / "META-INF" ** "*" + //def assemblyExclude(base: PathFinder) = base / "META-INF" ** "*" + def assemblyExclude(base: PathFinder) = Path.emptyPathFinder def assemblyOutputPath = outputPath / assemblyJarName def assemblyJarName = artifactID + "-assembly-" + version + ".jar" def assemblyTemporaryPath = outputPath / "assembly-libs" @@ -263,16 +346,16 @@ trait AssemblyProject extends BasicScalaProject { def assemblyPaths(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = { val (libs, directories) = classpath.get.toList.partition(ClasspathUtilities.isArchive) - for(jar <- extraJars.get ++ libs) FileUtilities.unzip(jar, tempDir, log) + val filter = new NameFilter { + def accept(name: String) = !name.endsWith("LICENSE") && !name.endsWith("MANIFEST.MF") + } + for(jar <- extraJars.get ++ libs) FileUtilities.unzip(jar, tempDir, filter, log).left.foreach(error) val base = (Path.lazyPathFinder(tempDir :: directories) ##) (descendents(base, "*") --- exclude(base)).get } - lazy val assembly = assemblyTask(assemblyTemporaryPath, assemblyClasspath, assemblyExtraJars, assemblyExclude) dependsOn(compile) describedAs("Packaging assembly") - - lazy val dist = task({ log.info("Creating distribution " + assemblyDistPath); FileUtilities.copyFile(assemblyOutputPath, assemblyDistPath, log) }) dependsOn(assembly) describedAs("Creating distribution") + lazy val assembly = assemblyTask(assemblyTemporaryPath, assemblyClasspath, assemblyExtraJars, assemblyExclude) dependsOn(compile) describedAs("Packaging assembly ") - def assemblyTask(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = { + def assemblyTask(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = packageTask(Path.lazyPathFinder(assemblyPaths(tempDir, classpath, extraJars, exclude)), assemblyOutputPath, packageOptions) - } } From 156ed2d461866bf0723bed8efc1fb6b23adf7050 Mon Sep 17 00:00:00 2001 From: "ross.mcdonald" Date: Wed, 10 Mar 2010 10:44:04 +0000 Subject: [PATCH 11/21] remove redundant method in tests --- .../src/test/scala/RedisStorageBackendSpec.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala b/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala index 8b80d88bea..09fc7fcfb7 100644 --- a/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala +++ b/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala @@ -156,9 +156,6 @@ class RedisStorageBackendSpec extends } } - describe("atomic increment in ref") { - } - describe("store and query in queue") { it("should give proper queue semantics") { enqueue("T-5", "alan kay".getBytes) From bde7563bd8bf01ae7678a451c34a83ed2301ed1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 10 Mar 2010 17:16:10 +0100 Subject: [PATCH 12/21] Finalized SBT packaging task, now Akka is fully ported to SBT --- deploy/.keep | 0 project/build/AkkaProject.scala | 176 ++++++++++++++------------------ 2 files changed, 79 insertions(+), 97 deletions(-) delete mode 100644 deploy/.keep diff --git a/deploy/.keep b/deploy/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 0595468955..82eeb92f18 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -38,12 +38,28 @@ import sbt._ import java.util.jar.Attributes class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { + + // ------------------------------------------------------------ // project versions val JERSEY_VERSION = "1.1.5" val ATMO_VERSION = "0.6-SNAPSHOT" val CASSANDRA_VERSION = "0.5.0" - // repos + // ------------------------------------------------------------ + lazy val akkaHome = { + val home = System.getenv("AKKA_HOME") + if (home == null) throw new Error("You need to set the $AKKA_HOME environment variable to the root of the Akka distribution") + home + } + lazy val deployPath = Path.fromFile(new java.io.File(akkaHome + "/deploy")) + lazy val distPath = Path.fromFile(new java.io.File(akkaHome + "/dist")) + + lazy val dist = zipTask(allArtifacts, "dist", distName) dependsOn (`package`) describedAs("Zips up the distribution.") + + def distName = "%s_%s-%s.zip".format(name, defScalaVersion.value, version) + + // ------------------------------------------------------------ + // repositories val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo" val databinder = "DataBinder" at "http://databinder.net/repo" val configgy = "Configgy" at "http://www.lag.net/repo" @@ -55,6 +71,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val google = "google" at "http://google-maven-repository.googlecode.com/svn/repository" val m2 = "m2" at "http://download.java.net/maven/2" + // ------------------------------------------------------------ // project defintions lazy val akka_java_util = project("akka-util-java", "akka-util-java", new AkkaJavaUtilProject(_)) lazy val akka_util = project("akka-util", "akka-util", new AkkaUtilProject(_)) @@ -66,92 +83,46 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_security = project("akka-security", "akka-security", new AkkaSecurityProject(_), akka_core) lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_)) lazy val akka_cluster = project("akka-cluster", "akka-cluster", new AkkaClusterParentProject(_)) - lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_rest, akka_persistence, akka_cluster, akka_amqp, akka_security, akka_comet, akka_patterns) + lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), + akka_core, akka_rest, akka_persistence, akka_cluster, akka_amqp, akka_security, akka_comet, akka_patterns) + + // functional tests in java + lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) // examples - lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) - def distName = "%s-%s.zip".format(name, version) - - lazy val akkaHome = { - val home = System.getenv("AKKA_HOME") - if (home == null) throw new Error("You need to set the $AKKA_HOME environment variable to the root of the Akka distribution") - home - } - - lazy val deployPath = Path.fromFile(new java.io.File(akkaHome + "/deploy")) - lazy val distPath = Path.fromFile(new java.io.File(akkaHome + "/dist")) - + // ------------------------------------------------------------ + // create executable jar override def mainClass = Some("se.scalablesolutions.akka.Main") override def packageOptions = manifestClassPath.map(cp => ManifestAttributes((Attributes.Name.CLASS_PATH, cp))).toList ::: getMainClass(false).map(MainClass(_)).toList - - override def manifestClassPath = Some(allArtifacts.getFiles - .filter(_.getName.endsWith(".jar")) - .map("lib_managed/scala_%s/compile/".format(defScalaVersion.value) + _.getName) - .mkString(" ") + - " dist/akka-util_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-util-java_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-core_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-rest_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-comet_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-security_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-persistence-common_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-persistence-redis_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-persistence-cassandra_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-persistence-mongo_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-cluster-jgroups_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-cluster-shoal_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-amqp_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-patterns_%s-%s.jar".format(defScalaVersion.value, version) + - " dist/akka-kernel_%s-%s.jar".format(defScalaVersion.value, version) - ) - /* + + // create a manifest with all akka jars and dependency jars on classpath override def manifestClassPath = Some(allArtifacts.getFiles .filter(_.getName.endsWith(".jar")) - .map { jar => - println("------- " + jar) - if (jar.getName.contains("akka")) "dist/" + jar.getName - else "lib_managed/scala_2.7.7/compile/" + jar.getName - }.mkString(" ")) -*/ - def removeDupEntries(paths: PathFinder) = - Path.lazyPathFinder { - val mapped = paths.get map { p => (p.relativePath, p) } - (Map() ++ mapped).values.toList - } - - def allArtifacts = { - removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) +++ - ((outputPath ##) / defaultJarName) +++ - mainResources +++ - mainDependencies.scalaJars +++ - descendents(info.projectPath, "*.conf") +++ - descendents(info.projectPath / "dist", "*.jar") +++ - descendents(path("lib") ##, "*.jar") +++ - descendents(configurationPath(Configurations.Compile) ##, "*.jar") - } - - def deployTask(info: ProjectInfo, toDir: Path) = task { - val projectPath = info.projectPath.toString - val moduleName = projectPath.substring(projectPath.lastIndexOf('/') + 1, projectPath.length) - - // FIXME need to find out a way to grab these paths from the sbt system - val JAR_FILE_NAME = moduleName + "_%s-%s.jar".format(defScalaVersion.value, version) - val JAR_FILE_PATH = projectPath + "/target/scala_%s/".format(defScalaVersion.value) + JAR_FILE_NAME - - val from = Path.fromFile(new java.io.File(JAR_FILE_PATH)) - val to = Path.fromFile(new java.io.File(toDir + "/" + JAR_FILE_NAME)) - - log.info("Deploying " + to) - FileUtilities.copyFile(from, to, log) - } - - lazy val dist = zipTask(allArtifacts, "dist", distName) dependsOn (`package`) describedAs("Zips up the distribution.") + .map("lib_managed/scala_%s/compile/".format(defScalaVersion.value) + _.getName) + .mkString(" ") + + " dist/akka-util_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-util-java_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-core_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-cluster-shoal_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-cluster-jgroups_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-rest_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-comet_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-security_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-amqp_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-patterns_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-common_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-redis_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-mongo_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-persistence-cassandra_%s-%s.jar".format(defScalaVersion.value, version) + + " dist/akka-kernel_%s-%s.jar".format(defScalaVersion.value, version) + ) + // ------------------------------------------------------------ // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { val netty = "org.jboss.netty" % "netty" % "3.2.0.BETA1" % "compile" @@ -333,29 +304,40 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_sample_rest_scala = project("akka-sample-rest-scala", "akka-sample-rest-scala", new AkkaSampleRestScalaProject(_), akka_kernel) lazy val akka_sample_security = project("akka-sample-security", "akka-sample-security", new AkkaSampleSecurityProject(_), akka_kernel) } -} -trait AssemblyProject extends BasicScalaProject { - //def assemblyExclude(base: PathFinder) = base / "META-INF" ** "*" - def assemblyExclude(base: PathFinder) = Path.emptyPathFinder - def assemblyOutputPath = outputPath / assemblyJarName - def assemblyJarName = artifactID + "-assembly-" + version + ".jar" - def assemblyTemporaryPath = outputPath / "assembly-libs" - def assemblyClasspath = runClasspath - def assemblyExtraJars = mainDependencies.scalaJars - - def assemblyPaths(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = { - val (libs, directories) = classpath.get.toList.partition(ClasspathUtilities.isArchive) - val filter = new NameFilter { - def accept(name: String) = !name.endsWith("LICENSE") && !name.endsWith("MANIFEST.MF") - } - for(jar <- extraJars.get ++ libs) FileUtilities.unzip(jar, tempDir, filter, log).left.foreach(error) - val base = (Path.lazyPathFinder(tempDir :: directories) ##) - (descendents(base, "*") --- exclude(base)).get + // ------------------------------------------------------------ + // helper functions + def removeDupEntries(paths: PathFinder) = + Path.lazyPathFinder { + val mapped = paths.get map { p => (p.relativePath, p) } + (Map() ++ mapped).values.toList } - lazy val assembly = assemblyTask(assemblyTemporaryPath, assemblyClasspath, assemblyExtraJars, assemblyExclude) dependsOn(compile) describedAs("Packaging assembly ") - - def assemblyTask(tempDir: Path, classpath: PathFinder, extraJars: PathFinder, exclude: PathFinder => PathFinder) = - packageTask(Path.lazyPathFinder(assemblyPaths(tempDir, classpath, extraJars, exclude)), assemblyOutputPath, packageOptions) + def allArtifacts = { + (removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) +++ + ((outputPath ##) / defaultJarName) +++ + mainResources +++ + mainDependencies.scalaJars +++ + descendents(info.projectPath, "*.conf") +++ + descendents(info.projectPath / "dist", "*.jar") +++ + descendents(info.projectPath / "deploy", "*.jar") +++ + descendents(path("lib") ##, "*.jar") +++ + descendents(configurationPath(Configurations.Compile) ##, "*.jar")) + .filter(jar => + !jar.toString.endsWith("scala-library-2.7.5.jar") && // remove redundant scala libs + !jar.toString.endsWith("scala-library-2.7.6.jar")) + } + + def deployTask(info: ProjectInfo, toDir: Path) = task { + val projectPath = info.projectPath.toString + val moduleName = projectPath.substring(projectPath.lastIndexOf('/') + 1, projectPath.length) + // FIXME need to find out a way to grab these paths from the sbt system + val JAR_FILE_NAME = moduleName + "_%s-%s.jar".format(defScalaVersion.value, version) + val JAR_FILE_PATH = projectPath + "/target/scala_%s/".format(defScalaVersion.value) + JAR_FILE_NAME + + val from = Path.fromFile(new java.io.File(JAR_FILE_PATH)) + val to = Path.fromFile(new java.io.File(toDir + "/" + JAR_FILE_NAME)) + log.info("Deploying " + to) + FileUtilities.copyFile(from, to, log) + } } From 79fa971af6c2a8398778c5530c28806eed9be209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 10 Mar 2010 17:24:58 +0100 Subject: [PATCH 13/21] fixed warnins in PerformanceTest --- akka-core/src/test/scala/PerformanceTest.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/akka-core/src/test/scala/PerformanceTest.scala b/akka-core/src/test/scala/PerformanceTest.scala index 778e4d45cd..43a4d46650 100644 --- a/akka-core/src/test/scala/PerformanceTest.scala +++ b/akka-core/src/test/scala/PerformanceTest.scala @@ -31,12 +31,12 @@ class PerformanceTest extends JUnitSuite { case class Meet(from: Actor, colour: Colour) case class Change(colour: Colour) - case class MeetingCount(count: int) + case class MeetingCount(count: Int) case class ExitActor(actor: Actor, reason: String) var totalTime = 0L - class Mall(var nrMeets: int, numChameneos: int) extends Actor { + class Mall(var nrMeets: Int, numChameneos: Int) extends Actor { var waitingChameneo: Option[Actor] = None var sumMeetings = 0 var numFaded = 0 @@ -86,7 +86,7 @@ class PerformanceTest extends JUnitSuite { } } - case class Chameneo(var mall: Mall, var colour: Colour, cid: int) extends Actor { + case class Chameneo(var mall: Mall, var colour: Colour, cid: Int) extends Actor { var meetings = 0 override def start = { @@ -160,10 +160,10 @@ class PerformanceTest extends JUnitSuite { case class Meet(colour: Colour) case class Change(colour: Colour) - case class MeetingCount(count: int) + case class MeetingCount(count: Int) - class Mall(var n: int, numChameneos: int) extends Actor { + class Mall(var n: Int, numChameneos: Int) extends Actor { var waitingChameneo: Option[OutputChannel[Any]] = None var startTime: Long = 0L @@ -218,7 +218,7 @@ class PerformanceTest extends JUnitSuite { } } - case class Chameneo(var mall: Mall, var colour: Colour, id: int) extends Actor { + case class Chameneo(var mall: Mall, var colour: Colour, id: Int) extends Actor { var meetings = 0 def act() { From 526a43b413249c3252fcbd913b0f9c93fdb6c298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 10 Mar 2010 17:37:47 +0100 Subject: [PATCH 14/21] Added maven artifact publishing to sbt build --- akka-core/src/main/scala/config/Config.scala | 234 ------------------ .../src/test/scala/SecuritySpec.scala | 74 ------ akka-util/src/main/scala/Config.scala | 2 +- project/build/AkkaProject.scala | 28 +++ 4 files changed, 29 insertions(+), 309 deletions(-) delete mode 100644 akka-core/src/main/scala/config/Config.scala delete mode 100644 akka-security/src/test/scala/SecuritySpec.scala diff --git a/akka-core/src/main/scala/config/Config.scala b/akka-core/src/main/scala/config/Config.scala deleted file mode 100644 index e993573972..0000000000 --- a/akka-core/src/main/scala/config/Config.scala +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.config - -import se.scalablesolutions.akka.actor.Actor -import se.scalablesolutions.akka.dispatch.MessageDispatcher - -sealed abstract class FaultHandlingStrategy -case class AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy -case class OneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy - -/** - * Configuration classes - not to be used as messages. - * - * @author Jonas Bonér - */ -object ScalaConfig { - sealed abstract class ConfigElement - - abstract class Server extends ConfigElement - abstract class FailOverScheme extends ConfigElement - abstract class Scope extends ConfigElement - - case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server - - class Supervise(val actor: Actor, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server { - val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) - } - object Supervise { - def apply(actor: Actor, lifeCycle: LifeCycle, remoteAddress: RemoteAddress) = new Supervise(actor, lifeCycle, remoteAddress) - def apply(actor: Actor, lifeCycle: LifeCycle) = new Supervise(actor, lifeCycle, null) - def unapply(supervise: Supervise) = Some((supervise.actor, supervise.lifeCycle, supervise.remoteAddress)) - } - - case class RestartStrategy( - scheme: FailOverScheme, - maxNrOfRetries: Int, - withinTimeRange: Int, - trapExceptions: List[Class[_ <: Throwable]]) extends ConfigElement - - case object AllForOne extends FailOverScheme - case object OneForOne extends FailOverScheme - - case class LifeCycle(scope: Scope, callbacks: Option[RestartCallbacks]) extends ConfigElement - object LifeCycle { - def apply(scope: Scope) = new LifeCycle(scope, None) - } - case class RestartCallbacks(preRestart: String, postRestart: String) { - if ((preRestart eq null) || (postRestart eq null)) throw new IllegalArgumentException("Restart callback methods can't be null") - } - - case object Permanent extends Scope - case object Temporary extends Scope - - case class RemoteAddress(val hostname: String, val port: Int) extends ConfigElement - - class Component(_intf: Class[_], - val target: Class[_], - val lifeCycle: LifeCycle, - val timeout: Int, - val transactionRequired: Boolean, - _dispatcher: MessageDispatcher, // optional - _remoteAddress: RemoteAddress // optional - ) extends Server { - val intf: Option[Class[_]] = if (_intf eq null) None else Some(_intf) - val dispatcher: Option[MessageDispatcher] = if (_dispatcher eq null) None else Some(_dispatcher) - val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) - } - object Component { - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - new Component(intf, target, lifeCycle, timeout, false, null, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - new Component(null, target, lifeCycle, timeout, false, null, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - new Component(intf, target, lifeCycle, timeout, false, dispatcher, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - new Component(null, target, lifeCycle, timeout, false, dispatcher, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, false, null, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, false, null, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, null, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - new Component(null, target, lifeCycle, timeout, transactionRequired, null, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - } -} - -/** - * @author Jonas Bonér - */ -object JavaConfig { - import scala.reflect.BeanProperty - - sealed abstract class ConfigElement - - class RestartStrategy( - @BeanProperty val scheme: FailOverScheme, - @BeanProperty val maxNrOfRetries: Int, - @BeanProperty val withinTimeRange: Int, - @BeanProperty val trapExceptions: Array[Class[_ <: Throwable]]) extends ConfigElement { - def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartStrategy( - scheme.transform, maxNrOfRetries, withinTimeRange, trapExceptions.toList) - } - - class LifeCycle(@BeanProperty val scope: Scope, @BeanProperty val callbacks: RestartCallbacks) extends ConfigElement { - def this(scope: Scope) = this(scope, null) - def transform = { - val callbackOption = if (callbacks eq null) None else Some(callbacks.transform) - se.scalablesolutions.akka.config.ScalaConfig.LifeCycle(scope.transform, callbackOption) - } - } - - class RestartCallbacks(@BeanProperty val preRestart: String, @BeanProperty val postRestart: String) { - def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartCallbacks(preRestart, postRestart) - } - - abstract class Scope extends ConfigElement { - def transform: se.scalablesolutions.akka.config.ScalaConfig.Scope - } - class Permanent extends Scope { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.Permanent - } - class Temporary extends Scope { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.Temporary - } - - abstract class FailOverScheme extends ConfigElement { - def transform: se.scalablesolutions.akka.config.ScalaConfig.FailOverScheme - } - class AllForOne extends FailOverScheme { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.AllForOne - } - class OneForOne extends FailOverScheme { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.OneForOne - } - - class RemoteAddress(@BeanProperty val hostname: String, @BeanProperty val port: Int) - - abstract class Server extends ConfigElement - class Component(@BeanProperty val intf: Class[_], - @BeanProperty val target: Class[_], - @BeanProperty val lifeCycle: LifeCycle, - @BeanProperty val timeout: Int, - @BeanProperty val transactionRequired: Boolean, // optional - @BeanProperty val dispatcher: MessageDispatcher, // optional - @BeanProperty val remoteAddress: RemoteAddress // optional - ) extends Server { - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - this(intf, target, lifeCycle, timeout, false, null, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - this(null, target, lifeCycle, timeout, false, null, null) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - this(intf, target, lifeCycle, timeout, false, null, remoteAddress) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, false, null, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - this(intf, target, lifeCycle, timeout, false, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - this(null, target, lifeCycle, timeout, false, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - this(intf, target, lifeCycle, timeout, transactionRequired, null, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - this(null, target, lifeCycle, timeout, transactionRequired, null, null) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - this(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - this(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - - def transform = - se.scalablesolutions.akka.config.ScalaConfig.Component( - intf, target, lifeCycle.transform, timeout, transactionRequired, dispatcher, - if (remoteAddress ne null) se.scalablesolutions.akka.config.ScalaConfig.RemoteAddress(remoteAddress.hostname, remoteAddress.port) else null) - - def newSupervised(actor: Actor) = - se.scalablesolutions.akka.config.ScalaConfig.Supervise(actor, lifeCycle.transform) - } - -} \ No newline at end of file diff --git a/akka-security/src/test/scala/SecuritySpec.scala b/akka-security/src/test/scala/SecuritySpec.scala deleted file mode 100644 index 15e84381ea..0000000000 --- a/akka-security/src/test/scala/SecuritySpec.scala +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.security - -import config.ScalaConfig._ - -import org.scalatest.Suite -import org.scalatest.junit.JUnitSuite -import org.scalatest.matchers.MustMatchers -import org.scalatest.mock.MockitoSugar -import org.mockito.Mockito._ -import org.mockito.Matchers._ -import org.junit.{Before, After, Test} - -import _root_.javax.ws.rs.core.{SecurityContext, Context, Response} -import _root_.com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} -import _root_.com.sun.jersey.core.util.Base64 - -class BasicAuthenticatorSpec extends junit.framework.TestCase - with Suite with MockitoSugar with MustMatchers { - val authenticator = new BasicAuthenticator - authenticator.start - - @Test def testChallenge = { - val req = mock[ContainerRequest] - - val result: Response = (authenticator !! (Authenticate(req, List("foo")), 10000)).get - - // the actor replies with a challenge for the browser - result.getStatus must equal(Response.Status.UNAUTHORIZED.getStatusCode) - result.getMetadata.get("WWW-Authenticate").get(0).toString must startWith("Basic") - } - - @Test def testAuthenticationSuccess = { - val req = mock[ContainerRequest] - // fake a basic auth header -> this will authenticate the user - when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar"))) - - // fake a request authorization -> this will authorize the user - when(req.isUserInRole("chef")).thenReturn(true) - - val result: AnyRef = (authenticator !! (Authenticate(req, List("chef")), 10000)).get - - result must be(OK) - // the authenticator must have set a security context - verify(req).setSecurityContext(any[SecurityContext]) - } - - @Test def testUnauthorized = { - val req = mock[ContainerRequest] - - // fake a basic auth header -> this will authenticate the user - when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar"))) - when(req.isUserInRole("chef")).thenReturn(false) // this will deny access - - val result: Response = (authenticator !! (Authenticate(req, List("chef")), 10000)).get - - result.getStatus must equal(Response.Status.FORBIDDEN.getStatusCode) - - // the authenticator must have set a security context - verify(req).setSecurityContext(any[SecurityContext]) - } - - class BasicAuthenticator extends BasicAuthenticationActor { - def verify(odc: Option[BasicCredentials]): Option[UserInfo] = odc match { - case Some(dc) => Some(UserInfo("foo", "bar", "ninja" :: "chef" :: Nil)) - case _ => None - } - override def realm = "test" - } -} - diff --git a/akka-util/src/main/scala/Config.scala b/akka-util/src/main/scala/Config.scala index f25b08ee46..10052320fd 100644 --- a/akka-util/src/main/scala/Config.scala +++ b/akka-util/src/main/scala/Config.scala @@ -4,7 +4,7 @@ package se.scalablesolutions.akka -import util.Logging +import se.scalablesolutions.akka.util.Logging import net.lag.configgy.{Configgy, ParseException} diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 82eeb92f18..abc53d1790 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -123,6 +123,34 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { ) // ------------------------------------------------------------ + // publishing + Credentials(Path.userHome / ".akka_publish_credentials", log) + override def managedStyle = ManagedStyle.Maven + + val publishTo = "Scalable Solutions Maven Repository" at "http://scalablesolutions.se/akka/repository/" + val sourceArtifact = Artifact(artifactID, "src", "jar", Some("sources"), Nil, None) + val docsArtifact = Artifact(artifactID, "docs", "jar", Some("javadoc"), Nil, None) + + override def packageDocsJar = defaultJarPath("-javadoc.jar") + override def packageSrcJar= defaultJarPath("-sources.jar") + override def packageToPublishActions = super.packageToPublishActions ++ Seq(packageDocs, packageSrc) + + override def pomExtra = + 2009 + http://akkasource.org + + Scalable Solutions AB + http://scalablesolutions.se + + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + // ------------------------------------------------------------ // subprojects class AkkaCoreProject(info: ProjectInfo) extends DefaultProject(info) { val netty = "org.jboss.netty" % "netty" % "3.2.0.BETA1" % "compile" From bb4945b0a6dc8efdb07e4882085d667a3a42a52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 10 Mar 2010 22:38:52 +0100 Subject: [PATCH 15/21] Renamed packages in the whole project to be OSGi-friendly, A LOT of breaking changes --- .../src/main/scala/JGroupsClusterActor.scala | 10 +- .../src/main/scala/ShoalClusterActor.scala | 37 +-- .../scala/AkkaClusterBroadcastFilter.scala | 8 +- .../scala/BootableCometActorService.scala | 11 +- akka-core/src/main/scala/actor/Actor.scala | 2 +- .../actor/BootableActorLoaderService.scala | 4 +- .../src/main/scala/actor/Scheduler.scala | 2 +- akka-core/src/main/scala/config/Config.scala | 272 ++++-------------- .../scala/config/ConfiguratorRepository.scala | 2 +- .../main/scala/config/SupervisionConfig.scala | 234 +++++++++++++++ .../remote/BootableRemoteActorService.scala | 4 +- akka-core/src/main/scala/remote/Cluster.scala | 36 +-- .../src/main/scala/remote/RemoteClient.scala | 2 +- .../src/main/scala/remote/RemoteServer.scala | 2 +- .../scala/serialization/Serializable.scala | 7 +- .../src/main/scala/stm/DataFlowVariable.scala | 2 +- akka-core/src/main/scala/stm/HashTrie.scala | 18 +- .../src/main/scala/stm/ResultOrFailure.scala | 4 +- .../src/main/scala/stm/Transaction.scala | 3 +- .../scala/stm/TransactionManagement.scala | 2 +- .../main/scala/stm/TransactionalState.scala | 5 +- akka-core/src/main/scala/stm/Vector.scala | 10 +- .../src/test/scala/AgentTest.scala | 0 .../ClientInitiatedRemoteActorTest.scala | 2 +- .../src/test/scala/InMemoryActorTest.scala | 2 +- .../src/test/scala/RemoteSupervisorTest.scala | 2 +- .../ServerInitiatedRemoteActorTest.scala | 2 +- akka-kernel/src/main/scala/Kernel.scala | 34 ++- akka-patterns/src/main/scala/Agent.scala | 146 ---------- akka-patterns/src/main/scala/Patterns.scala | 2 +- .../src/test/scala/ActorPatternsTest.scala | 3 +- .../src/main/scala/CassandraSession.scala | 5 +- .../src/main/scala/CassandraStorage.scala | 12 +- .../main/scala/CassandraStorageBackend.scala | 6 +- .../scala/CassandraPersistentActorSpec.scala | 2 +- .../src/main/scala/Pool.scala | 2 +- .../src/main/scala/Storage.scala | 4 +- .../src/main/scala/StorageBackend.scala | 2 +- .../src/main/scala/MongoStorage.scala | 12 +- .../src/main/scala/MongoStorageBackend.scala | 6 +- .../test/scala/MongoPersistentActorSpec.scala | 2 +- .../src/test/scala/MongoStorageSpec.scala | 2 +- .../src/main/scala/RedisStorage.scala | 14 +- .../src/main/scala/RedisStorageBackend.scala | 6 +- .../test/scala/RedisPersistentActorSpec.scala | 2 +- .../src/test/scala/RedisPersistentQSpec.scala | 2 +- .../main/scala/ActorComponentProvider.scala | 4 +- akka-rest/src/main/scala/AkkaServlet.scala | 5 +- .../src/main/scala/ChatServer.scala | 4 +- .../src/main/scala/akka/SimpleService.scala | 3 +- .../sample/java/PersistentSimpleService.java | 4 +- .../main/java/sample/java/SimpleService.java | 4 +- .../src/main/scala/SimpleService.scala | 5 +- .../src/main/scala/SecuritySpec.scala | 74 +++++ .../src/main/scala/SimpleService.scala | 2 +- akka-security/src/main/scala/Security.scala | 49 ++-- .../src/test/scala/SecuritySpec.scala | 6 +- akka-util/src/main/scala/Bootable.scala | 4 +- akka-util/src/main/scala/Config.scala | 74 ----- akka-util/src/main/scala/Helpers.scala | 1 - akka-util/src/main/scala/Logging.scala | 9 +- config/akka-reference.conf | 2 +- 62 files changed, 570 insertions(+), 629 deletions(-) rename {akka-kernel => akka-comet}/src/main/scala/BootableCometActorService.scala (92%) create mode 100644 akka-core/src/main/scala/config/SupervisionConfig.scala rename {akka-patterns => akka-core}/src/test/scala/AgentTest.scala (100%) delete mode 100644 akka-patterns/src/main/scala/Agent.scala create mode 100644 akka-samples/akka-sample-security/src/main/scala/SecuritySpec.scala delete mode 100644 akka-util/src/main/scala/Config.scala diff --git a/akka-cluster/akka-cluster-jgroups/src/main/scala/JGroupsClusterActor.scala b/akka-cluster/akka-cluster-jgroups/src/main/scala/JGroupsClusterActor.scala index 12d93ef272..7d56bb1539 100644 --- a/akka-cluster/akka-cluster-jgroups/src/main/scala/JGroupsClusterActor.scala +++ b/akka-cluster/akka-cluster-jgroups/src/main/scala/JGroupsClusterActor.scala @@ -1,15 +1,17 @@ -package se.scalablesolutions.akka.remote +package se.scalablesolutions.akka.cluster.jgroups import org.jgroups.{JChannel, View => JG_VIEW, Address, Message => JG_MSG, ExtendedMembershipListener, Receiver} +import se.scalablesolutions.akka.remote.ClusterActor._ +import se.scalablesolutions.akka.remote.BasicClusterActor + +import org.scala_tools.javautils.Imports._ + /** * Clustering support via JGroups. * @Author Viktor Klang */ class JGroupsClusterActor extends BasicClusterActor { - import ClusterActor._ - import org.scala_tools.javautils.Imports._ - type ADDR_T = Address @volatile private var isActive = false diff --git a/akka-cluster/akka-cluster-shoal/src/main/scala/ShoalClusterActor.scala b/akka-cluster/akka-cluster-shoal/src/main/scala/ShoalClusterActor.scala index 3d83a46ef3..068d3a4345 100644 --- a/akka-cluster/akka-cluster-shoal/src/main/scala/ShoalClusterActor.scala +++ b/akka-cluster/akka-cluster-shoal/src/main/scala/ShoalClusterActor.scala @@ -1,29 +1,16 @@ /** * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.remote +package se.scalablesolutions.akka.cluster.shoal -import se.scalablesolutions.akka.Config.config import java.util.Properties -import com.sun.enterprise.ee.cms.core.{CallBack, - GMSConstants, - GMSFactory, - GroupManagementService, - MessageSignal, - Signal, - GMSException, - SignalAcquireException, - SignalReleaseException, - JoinNotificationSignal, - FailureSuspectedSignal, - FailureNotificationSignal } -import com.sun.enterprise.ee.cms.impl.client.{FailureNotificationActionFactoryImpl, - FailureSuspectedActionFactoryImpl, - JoinNotificationActionFactoryImpl, - MessageActionFactoryImpl, - PlannedShutdownActionFactoryImpl -} +import se.scalablesolutions.akka.config.Config.config +import se.scalablesolutions.akka.remote.{ClusterActor, BasicClusterActor, RemoteServer} + +import com.sun.enterprise.ee.cms.core._ +import com.sun.enterprise.ee.cms.impl.client._ + /** * Clustering support via Shoal. */ @@ -67,9 +54,9 @@ class ShoalClusterActor extends BasicClusterActor { * Adds callbacks and boots up the cluster */ protected def createGMS : GroupManagementService = { - - val g = GMSFactory.startGMSModule(serverName,name, GroupManagementService.MemberType.CORE, properties()).asInstanceOf[GroupManagementService] - + val g = GMSFactory + .startGMSModule(serverName,name, GroupManagementService.MemberType.CORE, properties()) + .asInstanceOf[GroupManagementService] val callback = createCallback g.addActionFactory(new JoinNotificationActionFactoryImpl(callback)) g.addActionFactory(new FailureSuspectedActionFactoryImpl(callback)) @@ -102,8 +89,8 @@ class ShoalClusterActor extends BasicClusterActor { } signal.release() } catch { - case e : SignalAcquireException => log.warning(e,"SignalAcquireException") - case e : SignalReleaseException => log.warning(e,"SignalReleaseException") + case e : SignalAcquireException => log.warning(e,"SignalAcquireException") + case e : SignalReleaseException => log.warning(e,"SignalReleaseException") } } } diff --git a/akka-comet/src/main/scala/AkkaClusterBroadcastFilter.scala b/akka-comet/src/main/scala/AkkaClusterBroadcastFilter.scala index 724c82432e..8fdd47fddd 100644 --- a/akka-comet/src/main/scala/AkkaClusterBroadcastFilter.scala +++ b/akka-comet/src/main/scala/AkkaClusterBroadcastFilter.scala @@ -4,13 +4,13 @@ package se.scalablesolutions.akka.comet -import se.scalablesolutions.akka.actor.{Actor} -import se.scalablesolutions.akka.remote.{Cluster} -import scala.reflect.{BeanProperty} +import se.scalablesolutions.akka.actor.Actor +import se.scalablesolutions.akka.remote.Cluster +import scala.reflect.BeanProperty import org.atmosphere.cpr.{BroadcastFilter, ClusterBroadcastFilter, Broadcaster} sealed trait ClusterCometMessageType -case class ClusterCometBroadcast(val name : String, val msg : AnyRef) extends ClusterCometMessageType +case class ClusterCometBroadcast(name: String, msg: AnyRef) extends ClusterCometMessageType /** * Enables explicit clustering of Atmosphere (Comet) resources diff --git a/akka-kernel/src/main/scala/BootableCometActorService.scala b/akka-comet/src/main/scala/BootableCometActorService.scala similarity index 92% rename from akka-kernel/src/main/scala/BootableCometActorService.scala rename to akka-comet/src/main/scala/BootableCometActorService.scala index b014fcb9ad..f6895aeee9 100644 --- a/akka-kernel/src/main/scala/BootableCometActorService.scala +++ b/akka-comet/src/main/scala/BootableCometActorService.scala @@ -2,16 +2,16 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka +package se.scalablesolutions.akka.comet import com.sun.grizzly.http.SelectorThread import com.sun.grizzly.http.servlet.ServletAdapter import com.sun.grizzly.standalone.StaticStreamAlgorithm import javax.ws.rs.core.UriBuilder -import se.scalablesolutions.akka.comet.AkkaServlet + import se.scalablesolutions.akka.actor.BootableActorLoaderService -import se.scalablesolutions.akka.util.{Bootable,Logging} +import se.scalablesolutions.akka.util.{Bootable, Logging} /** * Handles the Akka Comet Support (load/unload) @@ -19,16 +19,17 @@ import se.scalablesolutions.akka.util.{Bootable,Logging} trait BootableCometActorService extends Bootable with Logging { self : BootableActorLoaderService => - import Config._ + import config.Config._ val REST_HOSTNAME = config.getString("akka.rest.hostname", "localhost") val REST_URL = "http://" + REST_HOSTNAME val REST_PORT = config.getInt("akka.rest.port", 9998) + protected var jerseySelectorThread: Option[SelectorThread] = None abstract override def onLoad = { super.onLoad - if(config.getBool("akka.rest.service", true)){ + if (config.getBool("akka.rest.service", true)) { val uri = UriBuilder.fromUri(REST_URL).port(REST_PORT).build() diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index 60f3967e6c..5f48f1cc1e 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -4,8 +4,8 @@ package se.scalablesolutions.akka.actor -import se.scalablesolutions.akka.Config._ import se.scalablesolutions.akka.dispatch._ +import se.scalablesolutions.akka.config.Config._ import se.scalablesolutions.akka.config.{AllForOneStrategy, OneForOneStrategy, FaultHandlingStrategy} import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.stm.Transaction._ diff --git a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala index 60f6ec3781..d6e87ef027 100644 --- a/akka-core/src/main/scala/actor/BootableActorLoaderService.scala +++ b/akka-core/src/main/scala/actor/BootableActorLoaderService.scala @@ -7,8 +7,8 @@ package se.scalablesolutions.akka.actor import java.io.File import java.net.URLClassLoader -import se.scalablesolutions.akka.util.{Bootable,Logging} -import se.scalablesolutions.akka.Config._ +import se.scalablesolutions.akka.util.{Bootable, Logging} +import se.scalablesolutions.akka.config.Config._ /** * Handles all modules in the deploy directory (load and unload) diff --git a/akka-core/src/main/scala/actor/Scheduler.scala b/akka-core/src/main/scala/actor/Scheduler.scala index 8205db5843..be23149b61 100644 --- a/akka-core/src/main/scala/actor/Scheduler.scala +++ b/akka-core/src/main/scala/actor/Scheduler.scala @@ -17,7 +17,7 @@ import java.util.concurrent._ import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.config.{AllForOneStrategy, OneForOneStrategy, FaultHandlingStrategy} -import se.scalablesolutions.akka.util.{Logging} +import se.scalablesolutions.akka.util.Logging import org.scala_tools.javautils.Imports._ diff --git a/akka-core/src/main/scala/config/Config.scala b/akka-core/src/main/scala/config/Config.scala index e993573972..ecbdf33d81 100644 --- a/akka-core/src/main/scala/config/Config.scala +++ b/akka-core/src/main/scala/config/Config.scala @@ -4,231 +4,71 @@ package se.scalablesolutions.akka.config -import se.scalablesolutions.akka.actor.Actor -import se.scalablesolutions.akka.dispatch.MessageDispatcher +import se.scalablesolutions.akka.util.Logging -sealed abstract class FaultHandlingStrategy -case class AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy -case class OneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy - -/** - * Configuration classes - not to be used as messages. - * - * @author Jonas Bonér - */ -object ScalaConfig { - sealed abstract class ConfigElement - - abstract class Server extends ConfigElement - abstract class FailOverScheme extends ConfigElement - abstract class Scope extends ConfigElement - - case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server - - class Supervise(val actor: Actor, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server { - val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) - } - object Supervise { - def apply(actor: Actor, lifeCycle: LifeCycle, remoteAddress: RemoteAddress) = new Supervise(actor, lifeCycle, remoteAddress) - def apply(actor: Actor, lifeCycle: LifeCycle) = new Supervise(actor, lifeCycle, null) - def unapply(supervise: Supervise) = Some((supervise.actor, supervise.lifeCycle, supervise.remoteAddress)) - } - - case class RestartStrategy( - scheme: FailOverScheme, - maxNrOfRetries: Int, - withinTimeRange: Int, - trapExceptions: List[Class[_ <: Throwable]]) extends ConfigElement - - case object AllForOne extends FailOverScheme - case object OneForOne extends FailOverScheme - - case class LifeCycle(scope: Scope, callbacks: Option[RestartCallbacks]) extends ConfigElement - object LifeCycle { - def apply(scope: Scope) = new LifeCycle(scope, None) - } - case class RestartCallbacks(preRestart: String, postRestart: String) { - if ((preRestart eq null) || (postRestart eq null)) throw new IllegalArgumentException("Restart callback methods can't be null") - } - - case object Permanent extends Scope - case object Temporary extends Scope - - case class RemoteAddress(val hostname: String, val port: Int) extends ConfigElement - - class Component(_intf: Class[_], - val target: Class[_], - val lifeCycle: LifeCycle, - val timeout: Int, - val transactionRequired: Boolean, - _dispatcher: MessageDispatcher, // optional - _remoteAddress: RemoteAddress // optional - ) extends Server { - val intf: Option[Class[_]] = if (_intf eq null) None else Some(_intf) - val dispatcher: Option[MessageDispatcher] = if (_dispatcher eq null) None else Some(_dispatcher) - val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) - } - object Component { - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - new Component(intf, target, lifeCycle, timeout, false, null, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - new Component(null, target, lifeCycle, timeout, false, null, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - new Component(intf, target, lifeCycle, timeout, false, dispatcher, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - new Component(null, target, lifeCycle, timeout, false, dispatcher, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, false, null, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, false, null, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, null, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - new Component(null, target, lifeCycle, timeout, transactionRequired, null, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - - def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - } -} +import net.lag.configgy.{Configgy, ParseException} /** * @author Jonas Bonér */ -object JavaConfig { - import scala.reflect.BeanProperty +object Config extends Logging { + val VERSION = "0.7-SNAPSHOT" - sealed abstract class ConfigElement + // Set Multiverse options for max speed + System.setProperty("org.multiverse.MuliverseConstants.sanityChecks", "false") + System.setProperty("org.multiverse.api.GlobalStmInstance.factorymethod", "org.multiverse.stms.alpha.AlphaStm.createFast") - class RestartStrategy( - @BeanProperty val scheme: FailOverScheme, - @BeanProperty val maxNrOfRetries: Int, - @BeanProperty val withinTimeRange: Int, - @BeanProperty val trapExceptions: Array[Class[_ <: Throwable]]) extends ConfigElement { - def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartStrategy( - scheme.transform, maxNrOfRetries, withinTimeRange, trapExceptions.toList) + val HOME = { + val systemHome = System.getenv("AKKA_HOME") + if (systemHome == null || systemHome.length == 0 || systemHome == ".") { + val optionHome = System.getProperty("akka.home", "") + if (optionHome.length != 0) Some(optionHome) + else None + } else Some(systemHome) } - - class LifeCycle(@BeanProperty val scope: Scope, @BeanProperty val callbacks: RestartCallbacks) extends ConfigElement { - def this(scope: Scope) = this(scope, null) - def transform = { - val callbackOption = if (callbacks eq null) None else Some(callbacks.transform) - se.scalablesolutions.akka.config.ScalaConfig.LifeCycle(scope.transform, callbackOption) + + val config = { + if (HOME.isDefined) { + try { + val configFile = HOME.get + "/config/akka.conf" + Configgy.configure(configFile) + log.info("AKKA_HOME is defined to [%s], config loaded from [%s].", HOME.get, configFile) + } catch { + case e: ParseException => throw new IllegalStateException( + "'akka.conf' config file can not be found in [" + HOME + "/config/akka.conf] aborting." + + "\n\tEither add it in the 'config' directory or add it to the classpath.") + } + } else if (System.getProperty("akka.config", "") != "") { + val configFile = System.getProperty("akka.config", "") + try { + Configgy.configure(configFile) + log.info("Config loaded from -Dakka.config=%s", configFile) + } catch { + case e: ParseException => throw new IllegalStateException( + "Config could not be loaded from -Dakka.config=" + configFile) + } + } else { + try { + Configgy.configureFromResource("akka.conf", getClass.getClassLoader) + log.info("Config loaded from the application classpath.") + } catch { + case e: ParseException => throw new IllegalStateException( + "\nCan't find 'akka.conf' configuration file." + + "\nOne of the three ways of locating the 'akka.conf' file needs to be defined:" + + "\n\t1. Define 'AKKA_HOME' environment variable to the root of the Akka distribution." + + "\n\t2. Define the '-Dakka.config=...' system property option." + + "\n\t3. Put the 'akka.conf' file on the classpath." + + "\nI have no way of finding the 'akka.conf' configuration file." + + "\nAborting.") + } } + Configgy.config } - class RestartCallbacks(@BeanProperty val preRestart: String, @BeanProperty val postRestart: String) { - def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartCallbacks(preRestart, postRestart) - } + val CONFIG_VERSION = config.getString("akka.version", "0") + if (VERSION != CONFIG_VERSION) throw new IllegalStateException( + "Akka JAR version [" + VERSION + "] is different than the provided config ('akka.conf') version [" + CONFIG_VERSION + "]") + val startTime = System.currentTimeMillis - abstract class Scope extends ConfigElement { - def transform: se.scalablesolutions.akka.config.ScalaConfig.Scope - } - class Permanent extends Scope { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.Permanent - } - class Temporary extends Scope { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.Temporary - } - - abstract class FailOverScheme extends ConfigElement { - def transform: se.scalablesolutions.akka.config.ScalaConfig.FailOverScheme - } - class AllForOne extends FailOverScheme { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.AllForOne - } - class OneForOne extends FailOverScheme { - override def transform = se.scalablesolutions.akka.config.ScalaConfig.OneForOne - } - - class RemoteAddress(@BeanProperty val hostname: String, @BeanProperty val port: Int) - - abstract class Server extends ConfigElement - class Component(@BeanProperty val intf: Class[_], - @BeanProperty val target: Class[_], - @BeanProperty val lifeCycle: LifeCycle, - @BeanProperty val timeout: Int, - @BeanProperty val transactionRequired: Boolean, // optional - @BeanProperty val dispatcher: MessageDispatcher, // optional - @BeanProperty val remoteAddress: RemoteAddress // optional - ) extends Server { - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - this(intf, target, lifeCycle, timeout, false, null, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = - this(null, target, lifeCycle, timeout, false, null, null) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - this(intf, target, lifeCycle, timeout, false, null, remoteAddress) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, false, null, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - this(intf, target, lifeCycle, timeout, false, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = - this(null, target, lifeCycle, timeout, false, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - this(intf, target, lifeCycle, timeout, transactionRequired, null, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = - this(null, target, lifeCycle, timeout, transactionRequired, null, null) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - this(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) - - def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - this(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = - this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) - - def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = - this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) - - def transform = - se.scalablesolutions.akka.config.ScalaConfig.Component( - intf, target, lifeCycle.transform, timeout, transactionRequired, dispatcher, - if (remoteAddress ne null) se.scalablesolutions.akka.config.ScalaConfig.RemoteAddress(remoteAddress.hostname, remoteAddress.port) else null) - - def newSupervised(actor: Actor) = - se.scalablesolutions.akka.config.ScalaConfig.Supervise(actor, lifeCycle.transform) - } - -} \ No newline at end of file + def uptime = (System.currentTimeMillis - startTime) / 1000 +} diff --git a/akka-core/src/main/scala/config/ConfiguratorRepository.scala b/akka-core/src/main/scala/config/ConfiguratorRepository.scala index 9c12bf4b32..097259164b 100644 --- a/akka-core/src/main/scala/config/ConfiguratorRepository.scala +++ b/akka-core/src/main/scala/config/ConfiguratorRepository.scala @@ -6,7 +6,7 @@ package se.scalablesolutions.akka.config import scala.collection.mutable.HashSet -import util.Logging +import se.scalablesolutions.akka.util.Logging object ConfiguratorRepository extends Logging { diff --git a/akka-core/src/main/scala/config/SupervisionConfig.scala b/akka-core/src/main/scala/config/SupervisionConfig.scala new file mode 100644 index 0000000000..e993573972 --- /dev/null +++ b/akka-core/src/main/scala/config/SupervisionConfig.scala @@ -0,0 +1,234 @@ +/** + * Copyright (C) 2009-2010 Scalable Solutions AB + */ + +package se.scalablesolutions.akka.config + +import se.scalablesolutions.akka.actor.Actor +import se.scalablesolutions.akka.dispatch.MessageDispatcher + +sealed abstract class FaultHandlingStrategy +case class AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy +case class OneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends FaultHandlingStrategy + +/** + * Configuration classes - not to be used as messages. + * + * @author Jonas Bonér + */ +object ScalaConfig { + sealed abstract class ConfigElement + + abstract class Server extends ConfigElement + abstract class FailOverScheme extends ConfigElement + abstract class Scope extends ConfigElement + + case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server + + class Supervise(val actor: Actor, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server { + val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) + } + object Supervise { + def apply(actor: Actor, lifeCycle: LifeCycle, remoteAddress: RemoteAddress) = new Supervise(actor, lifeCycle, remoteAddress) + def apply(actor: Actor, lifeCycle: LifeCycle) = new Supervise(actor, lifeCycle, null) + def unapply(supervise: Supervise) = Some((supervise.actor, supervise.lifeCycle, supervise.remoteAddress)) + } + + case class RestartStrategy( + scheme: FailOverScheme, + maxNrOfRetries: Int, + withinTimeRange: Int, + trapExceptions: List[Class[_ <: Throwable]]) extends ConfigElement + + case object AllForOne extends FailOverScheme + case object OneForOne extends FailOverScheme + + case class LifeCycle(scope: Scope, callbacks: Option[RestartCallbacks]) extends ConfigElement + object LifeCycle { + def apply(scope: Scope) = new LifeCycle(scope, None) + } + case class RestartCallbacks(preRestart: String, postRestart: String) { + if ((preRestart eq null) || (postRestart eq null)) throw new IllegalArgumentException("Restart callback methods can't be null") + } + + case object Permanent extends Scope + case object Temporary extends Scope + + case class RemoteAddress(val hostname: String, val port: Int) extends ConfigElement + + class Component(_intf: Class[_], + val target: Class[_], + val lifeCycle: LifeCycle, + val timeout: Int, + val transactionRequired: Boolean, + _dispatcher: MessageDispatcher, // optional + _remoteAddress: RemoteAddress // optional + ) extends Server { + val intf: Option[Class[_]] = if (_intf eq null) None else Some(_intf) + val dispatcher: Option[MessageDispatcher] = if (_dispatcher eq null) None else Some(_dispatcher) + val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress) + } + object Component { + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = + new Component(intf, target, lifeCycle, timeout, false, null, null) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = + new Component(null, target, lifeCycle, timeout, false, null, null) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = + new Component(intf, target, lifeCycle, timeout, false, dispatcher, null) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = + new Component(null, target, lifeCycle, timeout, false, dispatcher, null) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = + new Component(intf, target, lifeCycle, timeout, false, null, remoteAddress) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = + new Component(null, target, lifeCycle, timeout, false, null, remoteAddress) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + new Component(intf, target, lifeCycle, timeout, false, dispatcher, remoteAddress) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + new Component(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = + new Component(intf, target, lifeCycle, timeout, transactionRequired, null, null) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = + new Component(null, target, lifeCycle, timeout, transactionRequired, null, null) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = + new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = + new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = + new Component(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = + new Component(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) + + def apply(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + new Component(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) + + def apply(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + new Component(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) + } +} + +/** + * @author Jonas Bonér + */ +object JavaConfig { + import scala.reflect.BeanProperty + + sealed abstract class ConfigElement + + class RestartStrategy( + @BeanProperty val scheme: FailOverScheme, + @BeanProperty val maxNrOfRetries: Int, + @BeanProperty val withinTimeRange: Int, + @BeanProperty val trapExceptions: Array[Class[_ <: Throwable]]) extends ConfigElement { + def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartStrategy( + scheme.transform, maxNrOfRetries, withinTimeRange, trapExceptions.toList) + } + + class LifeCycle(@BeanProperty val scope: Scope, @BeanProperty val callbacks: RestartCallbacks) extends ConfigElement { + def this(scope: Scope) = this(scope, null) + def transform = { + val callbackOption = if (callbacks eq null) None else Some(callbacks.transform) + se.scalablesolutions.akka.config.ScalaConfig.LifeCycle(scope.transform, callbackOption) + } + } + + class RestartCallbacks(@BeanProperty val preRestart: String, @BeanProperty val postRestart: String) { + def transform = se.scalablesolutions.akka.config.ScalaConfig.RestartCallbacks(preRestart, postRestart) + } + + abstract class Scope extends ConfigElement { + def transform: se.scalablesolutions.akka.config.ScalaConfig.Scope + } + class Permanent extends Scope { + override def transform = se.scalablesolutions.akka.config.ScalaConfig.Permanent + } + class Temporary extends Scope { + override def transform = se.scalablesolutions.akka.config.ScalaConfig.Temporary + } + + abstract class FailOverScheme extends ConfigElement { + def transform: se.scalablesolutions.akka.config.ScalaConfig.FailOverScheme + } + class AllForOne extends FailOverScheme { + override def transform = se.scalablesolutions.akka.config.ScalaConfig.AllForOne + } + class OneForOne extends FailOverScheme { + override def transform = se.scalablesolutions.akka.config.ScalaConfig.OneForOne + } + + class RemoteAddress(@BeanProperty val hostname: String, @BeanProperty val port: Int) + + abstract class Server extends ConfigElement + class Component(@BeanProperty val intf: Class[_], + @BeanProperty val target: Class[_], + @BeanProperty val lifeCycle: LifeCycle, + @BeanProperty val timeout: Int, + @BeanProperty val transactionRequired: Boolean, // optional + @BeanProperty val dispatcher: MessageDispatcher, // optional + @BeanProperty val remoteAddress: RemoteAddress // optional + ) extends Server { + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int) = + this(intf, target, lifeCycle, timeout, false, null, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int) = + this(null, target, lifeCycle, timeout, false, null, null) + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = + this(intf, target, lifeCycle, timeout, false, null, remoteAddress) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, remoteAddress: RemoteAddress) = + this(null, target, lifeCycle, timeout, false, null, remoteAddress) + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = + this(intf, target, lifeCycle, timeout, false, dispatcher, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher) = + this(null, target, lifeCycle, timeout, false, dispatcher, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + this(null, target, lifeCycle, timeout, false, dispatcher, remoteAddress) + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = + this(intf, target, lifeCycle, timeout, transactionRequired, null, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean) = + this(null, target, lifeCycle, timeout, transactionRequired, null, null) + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = + this(intf, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, remoteAddress: RemoteAddress) = + this(null, target, lifeCycle, timeout, transactionRequired, null, remoteAddress) + + def this(intf: Class[_], target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = + this(intf, target, lifeCycle, timeout, transactionRequired, dispatcher, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher) = + this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, null) + + def this(target: Class[_], lifeCycle: LifeCycle, timeout: Int, transactionRequired: Boolean, dispatcher: MessageDispatcher, remoteAddress: RemoteAddress) = + this(null, target, lifeCycle, timeout, transactionRequired, dispatcher, remoteAddress) + + def transform = + se.scalablesolutions.akka.config.ScalaConfig.Component( + intf, target, lifeCycle.transform, timeout, transactionRequired, dispatcher, + if (remoteAddress ne null) se.scalablesolutions.akka.config.ScalaConfig.RemoteAddress(remoteAddress.hostname, remoteAddress.port) else null) + + def newSupervised(actor: Actor) = + se.scalablesolutions.akka.config.ScalaConfig.Supervise(actor, lifeCycle.transform) + } + +} \ No newline at end of file diff --git a/akka-core/src/main/scala/remote/BootableRemoteActorService.scala b/akka-core/src/main/scala/remote/BootableRemoteActorService.scala index 6c3183ef8c..2b8c2aa132 100644 --- a/akka-core/src/main/scala/remote/BootableRemoteActorService.scala +++ b/akka-core/src/main/scala/remote/BootableRemoteActorService.scala @@ -5,8 +5,8 @@ package se.scalablesolutions.akka.remote import se.scalablesolutions.akka.actor.BootableActorLoaderService -import se.scalablesolutions.akka.util.{Bootable,Logging} -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.util.{Bootable, Logging} +import se.scalablesolutions.akka.config.Config.config /** * This bundle/service is responsible for booting up and shutting down the remote actors facility diff --git a/akka-core/src/main/scala/remote/Cluster.scala b/akka-core/src/main/scala/remote/Cluster.scala index fb14b6b357..145b07462f 100644 --- a/akka-core/src/main/scala/remote/Cluster.scala +++ b/akka-core/src/main/scala/remote/Cluster.scala @@ -4,7 +4,7 @@ package se.scalablesolutions.akka.remote -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.serialization.Serializer import se.scalablesolutions.akka.actor.{Supervisor, SupervisorFactory, Actor, ActorRegistry} @@ -44,20 +44,20 @@ trait ClusterActor extends Actor with Cluster { * * @author Viktor Klang */ -private[remote] object ClusterActor { +private[akka] object ClusterActor { sealed trait ClusterMessage - private[remote] case class RelayedMessage(actorClassFQN: String, msg: AnyRef) extends ClusterMessage - private[remote] case class Message[ADDR_T](sender: ADDR_T, msg: Array[Byte]) - private[remote] case object PapersPlease extends ClusterMessage - private[remote] case class Papers(addresses: List[RemoteAddress]) extends ClusterMessage - private[remote] case object Block extends ClusterMessage - private[remote] case object Unblock extends ClusterMessage - private[remote] case class View[ADDR_T](othersPresent: Set[ADDR_T]) extends ClusterMessage - private[remote] case class Zombie[ADDR_T](address: ADDR_T) extends ClusterMessage - private[remote] case class RegisterLocalNode(server: RemoteAddress) extends ClusterMessage - private[remote] case class DeregisterLocalNode(server: RemoteAddress) extends ClusterMessage - private[remote] case class Node(endpoints: List[RemoteAddress]) + private[akka] case class RelayedMessage(actorClassFQN: String, msg: AnyRef) extends ClusterMessage + private[akka] case class Message[ADDR_T](sender: ADDR_T, msg: Array[Byte]) + private[akka] case object PapersPlease extends ClusterMessage + private[akka] case class Papers(addresses: List[RemoteAddress]) extends ClusterMessage + private[akka] case object Block extends ClusterMessage + private[akka] case object Unblock extends ClusterMessage + private[akka] case class View[ADDR_T](othersPresent: Set[ADDR_T]) extends ClusterMessage + private[akka] case class Zombie[ADDR_T](address: ADDR_T) extends ClusterMessage + private[akka] case class RegisterLocalNode(server: RemoteAddress) extends ClusterMessage + private[akka] case class DeregisterLocalNode(server: RemoteAddress) extends ClusterMessage + private[akka] case class Node(endpoints: List[RemoteAddress]) } /** @@ -205,16 +205,16 @@ abstract class BasicClusterActor extends ClusterActor { object Cluster extends Cluster with Logging { lazy val DEFAULT_SERIALIZER_CLASS_NAME = Serializer.Java.getClass.getName - @volatile private[remote] var clusterActor: Option[ClusterActor] = None + @volatile private[akka] var clusterActor: Option[ClusterActor] = None // FIXME Use the supervisor member field - @volatile private[remote] var supervisor: Option[Supervisor] = None + @volatile private[akka] var supervisor: Option[Supervisor] = None - private[remote] lazy val serializer: Serializer = + private[akka] lazy val serializer: Serializer = Class.forName(config.getString("akka.remote.cluster.serializer", DEFAULT_SERIALIZER_CLASS_NAME)) .newInstance.asInstanceOf[Serializer] - private[remote] def createClusterActor: Option[ClusterActor] = { + private[akka] def createClusterActor: Option[ClusterActor] = { val name = config.getString("akka.remote.cluster.actor") if (name.isEmpty) throw new IllegalArgumentException( "Can't start cluster since the 'akka.remote.cluster.actor' configuration option is not defined") @@ -229,7 +229,7 @@ object Cluster extends Cluster with Logging { } } - private[remote] def createSupervisor(actor: ClusterActor): Option[Supervisor] = { + private[akka] def createSupervisor(actor: ClusterActor): Option[Supervisor] = { val sup = SupervisorFactory( SupervisorConfig( RestartStrategy(OneForOne, 5, 1000, List(classOf[Exception])), diff --git a/akka-core/src/main/scala/remote/RemoteClient.scala b/akka-core/src/main/scala/remote/RemoteClient.scala index 0887ebcd82..ec3d837c01 100644 --- a/akka-core/src/main/scala/remote/RemoteClient.scala +++ b/akka-core/src/main/scala/remote/RemoteClient.scala @@ -8,7 +8,7 @@ import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteRequest, import se.scalablesolutions.akka.actor.{Exit, Actor} import se.scalablesolutions.akka.dispatch.{DefaultCompletableFuture, CompletableFuture} import se.scalablesolutions.akka.util.{UUID, Logging} -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import org.jboss.netty.channel._ import group.DefaultChannelGroup diff --git a/akka-core/src/main/scala/remote/RemoteServer.scala b/akka-core/src/main/scala/remote/RemoteServer.scala index 02cf98bcd2..bcd6b55494 100644 --- a/akka-core/src/main/scala/remote/RemoteServer.scala +++ b/akka-core/src/main/scala/remote/RemoteServer.scala @@ -12,7 +12,7 @@ import java.util.{Map => JMap} import se.scalablesolutions.akka.actor._ import se.scalablesolutions.akka.util._ import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteReply, RemoteRequest} -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import org.jboss.netty.bootstrap.ServerBootstrap import org.jboss.netty.channel._ diff --git a/akka-core/src/main/scala/serialization/Serializable.scala b/akka-core/src/main/scala/serialization/Serializable.scala index b9a3cf5927..b5998cfb2e 100644 --- a/akka-core/src/main/scala/serialization/Serializable.scala +++ b/akka-core/src/main/scala/serialization/Serializable.scala @@ -5,10 +5,15 @@ package se.scalablesolutions.akka.serialization import org.codehaus.jackson.map.ObjectMapper + import com.google.protobuf.Message -import reflect.Manifest + +import scala.reflect.Manifest + import sbinary.DefaultProtocol + import java.io.{StringWriter, ByteArrayOutputStream, ObjectOutputStream} + import sjson.json.{Serializer=>SJSONSerializer} object SerializationProtocol { diff --git a/akka-core/src/main/scala/stm/DataFlowVariable.scala b/akka-core/src/main/scala/stm/DataFlowVariable.scala index daed4ec55f..cb1b828db1 100644 --- a/akka-core/src/main/scala/stm/DataFlowVariable.scala +++ b/akka-core/src/main/scala/stm/DataFlowVariable.scala @@ -2,7 +2,7 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.stm import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.{ConcurrentLinkedQueue, LinkedBlockingQueue} diff --git a/akka-core/src/main/scala/stm/HashTrie.scala b/akka-core/src/main/scala/stm/HashTrie.scala index 02b7ad2145..fcb35baff3 100644 --- a/akka-core/src/main/scala/stm/HashTrie.scala +++ b/akka-core/src/main/scala/stm/HashTrie.scala @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. **/ -package se.scalablesolutions.akka.collection +package se.scalablesolutions.akka.stm trait PersistentDataStructure @@ -77,7 +77,7 @@ object HashTrie { // nodes @serializable -private[collection] sealed trait Node[K, +V] { +private[stm] sealed trait Node[K, +V] { val size: Int def apply(key: K, hash: Int): Option[V] @@ -90,7 +90,7 @@ private[collection] sealed trait Node[K, +V] { } @serializable -private[collection] class EmptyNode[K] extends Node[K, Nothing] { +private[stm] class EmptyNode[K] extends Node[K, Nothing] { val size = 0 def apply(key: K, hash: Int) = None @@ -106,12 +106,12 @@ private[collection] class EmptyNode[K] extends Node[K, Nothing] { } } -private[collection] abstract class SingleNode[K, +V] extends Node[K, V] { +private[stm] abstract class SingleNode[K, +V] extends Node[K, V] { val hash: Int } -private[collection] class LeafNode[K, +V](key: K, val hash: Int, value: V) extends SingleNode[K, V] { +private[stm] class LeafNode[K, +V](key: K, val hash: Int, value: V) extends SingleNode[K, V] { val size = 1 def apply(key: K, hash: Int) = if (this.key == key) Some(value) else None @@ -141,7 +141,7 @@ private[collection] class LeafNode[K, +V](key: K, val hash: Int, value: V) exten } -private[collection] class CollisionNode[K, +V](val hash: Int, bucket: List[(K, V)]) extends SingleNode[K, V] { +private[stm] class CollisionNode[K, +V](val hash: Int, bucket: List[(K, V)]) extends SingleNode[K, V] { lazy val size = bucket.length def this(hash: Int, pairs: (K, V)*) = this(hash, pairs.toList) @@ -185,7 +185,7 @@ private[collection] class CollisionNode[K, +V](val hash: Int, bucket: List[(K, V override def toString = "CollisionNode(" + bucket.toString + ")" } -private[collection] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, V]], bits: Int) extends Node[K, V] { +private[stm] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, V]], bits: Int) extends Node[K, V] { lazy val size = { val sizes = for { n <- table @@ -284,7 +284,7 @@ private[collection] class BitmappedNode[K, +V](shift: Int)(table: Array[Node[K, } -private[collection] object BitmappedNode { +private[stm] object BitmappedNode { def apply[K, V](shift: Int)(node: SingleNode[K, V], key: K, hash: Int, value: V) = { val table = new Array[Node[K, V]](Math.max((hash >>> shift) & 0x01f, (node.hash >>> shift) & 0x01f) + 1) @@ -312,7 +312,7 @@ private[collection] object BitmappedNode { } -private[collection] class FullNode[K, +V](shift: Int)(table: Array[Node[K, V]]) extends Node[K, V] { +private[stm] class FullNode[K, +V](shift: Int)(table: Array[Node[K, V]]) extends Node[K, V] { lazy val size = table.foldLeft(0) { _ + _.size } def apply(key: K, hash: Int) = table((hash >>> shift) & 0x01f)(key, hash) diff --git a/akka-core/src/main/scala/stm/ResultOrFailure.scala b/akka-core/src/main/scala/stm/ResultOrFailure.scala index 51ce6ddf68..ced5572104 100644 --- a/akka-core/src/main/scala/stm/ResultOrFailure.scala +++ b/akka-core/src/main/scala/stm/ResultOrFailure.scala @@ -2,9 +2,7 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.util - -import stm.Transaction +package se.scalablesolutions.akka.stm /** * Reference that can hold either a typed value or an exception. diff --git a/akka-core/src/main/scala/stm/Transaction.scala b/akka-core/src/main/scala/stm/Transaction.scala index 133c292a6f..a7184e969d 100644 --- a/akka-core/src/main/scala/stm/Transaction.scala +++ b/akka-core/src/main/scala/stm/Transaction.scala @@ -6,10 +6,10 @@ package se.scalablesolutions.akka.stm import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicInteger +import java.util.concurrent.TimeUnit import scala.collection.mutable.HashMap -import se.scalablesolutions.akka.state.Committable import se.scalablesolutions.akka.util.Logging import org.multiverse.api.{Transaction => MultiverseTransaction} @@ -18,7 +18,6 @@ import org.multiverse.api.ThreadLocalTransaction._ import org.multiverse.templates.{TransactionTemplate, OrElseTemplate} import org.multiverse.utils.backoff.ExponentialBackoffPolicy import org.multiverse.stms.alpha.AlphaStm -import java.util.concurrent.TimeUnit class NoTransactionInScopeException extends RuntimeException class TransactionRetryException(message: String) extends RuntimeException(message) diff --git a/akka-core/src/main/scala/stm/TransactionManagement.scala b/akka-core/src/main/scala/stm/TransactionManagement.scala index 60a6ae6de3..96742b9363 100644 --- a/akka-core/src/main/scala/stm/TransactionManagement.scala +++ b/akka-core/src/main/scala/stm/TransactionManagement.scala @@ -18,7 +18,7 @@ class TransactionAwareWrapperException(val cause: Throwable, val tx: Option[Tran } object TransactionManagement extends TransactionManagement { - import se.scalablesolutions.akka.Config._ + import se.scalablesolutions.akka.config.Config._ val TRANSACTION_ENABLED = new AtomicBoolean(config.getBool("akka.stm.service", false)) val FAIR_TRANSACTIONS = config.getBool("akka.stm.fair", true) diff --git a/akka-core/src/main/scala/stm/TransactionalState.scala b/akka-core/src/main/scala/stm/TransactionalState.scala index 1b52faf969..c74fde4ab0 100644 --- a/akka-core/src/main/scala/stm/TransactionalState.scala +++ b/akka-core/src/main/scala/stm/TransactionalState.scala @@ -2,12 +2,11 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.stm import se.scalablesolutions.akka.stm.Transaction.atomic -import se.scalablesolutions.akka.stm.NoTransactionInScopeException -import se.scalablesolutions.akka.collection._ import se.scalablesolutions.akka.util.UUID + import org.multiverse.stms.alpha.AlphaRef /** diff --git a/akka-core/src/main/scala/stm/Vector.scala b/akka-core/src/main/scala/stm/Vector.scala index e341875990..a9667d2521 100644 --- a/akka-core/src/main/scala/stm/Vector.scala +++ b/akka-core/src/main/scala/stm/Vector.scala @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. **/ -package se.scalablesolutions.akka.collection +package se.scalablesolutions.akka.stm import Vector._ @@ -54,7 +54,7 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail * (somewhat dynamically-typed) implementation in place. */ - private[collection] def this() = this(0, 5, EmptyArray, EmptyArray) + private[stm] def this() = this(0, 5, EmptyArray, EmptyArray) def apply(i: Int): T = { if (i >= 0 && i < length) { @@ -317,14 +317,14 @@ class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail } object Vector { - private[collection] val EmptyArray = new Array[AnyRef](0) + private[stm] val EmptyArray = new Array[AnyRef](0) def apply[T](elems: T*) = elems.foldLeft(EmptyVector:Vector[T]) { _ + _ } def unapplySeq[T](vec: Vector[T]): Option[Seq[T]] = Some(vec) @inline - private[collection] def array(elems: AnyRef*) = { + private[stm] def array(elems: AnyRef*) = { val back = new Array[AnyRef](elems.length) Array.copy(elems, 0, back, 0, back.length) @@ -334,7 +334,7 @@ object Vector { object EmptyVector extends Vector[Nothing] -private[collection] abstract class VectorProjection[+T] extends Vector[T] { +private[stm] abstract class VectorProjection[+T] extends Vector[T] { override val length: Int override def apply(i: Int): T diff --git a/akka-patterns/src/test/scala/AgentTest.scala b/akka-core/src/test/scala/AgentTest.scala similarity index 100% rename from akka-patterns/src/test/scala/AgentTest.scala rename to akka-core/src/test/scala/AgentTest.scala diff --git a/akka-core/src/test/scala/ClientInitiatedRemoteActorTest.scala b/akka-core/src/test/scala/ClientInitiatedRemoteActorTest.scala index 81fb4780da..ff2843efe8 100644 --- a/akka-core/src/test/scala/ClientInitiatedRemoteActorTest.scala +++ b/akka-core/src/test/scala/ClientInitiatedRemoteActorTest.scala @@ -49,7 +49,7 @@ class RemoteActorSpecActorAsyncSender extends Actor { class ClientInitiatedRemoteActorTest extends JUnitSuite { import Actor.Sender.Self - akka.Config.config + akka.config.Config.config val HOSTNAME = "localhost" val PORT1 = 9990 diff --git a/akka-core/src/test/scala/InMemoryActorTest.scala b/akka-core/src/test/scala/InMemoryActorTest.scala index d4be98fcaa..5692d7b01f 100644 --- a/akka-core/src/test/scala/InMemoryActorTest.scala +++ b/akka-core/src/test/scala/InMemoryActorTest.scala @@ -3,7 +3,7 @@ package se.scalablesolutions.akka.actor import org.scalatest.junit.JUnitSuite import org.junit.Test -import se.scalablesolutions.akka.state.{TransactionalState, TransactionalMap, TransactionalRef, TransactionalVector} +import se.scalablesolutions.akka.stm.{TransactionalState, TransactionalMap, TransactionalRef, TransactionalVector} case class GetMapState(key: String) case object GetVectorState diff --git a/akka-core/src/test/scala/RemoteSupervisorTest.scala b/akka-core/src/test/scala/RemoteSupervisorTest.scala index 57f01a6dda..7222e68b87 100644 --- a/akka-core/src/test/scala/RemoteSupervisorTest.scala +++ b/akka-core/src/test/scala/RemoteSupervisorTest.scala @@ -74,7 +74,7 @@ object Log { class RemoteSupervisorTest extends JUnitSuite { import Actor.Sender.Self - akka.Config.config + akka.config.Config.config new Thread(new Runnable() { def run = { RemoteNode.start diff --git a/akka-core/src/test/scala/ServerInitiatedRemoteActorTest.scala b/akka-core/src/test/scala/ServerInitiatedRemoteActorTest.scala index 2f1ef161c8..22ea078b1e 100644 --- a/akka-core/src/test/scala/ServerInitiatedRemoteActorTest.scala +++ b/akka-core/src/test/scala/ServerInitiatedRemoteActorTest.scala @@ -60,7 +60,7 @@ class ServerInitiatedRemoteActorTest extends JUnitSuite { import ServerInitiatedRemoteActorTest._ import Actor.Sender.Self - akka.Config.config + akka.config.Config.config private val unit = TimeUnit.MILLISECONDS diff --git a/akka-kernel/src/main/scala/Kernel.scala b/akka-kernel/src/main/scala/Kernel.scala index 7b2b2e4693..30bb49bb71 100644 --- a/akka-kernel/src/main/scala/Kernel.scala +++ b/akka-kernel/src/main/scala/Kernel.scala @@ -2,11 +2,12 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka +package se.scalablesolutions.akka.kernel import se.scalablesolutions.akka.remote.BootableRemoteActorService +import se.scalablesolutions.akka.comet.BootableCometActorService import se.scalablesolutions.akka.actor.BootableActorLoaderService -import se.scalablesolutions.akka.util.{Logging,Bootable} +import se.scalablesolutions.akka.util.{Logging, Bootable} import javax.servlet.{ServletContextListener, ServletContextEvent} @@ -27,12 +28,15 @@ object Kernel extends Logging { /** * Holds a reference to the services that has been booted */ - @volatile private var bundles : Option[Bootable] = None + @volatile private var bundles: Option[Bootable] = None /** - * Boots up the Kernel with default bootables + * Boots up the Kernel with default bootables */ - def boot : Unit = boot(true, new BootableActorLoaderService with BootableRemoteActorService with BootableCometActorService) + def boot: Unit = boot(true, + new BootableActorLoaderService + with BootableRemoteActorService + with BootableCometActorService) /** * Boots up the Kernel. @@ -63,8 +67,8 @@ object Kernel extends Logging { } //For testing purposes only - def startRemoteService : Unit = bundles.foreach( _ match { - case x : BootableRemoteActorService => x.startRemoteService + def startRemoteService: Unit = bundles.foreach( _ match { + case x: BootableRemoteActorService => x.startRemoteService case _ => }) @@ -79,16 +83,18 @@ object Kernel extends Logging { (____ /__|_ \__|_ \(____ / \/ \/ \/ \/ """) - log.info(" Running version %s", Config.VERSION) + log.info(" Running version %s", config.Config.VERSION) log.info("==============================") } } - /* - And this one can be added to web.xml mappings as a listener to boot and shutdown Akka - */ - + /** + * This class can be added to web.xml mappings as a listener to boot and shutdown Akka. + */ class Kernel extends ServletContextListener { - def contextDestroyed(e : ServletContextEvent) : Unit = Kernel.shutdown - def contextInitialized(e : ServletContextEvent) : Unit = Kernel.boot(true,new BootableActorLoaderService with BootableRemoteActorService) + def contextDestroyed(e: ServletContextEvent): Unit = + Kernel.shutdown + + def contextInitialized(e: ServletContextEvent): Unit = + Kernel.boot(true, new BootableActorLoaderService with BootableRemoteActorService) } \ No newline at end of file diff --git a/akka-patterns/src/main/scala/Agent.scala b/akka-patterns/src/main/scala/Agent.scala deleted file mode 100644 index aea74530a3..0000000000 --- a/akka-patterns/src/main/scala/Agent.scala +++ /dev/null @@ -1,146 +0,0 @@ -// ScalaAgent -// -// Copyright © 2008-9 The original author or authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package se.scalablesolutions.akka.actor - -import se.scalablesolutions.akka.state.TransactionalState -import se.scalablesolutions.akka.stm.Transaction.atomic - -import java.util.concurrent.atomic.AtomicReference -import java.util.concurrent.{CountDownLatch} - -/** -* The Agent class was strongly inspired by the agent principle in Clojure. Essentially, an agent wraps a shared mutable state -* and hides it behind a message-passing interface. Agents accept messages and process them on behalf of the wrapped state. -* Typically agents accept functions / commands as messages and ensure the submitted commands are executed against the internal -* agent's state in a thread-safe manner (sequentially). -* The submitted functions / commands take the internal state as a parameter and their output becomes the new internal state value. -* The code that is submitted to an agent doesn't need to pay attention to threading or synchronization, the agent will -* provide such guarantees by itself. -* See the examples of use for more details. -* -* @author Vaclav Pech -* Date: Oct 18, 2009 -* -* AKKA retrofit by -* @author Viktor Klang -* Date: Jan 24 2010 -*/ -sealed class Agent[T] private (initialValue: T) extends Actor { - import Agent._ - - private val value = TransactionalState.newRef[T] - - updateData(initialValue) - - /** - * Periodically handles incoming messages - */ - def receive = { - case FunctionHolder(fun: (T => T)) => updateData(fun(value.getOrWait)) - - case ValueHolder(x: T) => updateData(x) - - case ProcedureHolder(fun: (T => Unit)) => fun(copyStrategy(value.getOrWait)) - } - - /** - * Specifies how a copy of the value is made, defaults to using identity - */ - protected def copyStrategy(t: T): T = t - - - /** - * Updates the internal state with the value provided as a by-name parameter - */ - private final def updateData(newData: => T): Unit = value.swap(newData) - - /** - * Submits a request to read the internal state. - * A copy of the internal state will be returned, depending on the underlying effective copyStrategy. - * Internally leverages the asynchronous getValue() method and then waits for its result on a CountDownLatch. - */ - final def get: T = { - val ref = new AtomicReference[T] - val latch = new CountDownLatch(1) - get((x: T) => {ref.set(x); latch.countDown}) - latch.await - ref.get - } - - /** - * Asynchronously submits a request to read the internal state. The supplied function will be executed on the returned internal state value. - * A copy of the internal state will be used, depending on the underlying effective copyStrategy. - */ - final def get(message: (T => Unit)): Unit = this ! ProcedureHolder(message) - - /** - * Submits a request to read the internal state. - * A copy of the internal state will be returned, depending on the underlying effective copyStrategy. - * Internally leverages the asynchronous getValue() method and then waits for its result on a CountDownLatch. - */ - final def apply(): T = get - - /** - * Asynchronously submits a request to read the internal state. The supplied function will be executed on the returned internal state value. - * A copy of the internal state will be used, depending on the underlying effective copyStrategy. - */ -// final def apply(message: (T => Unit)) : Unit = get(message) - - /** - * Submits the provided function for execution against the internal agent's state - */ - final def apply(message: (T => T)): Unit = this ! FunctionHolder(message) - - /** - * Submits a new value to be set as the new agent's internal state - */ - final def apply(message: T): Unit = this ! ValueHolder(message) - - /** - * Submits the provided function for execution against the internal agent's state - */ - final def update(message: (T => T)): Unit = this ! FunctionHolder(message) - - /** - * Submits a new value to be set as the new agent's internal state - */ - final def update(message: T): Unit = this ! ValueHolder(message) -} - -/** -* Provides factory methods to create Agents. -*/ -object Agent { - /** - * The internal messages for passing around requests - */ - private case class ProcedureHolder[T](val fun: ((T) => Unit)) - private case class FunctionHolder[T](val fun: ((T) => T)) - private case class ValueHolder[T](val value: T) - - /** - * Creates a new Agent of type T with the initial value of value - */ - def apply[T](value:T): Agent[T] = new Agent(value) - - /** - * Creates a new Agent of type T with the initial value of value and with the specified copy function - */ - def apply[T](value:T, newCopyStrategy: (T) => T) = new Agent(value) { - override def copyStrategy(t : T) = newCopyStrategy(t) - } -} diff --git a/akka-patterns/src/main/scala/Patterns.scala b/akka-patterns/src/main/scala/Patterns.scala index 9b7e55ccc9..02f2686ba7 100644 --- a/akka-patterns/src/main/scala/Patterns.scala +++ b/akka-patterns/src/main/scala/Patterns.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.actor.patterns +package se.scalablesolutions.akka.patterns import se.scalablesolutions.akka.actor.Actor diff --git a/akka-patterns/src/test/scala/ActorPatternsTest.scala b/akka-patterns/src/test/scala/ActorPatternsTest.scala index ae6ae5c0e8..c76269c5ec 100644 --- a/akka-patterns/src/test/scala/ActorPatternsTest.scala +++ b/akka-patterns/src/test/scala/ActorPatternsTest.scala @@ -1,5 +1,4 @@ -package se.scalablesolutions.akka.actor - +package se.scalablesolutions.akka.patterns import config.ScalaConfig._ diff --git a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraSession.scala b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraSession.scala index 0b0c5ca43a..5141dc7cb2 100644 --- a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraSession.scala +++ b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraSession.scala @@ -2,14 +2,15 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.cassandra import java.io.{Flushable, Closeable} +import se.scalablesolutions.akka.persistence.common._ import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.util.Helpers._ import se.scalablesolutions.akka.serialization.Serializer -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import scala.collection.mutable.Map diff --git a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorage.scala b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorage.scala index 59a27963f4..be5fc4f4c7 100644 --- a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorage.scala +++ b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorage.scala @@ -2,16 +2,18 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.cassandra -import org.codehaus.aspectwerkz.proxy.Uuid +import se.scalablesolutions.akka.util.UUID +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ object CassandraStorage extends Storage { type ElementType = Array[Byte] - def newMap: PersistentMap[ElementType, ElementType] = newMap(Uuid.newUuid.toString) - def newVector: PersistentVector[ElementType] = newVector(Uuid.newUuid.toString) - def newRef: PersistentRef[ElementType] = newRef(Uuid.newUuid.toString) + def newMap: PersistentMap[ElementType, ElementType] = newMap(UUID.newUuid.toString) + def newVector: PersistentVector[ElementType] = newVector(UUID.newUuid.toString) + def newRef: PersistentRef[ElementType] = newRef(UUID.newUuid.toString) def getMap(id: String): PersistentMap[ElementType, ElementType] = newMap(id) def getVector(id: String): PersistentVector[ElementType] = newVector(id) diff --git a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala index d3c011ef79..8e91753211 100644 --- a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala +++ b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala @@ -2,11 +2,13 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.cassandra +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.util.Helpers._ -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import org.apache.cassandra.service._ diff --git a/akka-persistence/akka-persistence-cassandra/src/test/scala/CassandraPersistentActorSpec.scala b/akka-persistence/akka-persistence-cassandra/src/test/scala/CassandraPersistentActorSpec.scala index a7fed923eb..46d1b48a2d 100644 --- a/akka-persistence/akka-persistence-cassandra/src/test/scala/CassandraPersistentActorSpec.scala +++ b/akka-persistence/akka-persistence-cassandra/src/test/scala/CassandraPersistentActorSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.cassandra import se.scalablesolutions.akka.actor.{Actor, Transactor} diff --git a/akka-persistence/akka-persistence-common/src/main/scala/Pool.scala b/akka-persistence/akka-persistence-common/src/main/scala/Pool.scala index d290455cad..73b64f3dd5 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/Pool.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/Pool.scala @@ -2,7 +2,7 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.common import org.apache.commons.pool._ import org.apache.commons.pool.impl._ diff --git a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala index f52841b817..ff37dde82e 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala @@ -2,10 +2,10 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.common +import se.scalablesolutions.akka.stm._ import se.scalablesolutions.akka.stm.TransactionManagement.transaction -import se.scalablesolutions.akka.collection._ import se.scalablesolutions.akka.util.Logging // FIXME move to 'stm' package + add message with more info diff --git a/akka-persistence/akka-persistence-common/src/main/scala/StorageBackend.scala b/akka-persistence/akka-persistence-common/src/main/scala/StorageBackend.scala index 94233acd0a..cf08095334 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/StorageBackend.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/StorageBackend.scala @@ -2,7 +2,7 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.common // abstracts persistence storage trait StorageBackend diff --git a/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorage.scala b/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorage.scala index 9aaf7a601d..70c7937eae 100644 --- a/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorage.scala +++ b/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorage.scala @@ -2,16 +2,18 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.mongo -import org.codehaus.aspectwerkz.proxy.Uuid +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ +import se.scalablesolutions.akka.util.UUID object MongoStorage extends Storage { type ElementType = AnyRef - def newMap: PersistentMap[ElementType, ElementType] = newMap(Uuid.newUuid.toString) - def newVector: PersistentVector[ElementType] = newVector(Uuid.newUuid.toString) - def newRef: PersistentRef[ElementType] = newRef(Uuid.newUuid.toString) + def newMap: PersistentMap[ElementType, ElementType] = newMap(UUID.newUuid.toString) + def newVector: PersistentVector[ElementType] = newVector(UUID.newUuid.toString) + def newRef: PersistentRef[ElementType] = newRef(UUID.newUuid.toString) def getMap(id: String): PersistentMap[ElementType, ElementType] = newMap(id) def getVector(id: String): PersistentVector[ElementType] = newVector(id) diff --git a/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorageBackend.scala b/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorageBackend.scala index 0641b676e5..7cf3de21a4 100644 --- a/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorageBackend.scala +++ b/akka-persistence/akka-persistence-mongo/src/main/scala/MongoStorageBackend.scala @@ -2,10 +2,12 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.mongo +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ import se.scalablesolutions.akka.util.Logging -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import sjson.json.Serializer._ diff --git a/akka-persistence/akka-persistence-mongo/src/test/scala/MongoPersistentActorSpec.scala b/akka-persistence/akka-persistence-mongo/src/test/scala/MongoPersistentActorSpec.scala index 8ad5d94355..93aa1862d1 100644 --- a/akka-persistence/akka-persistence-mongo/src/test/scala/MongoPersistentActorSpec.scala +++ b/akka-persistence/akka-persistence-mongo/src/test/scala/MongoPersistentActorSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.mongo import junit.framework.TestCase diff --git a/akka-persistence/akka-persistence-mongo/src/test/scala/MongoStorageSpec.scala b/akka-persistence/akka-persistence-mongo/src/test/scala/MongoStorageSpec.scala index fae6d7f00d..bf13c62390 100644 --- a/akka-persistence/akka-persistence-mongo/src/test/scala/MongoStorageSpec.scala +++ b/akka-persistence/akka-persistence-mongo/src/test/scala/MongoStorageSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.mongo import junit.framework.TestCase diff --git a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorage.scala b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorage.scala index fffa0011e5..1338a9f8d4 100644 --- a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorage.scala +++ b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorage.scala @@ -2,17 +2,19 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.redis -import org.codehaus.aspectwerkz.proxy.Uuid +import se.scalablesolutions.akka.util.UUID +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ object RedisStorage extends Storage { type ElementType = Array[Byte] - def newMap: PersistentMap[ElementType, ElementType] = newMap(Uuid.newUuid.toString) - def newVector: PersistentVector[ElementType] = newVector(Uuid.newUuid.toString) - def newRef: PersistentRef[ElementType] = newRef(Uuid.newUuid.toString) - override def newQueue: PersistentQueue[ElementType] = newQueue(Uuid.newUuid.toString) + def newMap: PersistentMap[ElementType, ElementType] = newMap(UUID.newUuid.toString) + def newVector: PersistentVector[ElementType] = newVector(UUID.newUuid.toString) + def newRef: PersistentRef[ElementType] = newRef(UUID.newUuid.toString) + override def newQueue: PersistentQueue[ElementType] = newQueue(UUID.newUuid.toString) def getMap(id: String): PersistentMap[ElementType, ElementType] = newMap(id) def getVector(id: String): PersistentVector[ElementType] = newVector(id) 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 be214087f3..59a04135b4 100644 --- a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala +++ b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala @@ -2,10 +2,12 @@ * Copyright (C) 2009-2010 Scalable Solutions AB */ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.redis +import se.scalablesolutions.akka.stm._ +import se.scalablesolutions.akka.persistence.common._ import se.scalablesolutions.akka.util.Logging -import se.scalablesolutions.akka.Config.config +import se.scalablesolutions.akka.config.Config.config import com.redis._ diff --git a/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentActorSpec.scala b/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentActorSpec.scala index 8c91f0ff61..9405789bfd 100644 --- a/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentActorSpec.scala +++ b/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentActorSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.redis import junit.framework.TestCase diff --git a/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentQSpec.scala b/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentQSpec.scala index ad67dbfdbe..10cbb9e5c7 100644 --- a/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentQSpec.scala +++ b/akka-persistence/akka-persistence-redis/src/test/scala/RedisPersistentQSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.redis import junit.framework.TestCase diff --git a/akka-rest/src/main/scala/ActorComponentProvider.scala b/akka-rest/src/main/scala/ActorComponentProvider.scala index ed9fb225fb..5d9d49bef2 100644 --- a/akka-rest/src/main/scala/ActorComponentProvider.scala +++ b/akka-rest/src/main/scala/ActorComponentProvider.scala @@ -7,8 +7,8 @@ package se.scalablesolutions.akka.rest import com.sun.jersey.core.spi.component.ComponentScope import com.sun.jersey.core.spi.component.ioc.IoCFullyManagedComponentProvider -import config.Configurator -import util.Logging +import se.scalablesolutions.akka.config.Configurator +import se.scalablesolutions.akka.util.Logging class ActorComponentProvider(val clazz: Class[_], val configurators: List[Configurator]) extends IoCFullyManagedComponentProvider with Logging { diff --git a/akka-rest/src/main/scala/AkkaServlet.scala b/akka-rest/src/main/scala/AkkaServlet.scala index 2aa2a6b2c5..fbf14cad31 100644 --- a/akka-rest/src/main/scala/AkkaServlet.scala +++ b/akka-rest/src/main/scala/AkkaServlet.scala @@ -5,6 +5,7 @@ package se.scalablesolutions.akka.rest import se.scalablesolutions.akka.config.ConfiguratorRepository +import se.scalablesolutions.akka.config.Config.config import com.sun.jersey.api.core.ResourceConfig import com.sun.jersey.spi.container.servlet.ServletContainer @@ -20,14 +21,12 @@ class AkkaServlet extends ServletContainer { import org.scala_tools.javautils.Imports._ override def initiate(resourceConfig: ResourceConfig, webApplication: WebApplication) = { - //Kernel.boot // will boot if not already booted by 'main' - val configurators = ConfiguratorRepository.getConfigurators resourceConfig.getClasses.addAll(configurators.flatMap(_.getComponentInterfaces).asJava) resourceConfig.getProperties.put( "com.sun.jersey.spi.container.ResourceFilters", - Config.config.getList("akka.rest.filters").mkString(",")) + config.getList("akka.rest.filters").mkString(",")) webApplication.initiate(resourceConfig, new ActorComponentProviderFactory(configurators)) } diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala index d03c209706..981a4c3c05 100644 --- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala +++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala @@ -6,12 +6,14 @@ package se.scalablesolutions.akka.sample.chat import se.scalablesolutions.akka.actor.{SupervisorFactory, Actor, RemoteActor} import se.scalablesolutions.akka.stm.Transaction._ +import se.scalablesolutions.akka.persistence.common.PersistentVector +import se.scalablesolutions.akka.persistence.redis.RedisStorage import se.scalablesolutions.akka.remote.RemoteServer import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.config.OneForOneStrategy + import scala.collection.mutable.HashMap -import se.scalablesolutions.akka.state.{PersistentVector, RedisStorage} /****************************************************************************** To run the sample: diff --git a/akka-samples/akka-sample-lift/src/main/scala/akka/SimpleService.scala b/akka-samples/akka-sample-lift/src/main/scala/akka/SimpleService.scala index 3f18f7d357..35a4158642 100644 --- a/akka-samples/akka-sample-lift/src/main/scala/akka/SimpleService.scala +++ b/akka-samples/akka-sample-lift/src/main/scala/akka/SimpleService.scala @@ -2,7 +2,8 @@ package sample.lift import se.scalablesolutions.akka.actor.{Transactor, Actor} import se.scalablesolutions.akka.config.ScalaConfig._ -import se.scalablesolutions.akka.state.{CassandraStorage, TransactionalState} +import se.scalablesolutions.akka.stm.TransactionalState +import se.scalablesolutions.akka.persistence.cassandra.CassandraStorage import java.lang.Integer import javax.ws.rs.{GET, Path, Produces} diff --git a/akka-samples/akka-sample-rest-java/src/main/java/sample/java/PersistentSimpleService.java b/akka-samples/akka-sample-rest-java/src/main/java/sample/java/PersistentSimpleService.java index 9a0a38f619..2597e45d95 100644 --- a/akka-samples/akka-sample-rest-java/src/main/java/sample/java/PersistentSimpleService.java +++ b/akka-samples/akka-sample-rest-java/src/main/java/sample/java/PersistentSimpleService.java @@ -11,8 +11,8 @@ import javax.ws.rs.Produces; import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.prerestart; import se.scalablesolutions.akka.annotation.postrestart; -import se.scalablesolutions.akka.state.PersistentMap; -import se.scalablesolutions.akka.state.CassandraStorage; +import se.scalablesolutions.akka.persistence.common.PersistentMap; +import se.scalablesolutions.akka.persistence.cassandra.CassandraStorage; import java.nio.ByteBuffer; diff --git a/akka-samples/akka-sample-rest-java/src/main/java/sample/java/SimpleService.java b/akka-samples/akka-sample-rest-java/src/main/java/sample/java/SimpleService.java index 54468495bc..0d86b2d37b 100644 --- a/akka-samples/akka-sample-rest-java/src/main/java/sample/java/SimpleService.java +++ b/akka-samples/akka-sample-rest-java/src/main/java/sample/java/SimpleService.java @@ -11,8 +11,8 @@ import javax.ws.rs.Produces; import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.prerestart; import se.scalablesolutions.akka.annotation.postrestart; -import se.scalablesolutions.akka.state.TransactionalState; -import se.scalablesolutions.akka.state.TransactionalMap; +import se.scalablesolutions.akka.stm.TransactionalState; +import se.scalablesolutions.akka.stm.TransactionalMap; /** * Try service out by invoking (multiple times): diff --git a/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala b/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala index 39a6a2a0d2..04408fc0f4 100644 --- a/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala +++ b/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala @@ -5,10 +5,11 @@ package sample.scala import se.scalablesolutions.akka.actor.{Transactor, SupervisorFactory, Actor} -import se.scalablesolutions.akka.state.{CassandraStorage, TransactionalState} +import se.scalablesolutions.akka.stm.TransactionalState +import se.scalablesolutions.akka.persistence.cassandra.CassandraStorage import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.util.Logging -import se.scalablesolutions.akka.comet.{AkkaClusterBroadcastFilter} +import se.scalablesolutions.akka.comet.AkkaClusterBroadcastFilter import java.lang.Integer import java.nio.ByteBuffer diff --git a/akka-samples/akka-sample-security/src/main/scala/SecuritySpec.scala b/akka-samples/akka-sample-security/src/main/scala/SecuritySpec.scala new file mode 100644 index 0000000000..15e84381ea --- /dev/null +++ b/akka-samples/akka-sample-security/src/main/scala/SecuritySpec.scala @@ -0,0 +1,74 @@ +/** + * Copyright (C) 2009-2010 Scalable Solutions AB + */ + +package se.scalablesolutions.akka.security + +import config.ScalaConfig._ + +import org.scalatest.Suite +import org.scalatest.junit.JUnitSuite +import org.scalatest.matchers.MustMatchers +import org.scalatest.mock.MockitoSugar +import org.mockito.Mockito._ +import org.mockito.Matchers._ +import org.junit.{Before, After, Test} + +import _root_.javax.ws.rs.core.{SecurityContext, Context, Response} +import _root_.com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} +import _root_.com.sun.jersey.core.util.Base64 + +class BasicAuthenticatorSpec extends junit.framework.TestCase + with Suite with MockitoSugar with MustMatchers { + val authenticator = new BasicAuthenticator + authenticator.start + + @Test def testChallenge = { + val req = mock[ContainerRequest] + + val result: Response = (authenticator !! (Authenticate(req, List("foo")), 10000)).get + + // the actor replies with a challenge for the browser + result.getStatus must equal(Response.Status.UNAUTHORIZED.getStatusCode) + result.getMetadata.get("WWW-Authenticate").get(0).toString must startWith("Basic") + } + + @Test def testAuthenticationSuccess = { + val req = mock[ContainerRequest] + // fake a basic auth header -> this will authenticate the user + when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar"))) + + // fake a request authorization -> this will authorize the user + when(req.isUserInRole("chef")).thenReturn(true) + + val result: AnyRef = (authenticator !! (Authenticate(req, List("chef")), 10000)).get + + result must be(OK) + // the authenticator must have set a security context + verify(req).setSecurityContext(any[SecurityContext]) + } + + @Test def testUnauthorized = { + val req = mock[ContainerRequest] + + // fake a basic auth header -> this will authenticate the user + when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar"))) + when(req.isUserInRole("chef")).thenReturn(false) // this will deny access + + val result: Response = (authenticator !! (Authenticate(req, List("chef")), 10000)).get + + result.getStatus must equal(Response.Status.FORBIDDEN.getStatusCode) + + // the authenticator must have set a security context + verify(req).setSecurityContext(any[SecurityContext]) + } + + class BasicAuthenticator extends BasicAuthenticationActor { + def verify(odc: Option[BasicCredentials]): Option[UserInfo] = odc match { + case Some(dc) => Some(UserInfo("foo", "bar", "ninja" :: "chef" :: Nil)) + case _ => None + } + override def realm = "test" + } +} + diff --git a/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala b/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala index 59e3a5c85e..b6183cfda9 100644 --- a/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala +++ b/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala @@ -8,7 +8,7 @@ import se.scalablesolutions.akka.actor.{SupervisorFactory, Actor} import se.scalablesolutions.akka.config.ScalaConfig._ import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.security.{DigestAuthenticationActor, UserInfo} -import se.scalablesolutions.akka.state.TransactionalState +import se.scalablesolutions.akka.stm.TransactionalState class Boot { val factory = SupervisorFactory( diff --git a/akka-security/src/main/scala/Security.scala b/akka-security/src/main/scala/Security.scala index f6f2b939a1..1f0d8a94aa 100644 --- a/akka-security/src/main/scala/Security.scala +++ b/akka-security/src/main/scala/Security.scala @@ -22,20 +22,21 @@ package se.scalablesolutions.akka.security -import _root_.se.scalablesolutions.akka.actor.{Scheduler, Actor, ActorRegistry} -import _root_.se.scalablesolutions.akka.util.Logging -import _root_.se.scalablesolutions.akka.Config +import se.scalablesolutions.akka.actor.{Scheduler, Actor, ActorRegistry} +import se.scalablesolutions.akka.util.Logging +import se.scalablesolutions.akka.config.Config -import _root_.com.sun.jersey.api.model.AbstractMethod -import _root_.com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} -import _root_.com.sun.jersey.core.util.Base64 -import _root_.javax.ws.rs.core.{SecurityContext, Context, Response} -import _root_.javax.ws.rs.WebApplicationException -import _root_.javax.annotation.security.{DenyAll, PermitAll, RolesAllowed} -import _root_.java.security.Principal -import _root_.java.util.concurrent.TimeUnit +import com.sun.jersey.api.model.AbstractMethod +import com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} +import com.sun.jersey.core.util.Base64 -import _root_.net.liftweb.util.{SecurityHelpers, StringHelpers, IoHelpers} +import javax.ws.rs.core.{SecurityContext, Context, Response} +import javax.ws.rs.WebApplicationException +import javax.annotation.security.{DenyAll, PermitAll, RolesAllowed} +import java.security.Principal +import java.util.concurrent.TimeUnit + +import net.liftweb.util.{SecurityHelpers, StringHelpers, IoHelpers} object Enc extends SecurityHelpers with StringHelpers with IoHelpers @@ -329,19 +330,19 @@ trait DigestAuthenticationActor extends AuthenticationActor[DigestCredentials] { def noncePurgeInterval = 2 * 60 * 1000 //ms } -import _root_.java.security.Principal -import _root_.java.security.PrivilegedActionException -import _root_.java.security.PrivilegedExceptionAction +import java.security.Principal +import java.security.PrivilegedActionException +import java.security.PrivilegedExceptionAction -import _root_.javax.security.auth.login.AppConfigurationEntry -import _root_.javax.security.auth.login.Configuration -import _root_.javax.security.auth.login.LoginContext -import _root_.javax.security.auth.Subject -import _root_.javax.security.auth.kerberos.KerberosPrincipal +import javax.security.auth.login.AppConfigurationEntry +import javax.security.auth.login.Configuration +import javax.security.auth.login.LoginContext +import javax.security.auth.Subject +import javax.security.auth.kerberos.KerberosPrincipal -import _root_.org.ietf.jgss.GSSContext -import _root_.org.ietf.jgss.GSSCredential -import _root_.org.ietf.jgss.GSSManager +import org.ietf.jgss.GSSContext +import org.ietf.jgss.GSSCredential +import org.ietf.jgss.GSSManager trait SpnegoAuthenticationActor extends AuthenticationActor[SpnegoCredentials] { override def unauthorized = @@ -349,7 +350,7 @@ trait SpnegoAuthenticationActor extends AuthenticationActor[SpnegoCredentials] { // for some reason the jersey Base64 class does not work with kerberos // but the commons Base64 does - import _root_.org.apache.commons.codec.binary.Base64 + import org.apache.commons.codec.binary.Base64 override def extractCredentials(r: Req): Option[SpnegoCredentials] = { val AuthHeader = """Negotiate\s(.*)""".r diff --git a/akka-security/src/test/scala/SecuritySpec.scala b/akka-security/src/test/scala/SecuritySpec.scala index 15e84381ea..e56148b5df 100644 --- a/akka-security/src/test/scala/SecuritySpec.scala +++ b/akka-security/src/test/scala/SecuritySpec.scala @@ -14,9 +14,9 @@ import org.mockito.Mockito._ import org.mockito.Matchers._ import org.junit.{Before, After, Test} -import _root_.javax.ws.rs.core.{SecurityContext, Context, Response} -import _root_.com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} -import _root_.com.sun.jersey.core.util.Base64 +import javax.ws.rs.core.{SecurityContext, Context, Response} +import com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter} +import com.sun.jersey.core.util.Base64 class BasicAuthenticatorSpec extends junit.framework.TestCase with Suite with MockitoSugar with MustMatchers { diff --git a/akka-util/src/main/scala/Bootable.scala b/akka-util/src/main/scala/Bootable.scala index a46a131f00..172be3fd43 100644 --- a/akka-util/src/main/scala/Bootable.scala +++ b/akka-util/src/main/scala/Bootable.scala @@ -5,6 +5,6 @@ package se.scalablesolutions.akka.util trait Bootable { - def onLoad : Unit = () - def onUnload : Unit = () + def onLoad {} + def onUnload {} } \ No newline at end of file diff --git a/akka-util/src/main/scala/Config.scala b/akka-util/src/main/scala/Config.scala deleted file mode 100644 index f25b08ee46..0000000000 --- a/akka-util/src/main/scala/Config.scala +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka - -import util.Logging - -import net.lag.configgy.{Configgy, ParseException} - -/** - * @author Jonas Bonér - */ -object Config extends Logging { - val VERSION = "0.7-SNAPSHOT" - - // Set Multiverse options for max speed - System.setProperty("org.multiverse.MuliverseConstants.sanityChecks", "false") - System.setProperty("org.multiverse.api.GlobalStmInstance.factorymethod", "org.multiverse.stms.alpha.AlphaStm.createFast") - - val HOME = { - val systemHome = System.getenv("AKKA_HOME") - if (systemHome == null || systemHome.length == 0 || systemHome == ".") { - val optionHome = System.getProperty("akka.home", "") - if (optionHome.length != 0) Some(optionHome) - else None - } else Some(systemHome) - } - - val config = { - if (HOME.isDefined) { - try { - val configFile = HOME.get + "/config/akka.conf" - Configgy.configure(configFile) - log.info("AKKA_HOME is defined to [%s], config loaded from [%s].", HOME.get, configFile) - } catch { - case e: ParseException => throw new IllegalStateException( - "'akka.conf' config file can not be found in [" + HOME + "/config/akka.conf] aborting." + - "\n\tEither add it in the 'config' directory or add it to the classpath.") - } - } else if (System.getProperty("akka.config", "") != "") { - val configFile = System.getProperty("akka.config", "") - try { - Configgy.configure(configFile) - log.info("Config loaded from -Dakka.config=%s", configFile) - } catch { - case e: ParseException => throw new IllegalStateException( - "Config could not be loaded from -Dakka.config=" + configFile) - } - } else { - try { - Configgy.configureFromResource("akka.conf", getClass.getClassLoader) - log.info("Config loaded from the application classpath.") - } catch { - case e: ParseException => throw new IllegalStateException( - "\nCan't find 'akka.conf' configuration file." + - "\nOne of the three ways of locating the 'akka.conf' file needs to be defined:" + - "\n\t1. Define 'AKKA_HOME' environment variable to the root of the Akka distribution." + - "\n\t2. Define the '-Dakka.config=...' system property option." + - "\n\t3. Put the 'akka.conf' file on the classpath." + - "\nI have no way of finding the 'akka.conf' configuration file." + - "\nAborting.") - } - } - Configgy.config - } - - val CONFIG_VERSION = config.getString("akka.version", "0") - if (VERSION != CONFIG_VERSION) throw new IllegalStateException( - "Akka JAR version [" + VERSION + "] is different than the provided config ('akka.conf') version [" + CONFIG_VERSION + "]") - val startTime = System.currentTimeMillis - - def uptime = (System.currentTimeMillis - startTime) / 1000 -} diff --git a/akka-util/src/main/scala/Helpers.scala b/akka-util/src/main/scala/Helpers.scala index b7e5ff3b75..55abf6e7ac 100644 --- a/akka-util/src/main/scala/Helpers.scala +++ b/akka-util/src/main/scala/Helpers.scala @@ -40,7 +40,6 @@ object Helpers extends Logging { } // ================================================ - @serializable class ReadWriteLock { private val rwl = new ReentrantReadWriteLock private val readLock = rwl.readLock diff --git a/akka-util/src/main/scala/Logging.scala b/akka-util/src/main/scala/Logging.scala index a6b89b86b2..b988c73f22 100644 --- a/akka-util/src/main/scala/Logging.scala +++ b/akka-util/src/main/scala/Logging.scala @@ -6,10 +6,10 @@ package se.scalablesolutions.akka.util import net.lag.logging.Logger -import java.io.StringWriter; -import java.io.PrintWriter; -import java.net.InetAddress; -import java.net.UnknownHostException; +import java.io.StringWriter +import java.io.PrintWriter +import java.net.InetAddress +import java.net.UnknownHostException /** * Base trait for all classes that wants to be able use the logging infrastructure. @@ -30,6 +30,7 @@ trait Logging { * * @author Jonas Bonér */ + // FIXME make use of LoggableException class LoggableException extends Exception with Logging { private val uniqueId = getExceptionID private var originalException: Option[Exception] = None diff --git a/config/akka-reference.conf b/config/akka-reference.conf index 14933a3cac..dd3cfc01b2 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -51,7 +51,7 @@ service = on # FIXME add 'service = on' for name = "default" # The name of the cluster - actor = "se.scalablesolutions.akka.remote.JGroupsClusterActor" # FQN of an implementation of ClusterActor + actor = "se.scalablesolutions.akka.cluster.jgroups.JGroupsClusterActor" # FQN of an implementation of ClusterActor serializer = "se.scalablesolutions.akka.serialization.Serializer$Java" # FQN of the serializer class From 4f708895b5ab596c43565eed93482b257b991c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Thu, 11 Mar 2010 09:51:08 +0100 Subject: [PATCH 16/21] removed changes.xml (online instead) --- changes.xml | 86 ----------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 changes.xml diff --git a/changes.xml b/changes.xml deleted file mode 100644 index 90a9e31c88..0000000000 --- a/changes.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - Akka Release Notes - Jonas Bonér - - - - Clustered Comet using Akka remote actors and clustered membership API - Cluster membership API and implementation based on JGroups - Security module for HTTP-based authentication and authorization - Support for using Scala XML tags in RESTful Actors (scala-jersey) - Support for Comet Actors using Atmosphere - MongoDB as Akka storage backend - Redis as Akka storage backend - Transparent JSON serialization of Scala objects based on SJSON - Kerberos/SPNEGO support for Security module - Implicit sender for remote actors: Remote actors are able to use reply to answer a request - Support for using the Lift Web framework with Actors - Rewritten STM, now integrated with Multiverse STM - Added STM API for atomic {..} and run {..} orElse {..} - Added STM retry - Complete rewrite of the persistence transaction management, now based on Unit of Work and Multiverse STM - Monadic API to TransactionalRef (use it in for-comprehension) - Lightweight actor syntax using one of the Actor.actor(..) methods. F.e: 'val a = actor { case _ => .. }' - Rewritten event-based dispatcher which improved perfomance by 10x, now substantially faster than event-driven Scala Actors - New Scala JSON parser based on sjson - Added zlib compression to remote actors - Added implicit sender reference for fire-forget ('!') message sends - Monadic API to TransactionalRef (use it in for-comprehension) - Smoother web app integration; just add akka.conf to the classpath (WEB-INF/classes), no need for AKKA_HOME or -Dakka.conf=.. - Modularization of distribution into a thin core (actors, remoting and STM) and the rest in submodules - Added 'forward' to Actor, forwards message but keeps original sender address - JSON serialization for Java objects (using Jackson) - JSON serialization for Scala objects (using SJSON) - Added implementation for remote actor reconnect upon failure - Protobuf serialization for Java and Scala objects - SBinary serialization for Scala objects - Protobuf as remote protocol - AMQP integration; abstracted as actors in a supervisor hierarchy. Impl AMQP 0.9.1 - Updated Cassandra integration and CassandraSession API to v0.4 - Added CassandraSession API (with socket pooling) wrapping Cassandra's Thrift API in Scala and Java APIs - CassandraStorage is now works with external Cassandra cluster - ActorRegistry for retrieving Actor instances by class name and by id - SchedulerActor for scheduling periodic tasks - Now start up kernel with 'java -jar dist/akka-0.6.jar' - Added mailing list: akka-user@googlegroups.com - Improved and restructured documentation - New URL: http://akkasource.org - New and much improved docs - Enhanced trapping of failures: 'trapExit = List(classOf[..], classOf[..])' - Upgraded to Netty 3.2, Protobuf 2.2, ScalaTest 1.0, Jersey 1.1.3, Atmosphere 0.4.1, Cassandra 0.4.1, Configgy 1.4 - Lowered actor memory footprint; now an actor consumes ~600 bytes, which mean that you can create 6.5 million on 4 G RAM - Removed concurrent mode - Remote actors are now defined by their UUID (not class name) - Fixed dispatcher bugs - Cleaned up Maven scripts and distribution in general - Fixed many many bugs and minor issues - Fixed inconsistencies and uglyness in Actors API - Removed embedded Cassandra mode - Removed the !? method in Actor (synchronous message send, since it's evil. Use !! with time-out instead. - Removed startup scripts and lib dir - Removed the 'Transient' life-cycle scope since to close to 'Temporary' in semantics. - Removed 'Transient' Actors and restart timeout - - - - \ No newline at end of file From 6cadb0d03526ea93d42d1a86b82887606b90b7fb Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 13 Mar 2010 14:06:52 +0100 Subject: [PATCH 17/21] Fixing container detection for SBT console mode --- akka-comet/src/main/scala/BootableCometActorService.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/akka-comet/src/main/scala/BootableCometActorService.scala b/akka-comet/src/main/scala/BootableCometActorService.scala index f6895aeee9..496cc33aed 100644 --- a/akka-comet/src/main/scala/BootableCometActorService.scala +++ b/akka-comet/src/main/scala/BootableCometActorService.scala @@ -43,8 +43,7 @@ trait BootableCometActorService extends Bootable with Logging { adapter.setHandleStaticResources(true) adapter.setServletInstance(new AkkaServlet) adapter.setContextPath(uri.getPath) - //Using autodetection for now - //adapter.addInitParameter("cometSupport", "org.atmosphere.container.GrizzlyCometSupport") + adapter.addInitParameter("cometSupport", "org.atmosphere.container.GrizzlyCometSupport") if (HOME.isDefined) adapter.setRootFolder(HOME.get + "/deploy/root") log.info("REST service root path [%s] and context path [%s]", adapter.getRootFolder, adapter.getContextPath) From 81b35c1f7d122f1e0a7026db52476649a2d470f9 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 13 Mar 2010 14:07:37 +0100 Subject: [PATCH 18/21] Return 408 is authentication times out --- akka-security/src/main/scala/Security.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/akka-security/src/main/scala/Security.scala b/akka-security/src/main/scala/Security.scala index 1f0d8a94aa..8a144f4282 100644 --- a/akka-security/src/main/scala/Security.scala +++ b/akka-security/src/main/scala/Security.scala @@ -87,10 +87,11 @@ class AkkaSecurityFilterFactory extends ResourceFilterFactory with Logging { override def filter(request: ContainerRequest): ContainerRequest = rolesAllowed match { case Some(roles) => { - (authenticator !! (Authenticate(request, roles), 10000)).get.asInstanceOf[AnyRef] match { - case OK => request - case r if r.isInstanceOf[Response] => + (authenticator.!![AnyRef](Authenticate(request, roles), 10000)) match { + case Some(OK) => request + case Some(r) if r.isInstanceOf[Response] => throw new WebApplicationException(r.asInstanceOf[Response]) + case None => throw new WebApplicationException(408) case x => { log.error("Authenticator replied with unexpected result [%s]", x); throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR) From d1a9e4a2861c6ebbf258250a44a38eb7147c961e Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 13 Mar 2010 14:08:02 +0100 Subject: [PATCH 19/21] Fixed deprecation warning --- akka-core/src/test/scala/ThreadBasedDispatcherTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-core/src/test/scala/ThreadBasedDispatcherTest.scala b/akka-core/src/test/scala/ThreadBasedDispatcherTest.scala index b9663352c7..c848c56991 100644 --- a/akka-core/src/test/scala/ThreadBasedDispatcherTest.scala +++ b/akka-core/src/test/scala/ThreadBasedDispatcherTest.scala @@ -78,7 +78,7 @@ class ThreadBasedDispatcherTest extends JUnitSuite { }) dispatcher.start for (i <- 0 until 100) { - dispatcher.dispatch(new MessageInvocation(key1, new Integer(i), None, None, None)) + dispatcher.dispatch(new MessageInvocation(key1, i, None, None, None)) } assert(handleLatch.await(5, TimeUnit.SECONDS)) assert(!threadingIssueDetected.get) From 7e517ede0d6748c510b8c0bbd642ab0b2cd772d1 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 13 Mar 2010 14:08:30 +0100 Subject: [PATCH 20/21] Revert to Atmosphere 0.5.4 because of issue in 0.6-SNAPSHOT --- project/build/AkkaProject.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 2df647a5bd..c3c7211d97 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -42,7 +42,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ // project versions val JERSEY_VERSION = "1.1.5" - val ATMO_VERSION = "0.6-SNAPSHOT" + val ATMO_VERSION = "0.5.4" val CASSANDRA_VERSION = "0.5.0" // ------------------------------------------------------------ From ae0ef2d06c313e813fb995bb5cac420cca03d2dc Mon Sep 17 00:00:00 2001 From: Martin Krasser Date: Mon, 15 Mar 2010 11:08:25 +0100 Subject: [PATCH 21/21] OS-specific substring search in paths (fixes 'sbt dist' issue on Windows) --- project/build/AkkaProject.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index c3c7211d97..891126f22e 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -358,7 +358,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { def deployTask(info: ProjectInfo, toDir: Path) = task { val projectPath = info.projectPath.toString - val moduleName = projectPath.substring(projectPath.lastIndexOf('/') + 1, projectPath.length) + val moduleName = projectPath.substring(projectPath.lastIndexOf(System.getProperty("file.separator")) + 1, projectPath.length) // FIXME need to find out a way to grab these paths from the sbt system val JAR_FILE_NAME = moduleName + "_%s-%s.jar".format(defScalaVersion.value, version) val JAR_FILE_PATH = projectPath + "/target/scala_%s/".format(defScalaVersion.value) + JAR_FILE_NAME