diff --git a/.gitignore b/.gitignore index 22379bef4c..69dd6d55c9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ *~ *# +project/boot/* +*/project/build/target +*/project/boot +lib_managed etags TAGS reports 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-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/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-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-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-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 87% rename from akka-kernel/src/main/scala/BootableCometActorService.scala rename to akka-comet/src/main/scala/BootableCometActorService.scala index b014fcb9ad..496cc33aed 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() @@ -42,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) diff --git a/akka-core/pom.xml b/akka-core/pom.xml deleted file mode 100644 index d2116cd0f1..0000000000 --- a/akka-core/pom.xml +++ /dev/null @@ -1,116 +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.multiverse - multiverse-alpha - 0.4-SNAPSHOT - - - 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-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 b027dbcc3a..5c80620d80 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 f68e9929d4..8aaec0661b 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 1588e48a92..7156c999bc 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} @@ -73,20 +73,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]) } /** @@ -256,7 +256,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 6da2ceea99..8a40049fea 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/MemoryTest.scala b/akka-core/src/test/scala/MemoryTest.scala index 2a56d61465..5684496c02 100644 --- a/akka-core/src/test/scala/MemoryTest.scala +++ b/akka-core/src/test/scala/MemoryTest.scala @@ -22,9 +22,11 @@ class MemoryFootprintTest extends JUnitSuite { // Actors are put in AspectRegistry when created so they won't be GCd here val totalMem = Runtime.getRuntime.totalMemory - Runtime.getRuntime.freeMemory + println("Memory before " + totalMem) (1 until NR_OF_ACTORS).foreach(i => new Mem) val newTotalMem = Runtime.getRuntime.totalMemory - Runtime.getRuntime.freeMemory + println("Memory aftor " + newTotalMem) val memPerActor = (newTotalMem - totalMem) / NR_OF_ACTORS println("Memory footprint per actor is : " + memPerActor) 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() { 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/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-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) diff --git a/akka-fun-test-java/pom.xml b/akka-fun-test-java/pom.xml old mode 100644 new mode 100755 index beb19f25c5..5c55cf0be5 --- a/akka-fun-test-java/pom.xml +++ b/akka-fun-test-java/pom.xml @@ -5,31 +5,43 @@ Akka Functional Tests in Java akka-fun-test-java - + se.scalablesolutions.akka + 0.7-SNAPSHOT jar - - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - + + 2.7.7 + 0.5.2 + 1.1.5 + 1.9.18-i + akka-kernel - ${project.groupId} - ${project.version} + se.scalablesolutions.akka + 0.7-SNAPSHOT - ${project.groupId} + se.scalablesolutions.akka akka-persistence-cassandra - ${project.version} + 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 @@ -94,7 +106,6 @@ maven-surefire-plugin - **/InMemNestedStateTest* **/*Persistent* diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java index d328f2452d..69f74ec537 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java @@ -9,7 +9,7 @@ import com.google.inject.Scopes; import junit.framework.TestCase; -import se.scalablesolutions.akka.Config; +import se.scalablesolutions.akka.config.Config; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.dispatch.*; diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java index 366403ef46..992c188fa1 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java @@ -4,12 +4,12 @@ package se.scalablesolutions.akka.api; -import se.scalablesolutions.akka.Config; import se.scalablesolutions.akka.config.*; +import se.scalablesolutions.akka.config.Config; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.actor.*; -import se.scalablesolutions.akka.Kernel; +import se.scalablesolutions.akka.kernel.Kernel; import junit.framework.TestCase; public class InMemNestedStateTest extends TestCase { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java index 60b2008716..8bc60ad922 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java @@ -4,7 +4,7 @@ import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.prerestart; import se.scalablesolutions.akka.annotation.postrestart; import se.scalablesolutions.akka.annotation.inittransactionalstate; -import se.scalablesolutions.akka.state.*; +import se.scalablesolutions.akka.stm.*; @transactionrequired public class InMemStateful { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java index abaedf8ae9..ca6b345766 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java @@ -2,7 +2,7 @@ package se.scalablesolutions.akka.api; import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.inittransactionalstate; -import se.scalablesolutions.akka.state.*; +import se.scalablesolutions.akka.stm.*; @transactionrequired public class InMemStatefulNested { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java index aa2704685f..740bfd892c 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java @@ -6,14 +6,14 @@ package se.scalablesolutions.akka.api; import junit.framework.TestCase; -import se.scalablesolutions.akka.Config; +import se.scalablesolutions.akka.config.Config; import se.scalablesolutions.akka.config.*; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.actor.*; -import se.scalablesolutions.akka.Kernel; +import se.scalablesolutions.akka.kernel.Kernel; public class InMemoryStateTest extends TestCase { static String messageLog = ""; diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java index cd856b64df..080c1cbd0b 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java @@ -4,7 +4,7 @@ public class PersistenceManager { private static volatile boolean isRunning = false; public static void init() { if (!isRunning) { - se.scalablesolutions.akka.Kernel$.MODULE$.startRemoteService(); + se.scalablesolutions.akka.kernel.Kernel$.MODULE$.startRemoteService(); isRunning = true; } } diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java index d5360da3bc..caa755ab83 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java @@ -1,6 +1,7 @@ package se.scalablesolutions.akka.api; -import se.scalablesolutions.akka.state.*; +import se.scalablesolutions.akka.persistence.common.*; +import se.scalablesolutions.akka.persistence.cassandra.*; import se.scalablesolutions.akka.annotation.inittransactionalstate; public class PersistentClasher { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java index 7fd3a65dfb..796d3d913a 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java @@ -8,7 +8,7 @@ import se.scalablesolutions.akka.config.*; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.actor.*; - import se.scalablesolutions.akka.Kernel; +import se.scalablesolutions.akka.kernel.Kernel; import junit.framework.TestCase; diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java index 3cac0ae062..176c551e13 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java @@ -2,7 +2,8 @@ package se.scalablesolutions.akka.api; import se.scalablesolutions.akka.annotation.inittransactionalstate; import se.scalablesolutions.akka.annotation.transactionrequired; -import se.scalablesolutions.akka.state.*; +import se.scalablesolutions.akka.persistence.common.*; +import se.scalablesolutions.akka.persistence.cassandra.*; @transactionrequired public class PersistentStateful { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java index 50e9b7ae1d..a919279c0a 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java @@ -2,7 +2,8 @@ package se.scalablesolutions.akka.api; import se.scalablesolutions.akka.annotation.inittransactionalstate; import se.scalablesolutions.akka.annotation.transactionrequired; -import se.scalablesolutions.akka.state.*; +import se.scalablesolutions.akka.persistence.common.*; +import se.scalablesolutions.akka.persistence.cassandra.*; @transactionrequired public class PersistentStatefulNested { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java index d2f67e4bc7..d0c22470e2 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java +++ b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java @@ -4,7 +4,7 @@ package se.scalablesolutions.akka.api; -import se.scalablesolutions.akka.Config; +import se.scalablesolutions.akka.config.Config; import se.scalablesolutions.akka.actor.ActiveObject; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import se.scalablesolutions.akka.remote.RemoteNode; 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-kernel/src/main/scala/Kernel.scala b/akka-kernel/src/main/scala/Kernel.scala index 7b2b2e4693..d7c7a4b2a5 100644 --- a/akka-kernel/src/main/scala/Kernel.scala +++ b/akka-kernel/src/main/scala/Kernel.scala @@ -2,11 +2,13 @@ * 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.config.Config +import se.scalablesolutions.akka.util.{Logging, Bootable} import javax.servlet.{ServletContextListener, ServletContextEvent} @@ -27,12 +29,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 +68,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 +84,18 @@ object Kernel extends Logging { (____ /__|_ \__|_ \(____ / \/ \/ \/ \/ """) - log.info(" Running version %s", Config.VERSION) + log.info(" Running version %s", 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/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-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..3019af0436 100644 --- a/akka-patterns/src/test/scala/ActorPatternsTest.scala +++ b/akka-patterns/src/test/scala/ActorPatternsTest.scala @@ -1,11 +1,11 @@ -package se.scalablesolutions.akka.actor +package se.scalablesolutions.akka.patterns - -import config.ScalaConfig._ +import se.scalablesolutions.akka.config.ScalaConfig._ +import se.scalablesolutions.akka.actor.Actor +import se.scalablesolutions.akka.actor.Actor._ +import se.scalablesolutions.akka.util.Logging import org.scalatest.Suite -import patterns.Patterns -import se.scalablesolutions.akka.util.Logging import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.matchers.MustMatchers @@ -14,7 +14,6 @@ import scala.collection.mutable.HashSet @RunWith(classOf[JUnitRunner]) class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMatchers with ActorTestUtil with Logging { - import Actor._ import Patterns._ @Test def testDispatcher = verify(new TestActor { def 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-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/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-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 0bc4d07897..d909f0e4a4 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/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-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/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-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 4d40872fb5..8bca9c6af6 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..9741a9acfd 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 @@ -15,9 +15,9 @@ import se.scalablesolutions.akka.actor.{Actor, Transactor} */ case class NQ(accountNo: String) -case class DQ +case object DQ case class MNDQ(accountNos: List[String], noOfDQs: Int, failer: Actor) -case class SZ +case object SZ class QueueActor extends Transactor { private lazy val accounts = RedisStorage.newQueue 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..cfe704c6ba 100644 --- a/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala +++ b/akka-persistence/akka-persistence-redis/src/test/scala/RedisStorageBackendSpec.scala @@ -1,4 +1,4 @@ -package se.scalablesolutions.akka.state +package se.scalablesolutions.akka.persistence.redis import org.scalatest.Spec import org.scalatest.matchers.ShouldMatchers @@ -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) 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-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-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/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-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala index d03c209706..ff79df252b 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: @@ -203,4 +205,4 @@ object Runner { 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-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-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/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-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/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-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/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/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-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-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-security/src/main/scala/Security.scala b/akka-security/src/main/scala/Security.scala index f6f2b939a1..8a144f4282 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 @@ -86,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) @@ -329,19 +331,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 +351,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-java/pom.xml b/akka-util-java/pom.xml deleted file mode 100644 index 6db055b223..0000000000 --- a/akka-util-java/pom.xml +++ /dev/null @@ -1,46 +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 - - - - - src/main/java - src/test/java - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - **/* - - - - - - 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..0376ff83d9 --- /dev/null +++ b/akka-util-java/project/build/AkkaJavaUtilProject.scala @@ -0,0 +1,17 @@ +import sbt._ + +class AkkaJavaUtilProject(info: ProjectInfo) extends DefaultProject(info) { + + 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") +} 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/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/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 diff --git a/config/akka-reference.conf b/config/akka-reference.conf index 66afda9d30..ca9f1068ea 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -51,7 +51,7 @@ service = on 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 diff --git a/deploy/.keep b/deploy/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 203a7eae92..0000000000 --- a/pom.xml +++ /dev/null @@ -1,566 +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. - * 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-kernel - akka-fun-test-java - akka-samples - akka-spring - - - - 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 - - - repository.codehaus.org - Codehaus Maven Repository - http://repository.codehaus.org - - - snapshots.repository.codehaus.org - Codehaus Maven Snapshot Repository - http://snapshots.repository.codehaus.org - - - 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 - - - - - - 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 - - - - - 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/AkkaProject.scala b/project/build/AkkaProject.scala new file mode 100644 index 0000000000..891126f22e --- /dev/null +++ b/project/build/AkkaProject.scala @@ -0,0 +1,371 @@ +/*------------------------------------------------------------------------------- + Copyright (C) 2009-2010 Scalable Solutions AB + + ---------------------------------------------------- + -------- sbt buildfile for the Akka project -------- + ---------------------------------------------------- + + 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. + +-------------------------------------------------------------------------------*/ + +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.5.4" + val CASSANDRA_VERSION = "0.5.0" + + // ------------------------------------------------------------ + 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" + val codehaus = "Codehaus" at "http://repository.codehaus.org" + val codehaus_snapshots = "Codehaus Snapshots" at "http://snapshots.repository.codehaus.org" + 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 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(_)) + 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, 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_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) + + // ------------------------------------------------------------ + // create executable jar + override def mainClass = Some("se.scalablesolutions.akka.kernel.Main") + + override def packageOptions = + manifestClassPath.map(cp => ManifestAttributes((Attributes.Name.CLASS_PATH, cp))).toList ::: + getMainClass(false).map(MainClass(_)).toList + + // create a manifest with all akka jars and dependency jars on classpath + 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-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) + ) + + // ------------------------------------------------------------ + // 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" + 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_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" + // 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" % "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" % "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) { + 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 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) { + 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 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) { + 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) { + 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) { + 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) { + lazy val dist = deployTask(info, distPath) dependsOn(`package`) describedAs("Deploying") + } + + // 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 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" + } + + 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" % "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) { + 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) { + 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) + } + + // ------------------------------------------------------------ + // helper functions + 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(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(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 + + 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) + } +}