Updated imports to use stm package objects

This commit is contained in:
Peter Vlugter 2010-06-18 20:49:40 +12:00
parent 5acd2fdc97
commit 58be9f03bc
7 changed files with 16 additions and 17 deletions

View file

@ -8,8 +8,8 @@ import se.scalablesolutions.akka.dispatch._
import se.scalablesolutions.akka.config.Config.config
import se.scalablesolutions.akka.config.{AllForOneStrategy, OneForOneStrategy, FaultHandlingStrategy}
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.stm.Transaction.Global._
import se.scalablesolutions.akka.stm.{TransactionConfig, TransactionFactory, TransactionManagement}
import se.scalablesolutions.akka.stm.global._
import se.scalablesolutions.akka.stm.TransactionManagement
import se.scalablesolutions.akka.stm.TransactionManagement._
import se.scalablesolutions.akka.stm.TransactionManagement
import se.scalablesolutions.akka.remote.protocol.RemoteProtocol._

View file

@ -11,7 +11,7 @@ import se.scalablesolutions.akka.actor.Actor._
class RefSpec extends Spec with ShouldMatchers {
describe("A Ref") {
import Transaction.Local._
import local._
it("should optionally accept an initial value") {
val emptyRef = Ref[Int]

View file

@ -16,9 +16,9 @@ class StmSpec extends
ShouldMatchers with
BeforeAndAfterAll {
describe("Transaction.Local") {
describe("Local STM") {
it("should be able to do multiple consecutive atomic {..} statements") {
import Transaction.Local._
import local._
lazy val ref = Ref[Int]()
@ -37,7 +37,7 @@ class StmSpec extends
}
it("should be able to do nested atomic {..} statements") {
import Transaction.Local._
import local._
lazy val ref = Ref[Int]()
@ -59,7 +59,7 @@ class StmSpec extends
}
it("should roll back failing nested atomic {..} statements") {
import Transaction.Local._
import local._
lazy val ref = Ref[Int]()
@ -82,7 +82,7 @@ class StmSpec extends
}
}
describe("Transaction.Global") {
describe("Global STM") {
it("should be able to initialize with atomic {..} block inside actor constructor") {
import GlobalTransactionVectorTestActor._
try {
@ -181,17 +181,17 @@ object GlobalTransactionVectorTestActor {
}
class GlobalTransactionVectorTestActor extends Actor {
import GlobalTransactionVectorTestActor._
import se.scalablesolutions.akka.stm.Transaction.Global
import se.scalablesolutions.akka.stm.global._
private val vector: TransactionalVector[Int] = Global.atomic { TransactionalVector(1) }
private val vector: TransactionalVector[Int] = atomic { TransactionalVector(1) }
def receive = {
case Add(value) =>
Global.atomic { vector + value}
atomic { vector + value}
self.reply(Success)
case Size =>
val size = Global.atomic { vector.size }
val size = atomic { vector.size }
self.reply(size)
}
}

View file

@ -8,7 +8,7 @@ import se.scalablesolutions.akka.actor.{Actor, ActorRef}
import se.scalablesolutions.akka.config.OneForOneStrategy
import Actor._
import se.scalablesolutions.akka.persistence.common.PersistentVector
import se.scalablesolutions.akka.stm.Transaction.Global._
import se.scalablesolutions.akka.stm.global._
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.util.Logging

View file

@ -9,8 +9,7 @@ import scala.util.Random.{nextInt => randomInt}
import se.scalablesolutions.akka
import akka.actor.{ActorRef, Transactor, Scheduler}
import akka.actor.Actor.actorOf
import akka.stm._
import akka.stm.Transaction.Local._
import akka.stm.local._
object Config {
val Dim = 80 // dimensions of square world

View file

@ -1,6 +1,6 @@
import sample.ants._
import sample.ants.Config._
import se.scalablesolutions.akka.stm.Transaction.Local._
import se.scalablesolutions.akka.stm.local._
val scale = 5

View file

@ -10,7 +10,7 @@ import se.scalablesolutions.akka.actor.{SupervisorFactory, Actor, ActorRef, Remo
import se.scalablesolutions.akka.remote.{RemoteNode, RemoteClient}
import se.scalablesolutions.akka.persistence.common.PersistentVector
import se.scalablesolutions.akka.persistence.redis.RedisStorage
import se.scalablesolutions.akka.stm.Transaction.Global._
import se.scalablesolutions.akka.stm.global._
import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.config.OneForOneStrategy
import se.scalablesolutions.akka.util.Logging