Removed STM module. See #1503
* Removed from build. Didn't remove akka-stm directory, contains transactors also. * Replaced usage of org.multiverse.api.latches.StandardLatch in some tests with testkit.TestLatch
This commit is contained in:
parent
5e2dff2356
commit
06a08c5823
13 changed files with 117 additions and 3659 deletions
|
|
@ -9,9 +9,10 @@ import org.scalatest.BeforeAndAfterAll
|
||||||
import akka.testkit.TestEvent._
|
import akka.testkit.TestEvent._
|
||||||
import akka.testkit.EventFilter
|
import akka.testkit.EventFilter
|
||||||
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
||||||
import org.multiverse.api.latches.StandardLatch
|
|
||||||
import akka.testkit.AkkaSpec
|
import akka.testkit.AkkaSpec
|
||||||
import akka.testkit.DefaultTimeout
|
import akka.testkit.DefaultTimeout
|
||||||
|
import akka.testkit.TestLatch
|
||||||
|
import akka.util.duration._
|
||||||
|
|
||||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||||
class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
@ -28,10 +29,10 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
"ensure that slave stays dead after max restarts within time range" in {
|
"ensure that slave stays dead after max restarts within time range" in {
|
||||||
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), 2, 1000)))
|
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), 2, 1000)))
|
||||||
|
|
||||||
val restartLatch = new StandardLatch
|
val restartLatch = new TestLatch
|
||||||
val secondRestartLatch = new StandardLatch
|
val secondRestartLatch = new TestLatch
|
||||||
val countDownLatch = new CountDownLatch(3)
|
val countDownLatch = new CountDownLatch(3)
|
||||||
val stopLatch = new StandardLatch
|
val stopLatch = new TestLatch
|
||||||
|
|
||||||
val slaveProps = Props(new Actor {
|
val slaveProps = Props(new Actor {
|
||||||
|
|
||||||
|
|
@ -42,13 +43,13 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
override def postRestart(reason: Throwable) = {
|
override def postRestart(reason: Throwable) = {
|
||||||
if (!restartLatch.isOpen)
|
if (!restartLatch.isOpen)
|
||||||
restartLatch.open
|
restartLatch.open()
|
||||||
else
|
else
|
||||||
secondRestartLatch.open
|
secondRestartLatch.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def postStop() = {
|
override def postStop() = {
|
||||||
stopLatch.open
|
stopLatch.open()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
val slave = (boss ? slaveProps).as[ActorRef].get
|
val slave = (boss ? slaveProps).as[ActorRef].get
|
||||||
|
|
@ -58,17 +59,17 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
// test restart and post restart ping
|
// test restart and post restart ping
|
||||||
assert(restartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(restartLatch.await(10 seconds))
|
||||||
|
|
||||||
// now crash again... should not restart
|
// now crash again... should not restart
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
assert(secondRestartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(secondRestartLatch.await(10 seconds))
|
||||||
assert(countDownLatch.await(10, TimeUnit.SECONDS))
|
assert(countDownLatch.await(10, TimeUnit.SECONDS))
|
||||||
|
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
assert(stopLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(stopLatch.await(10 seconds))
|
||||||
}
|
}
|
||||||
|
|
||||||
"ensure that slave is immortal without max restarts and time range" in {
|
"ensure that slave is immortal without max restarts and time range" in {
|
||||||
|
|
@ -96,11 +97,11 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
"ensure that slave restarts after number of crashes not within time range" in {
|
"ensure that slave restarts after number of crashes not within time range" in {
|
||||||
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), 2, 500)))
|
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), 2, 500)))
|
||||||
|
|
||||||
val restartLatch = new StandardLatch
|
val restartLatch = new TestLatch
|
||||||
val secondRestartLatch = new StandardLatch
|
val secondRestartLatch = new TestLatch
|
||||||
val thirdRestartLatch = new StandardLatch
|
val thirdRestartLatch = new TestLatch
|
||||||
val pingLatch = new StandardLatch
|
val pingLatch = new TestLatch
|
||||||
val secondPingLatch = new StandardLatch
|
val secondPingLatch = new TestLatch
|
||||||
|
|
||||||
val slaveProps = Props(new Actor {
|
val slaveProps = Props(new Actor {
|
||||||
|
|
||||||
|
|
@ -111,16 +112,16 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
}
|
}
|
||||||
override def postRestart(reason: Throwable) = {
|
override def postRestart(reason: Throwable) = {
|
||||||
if (!restartLatch.isOpen)
|
if (!restartLatch.isOpen)
|
||||||
restartLatch.open
|
restartLatch.open()
|
||||||
else if (!secondRestartLatch.isOpen)
|
else if (!secondRestartLatch.isOpen)
|
||||||
secondRestartLatch.open
|
secondRestartLatch.open()
|
||||||
else
|
else
|
||||||
thirdRestartLatch.open
|
thirdRestartLatch.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def postStop() = {
|
override def postStop() = {
|
||||||
if (restartLatch.isOpen) {
|
if (restartLatch.isOpen) {
|
||||||
secondRestartLatch.open
|
secondRestartLatch.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -129,14 +130,14 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
|
|
||||||
assert(restartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(restartLatch.await(10 seconds))
|
||||||
assert(pingLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(pingLatch.await(10 seconds))
|
||||||
|
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
|
|
||||||
assert(secondRestartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(secondRestartLatch.await(10 seconds))
|
||||||
assert(secondPingLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(secondPingLatch.await(10 seconds))
|
||||||
|
|
||||||
// sleep to go out of the restart strategy's time range
|
// sleep to go out of the restart strategy's time range
|
||||||
sleep(700L)
|
sleep(700L)
|
||||||
|
|
@ -145,7 +146,7 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
assert(thirdRestartLatch.tryAwait(1, TimeUnit.SECONDS))
|
assert(thirdRestartLatch.await(1 second))
|
||||||
|
|
||||||
assert(!slave.isTerminated)
|
assert(!slave.isTerminated)
|
||||||
}
|
}
|
||||||
|
|
@ -153,10 +154,10 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
"ensure that slave is not restarted after max retries" in {
|
"ensure that slave is not restarted after max retries" in {
|
||||||
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), Some(2), None)))
|
val boss = system.actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), Some(2), None)))
|
||||||
|
|
||||||
val restartLatch = new StandardLatch
|
val restartLatch = new TestLatch
|
||||||
val secondRestartLatch = new StandardLatch
|
val secondRestartLatch = new TestLatch
|
||||||
val countDownLatch = new CountDownLatch(3)
|
val countDownLatch = new CountDownLatch(3)
|
||||||
val stopLatch = new StandardLatch
|
val stopLatch = new TestLatch
|
||||||
|
|
||||||
val slaveProps = Props(new Actor {
|
val slaveProps = Props(new Actor {
|
||||||
|
|
||||||
|
|
@ -166,13 +167,13 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
}
|
}
|
||||||
override def postRestart(reason: Throwable) = {
|
override def postRestart(reason: Throwable) = {
|
||||||
if (!restartLatch.isOpen)
|
if (!restartLatch.isOpen)
|
||||||
restartLatch.open
|
restartLatch.open()
|
||||||
else
|
else
|
||||||
secondRestartLatch.open
|
secondRestartLatch.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def postStop() = {
|
override def postStop() = {
|
||||||
stopLatch.open
|
stopLatch.open()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
val slave = (boss ? slaveProps).as[ActorRef].get
|
val slave = (boss ? slaveProps).as[ActorRef].get
|
||||||
|
|
@ -182,7 +183,7 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
// test restart and post restart ping
|
// test restart and post restart ping
|
||||||
assert(restartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(restartLatch.await(10 seconds))
|
||||||
|
|
||||||
assert(!slave.isTerminated)
|
assert(!slave.isTerminated)
|
||||||
|
|
||||||
|
|
@ -190,25 +191,25 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
assert(secondRestartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(secondRestartLatch.await(10 seconds))
|
||||||
assert(countDownLatch.await(10, TimeUnit.SECONDS))
|
assert(countDownLatch.await(10, TimeUnit.SECONDS))
|
||||||
|
|
||||||
sleep(700L)
|
sleep(700L)
|
||||||
|
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
assert(stopLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(stopLatch.await(10 seconds))
|
||||||
sleep(500L)
|
sleep(500L)
|
||||||
assert(slave.isTerminated)
|
assert(slave.isTerminated)
|
||||||
}
|
}
|
||||||
|
|
||||||
"ensure that slave is not restarted within time range" in {
|
"ensure that slave is not restarted within time range" in {
|
||||||
val restartLatch, stopLatch, maxNoOfRestartsLatch = new StandardLatch
|
val restartLatch, stopLatch, maxNoOfRestartsLatch = new TestLatch
|
||||||
val countDownLatch = new CountDownLatch(2)
|
val countDownLatch = new CountDownLatch(2)
|
||||||
|
|
||||||
val boss = system.actorOf(Props(new Actor {
|
val boss = system.actorOf(Props(new Actor {
|
||||||
def receive = {
|
def receive = {
|
||||||
case p: Props ⇒ sender ! context.watch(context.actorOf(p))
|
case p: Props ⇒ sender ! context.watch(context.actorOf(p))
|
||||||
case t: Terminated ⇒ maxNoOfRestartsLatch.open
|
case t: Terminated ⇒ maxNoOfRestartsLatch.open()
|
||||||
}
|
}
|
||||||
}).withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), None, Some(1000))))
|
}).withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), None, Some(1000))))
|
||||||
|
|
||||||
|
|
@ -220,11 +221,11 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
}
|
}
|
||||||
|
|
||||||
override def postRestart(reason: Throwable) = {
|
override def postRestart(reason: Throwable) = {
|
||||||
restartLatch.open
|
restartLatch.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def postStop() = {
|
override def postStop() = {
|
||||||
stopLatch.open
|
stopLatch.open()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
val slave = (boss ? slaveProps).as[ActorRef].get
|
val slave = (boss ? slaveProps).as[ActorRef].get
|
||||||
|
|
@ -234,7 +235,7 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
slave ! Ping
|
slave ! Ping
|
||||||
|
|
||||||
// test restart and post restart ping
|
// test restart and post restart ping
|
||||||
assert(restartLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(restartLatch.await(10 seconds))
|
||||||
|
|
||||||
assert(!slave.isTerminated)
|
assert(!slave.isTerminated)
|
||||||
|
|
||||||
|
|
@ -248,9 +249,9 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout {
|
||||||
// may not be running
|
// may not be running
|
||||||
slave ! Crash
|
slave ! Crash
|
||||||
|
|
||||||
assert(stopLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(stopLatch.await(10 seconds))
|
||||||
|
|
||||||
assert(maxNoOfRestartsLatch.tryAwait(10, TimeUnit.SECONDS))
|
assert(maxNoOfRestartsLatch.await(10 seconds))
|
||||||
sleep(500L)
|
sleep(500L)
|
||||||
assert(slave.isTerminated)
|
assert(slave.isTerminated)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package akka.actor
|
package akka.actor
|
||||||
|
|
||||||
import org.scalatest.BeforeAndAfterEach
|
import org.scalatest.BeforeAndAfterEach
|
||||||
import org.multiverse.api.latches.StandardLatch
|
|
||||||
import akka.testkit.AkkaSpec
|
import akka.testkit.AkkaSpec
|
||||||
import akka.testkit.EventFilter
|
import akka.testkit.EventFilter
|
||||||
import akka.util.duration._
|
import akka.util.duration._
|
||||||
import java.util.concurrent.{ CountDownLatch, ConcurrentLinkedQueue, TimeUnit }
|
import java.util.concurrent.{ CountDownLatch, ConcurrentLinkedQueue, TimeUnit }
|
||||||
import akka.testkit.DefaultTimeout
|
import akka.testkit.DefaultTimeout
|
||||||
|
import akka.testkit.TestLatch
|
||||||
|
|
||||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||||
class SchedulerSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout {
|
class SchedulerSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout {
|
||||||
|
|
@ -101,7 +101,7 @@ class SchedulerSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout
|
||||||
object Ping
|
object Ping
|
||||||
object Crash
|
object Crash
|
||||||
|
|
||||||
val restartLatch = new StandardLatch
|
val restartLatch = new TestLatch
|
||||||
val pingLatch = new CountDownLatch(6)
|
val pingLatch = new CountDownLatch(6)
|
||||||
|
|
||||||
val supervisor = system.actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 3, 1000)))
|
val supervisor = system.actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 3, 1000)))
|
||||||
|
|
@ -121,7 +121,7 @@ class SchedulerSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout
|
||||||
collectCancellable(system.scheduler.scheduleOnce(1000 milliseconds, actor, Crash))
|
collectCancellable(system.scheduler.scheduleOnce(1000 milliseconds, actor, Crash))
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(restartLatch.tryAwait(2, TimeUnit.SECONDS))
|
assert(restartLatch.await(2 seconds))
|
||||||
// should be enough time for the ping countdown to recover and reach 6 pings
|
// should be enough time for the ping countdown to recover and reach 6 pings
|
||||||
assert(pingLatch.await(4, TimeUnit.SECONDS))
|
assert(pingLatch.await(4, TimeUnit.SECONDS))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ import org.scalacheck.Gen._
|
||||||
import akka.actor._
|
import akka.actor._
|
||||||
import akka.testkit.{ EventFilter, filterEvents, filterException }
|
import akka.testkit.{ EventFilter, filterEvents, filterException }
|
||||||
import akka.util.duration._
|
import akka.util.duration._
|
||||||
import org.multiverse.api.latches.StandardLatch
|
|
||||||
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
import java.util.concurrent.{ TimeUnit, CountDownLatch }
|
||||||
import akka.testkit.AkkaSpec
|
import akka.testkit.AkkaSpec
|
||||||
import org.scalatest.junit.JUnitSuite
|
import org.scalatest.junit.JUnitSuite
|
||||||
import java.lang.ArithmeticException
|
import java.lang.ArithmeticException
|
||||||
import akka.testkit.DefaultTimeout
|
import akka.testkit.DefaultTimeout
|
||||||
|
import akka.testkit.TestLatch
|
||||||
|
|
||||||
object FutureSpec {
|
object FutureSpec {
|
||||||
class TestActor extends Actor {
|
class TestActor extends Actor {
|
||||||
|
|
@ -26,7 +26,7 @@ object FutureSpec {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestDelayActor(await: StandardLatch) extends Actor {
|
class TestDelayActor(await: TestLatch) extends Actor {
|
||||||
def receive = {
|
def receive = {
|
||||||
case "Hello" ⇒ await.await; sender ! "World"
|
case "Hello" ⇒ await.await; sender ! "World"
|
||||||
case "NoReply" ⇒ await.await
|
case "NoReply" ⇒ await.await
|
||||||
|
|
@ -70,26 +70,26 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
"awaiting a result" that {
|
"awaiting a result" that {
|
||||||
"is not completed" must {
|
"is not completed" must {
|
||||||
behave like emptyFuture { test ⇒
|
behave like emptyFuture { test ⇒
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val result = "test value"
|
val result = "test value"
|
||||||
val future = Future {
|
val future = Future {
|
||||||
latch.await
|
latch.await
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
test(future)
|
test(future)
|
||||||
latch.open
|
latch.open()
|
||||||
future.await
|
future.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"is completed" must {
|
"is completed" must {
|
||||||
behave like futureWithResult { test ⇒
|
behave like futureWithResult { test ⇒
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val result = "test value"
|
val result = "test value"
|
||||||
val future = Future {
|
val future = Future {
|
||||||
latch.await
|
latch.await
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
latch.open
|
latch.open()
|
||||||
future.await
|
future.await
|
||||||
test(future, result)
|
test(future, result)
|
||||||
}
|
}
|
||||||
|
|
@ -392,10 +392,10 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
}
|
}
|
||||||
|
|
||||||
"receiveShouldExecuteOnComplete" in {
|
"receiveShouldExecuteOnComplete" in {
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val actor = system.actorOf(Props[TestActor])
|
val actor = system.actorOf(Props[TestActor])
|
||||||
actor ? "Hello" onResult { case "World" ⇒ latch.open }
|
actor ? "Hello" onResult { case "World" ⇒ latch.open() }
|
||||||
assert(latch.tryAwait(5, TimeUnit.SECONDS))
|
assert(latch.await(5 seconds))
|
||||||
actor.stop()
|
actor.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -425,12 +425,12 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
f1.await
|
f1.await
|
||||||
intercept[ThrowableTest] { f1.get }
|
intercept[ThrowableTest] { f1.get }
|
||||||
|
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val f2 = Future { latch.tryAwait(5, TimeUnit.SECONDS); "success" }
|
val f2 = Future { latch.await(5 seconds); "success" }
|
||||||
f2 foreach (_ ⇒ throw new ThrowableTest("dispatcher foreach"))
|
f2 foreach (_ ⇒ throw new ThrowableTest("dispatcher foreach"))
|
||||||
f2 onResult { case _ ⇒ throw new ThrowableTest("dispatcher receive") }
|
f2 onResult { case _ ⇒ throw new ThrowableTest("dispatcher receive") }
|
||||||
val f3 = f2 map (s ⇒ s.toUpperCase)
|
val f3 = f2 map (s ⇒ s.toUpperCase)
|
||||||
latch.open
|
latch.open()
|
||||||
f2.await
|
f2.await
|
||||||
assert(f2.get === "success")
|
assert(f2.get === "success")
|
||||||
f2 foreach (_ ⇒ throw new ThrowableTest("current thread foreach"))
|
f2 foreach (_ ⇒ throw new ThrowableTest("current thread foreach"))
|
||||||
|
|
@ -441,13 +441,13 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
}
|
}
|
||||||
|
|
||||||
"shouldBlockUntilResult" in {
|
"shouldBlockUntilResult" in {
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
|
|
||||||
val f = Future({ latch.await; 5 })
|
val f = Future({ latch.await; 5 })
|
||||||
val f2 = Future({ f.get + 5 })
|
val f2 = Future({ f.get + 5 })
|
||||||
|
|
||||||
assert(f2.resultOrException === None)
|
assert(f2.resultOrException === None)
|
||||||
latch.open
|
latch.open()
|
||||||
assert(f2.get === 10)
|
assert(f2.get === 10)
|
||||||
|
|
||||||
val f3 = Future({ Thread.sleep(10); 5 }, 10 millis)
|
val f3 = Future({ Thread.sleep(10); 5 }, 10 millis)
|
||||||
|
|
@ -520,19 +520,19 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
import Future.flow
|
import Future.flow
|
||||||
|
|
||||||
val x, y, z = Promise[Int]()
|
val x, y, z = Promise[Int]()
|
||||||
val ly, lz = new StandardLatch
|
val ly, lz = new TestLatch
|
||||||
|
|
||||||
val result = flow {
|
val result = flow {
|
||||||
y completeWith x
|
y completeWith x
|
||||||
ly.open // not within continuation
|
ly.open() // not within continuation
|
||||||
|
|
||||||
z << x
|
z << x
|
||||||
lz.open // within continuation, will wait for 'z' to complete
|
lz.open() // within continuation, will wait for 'z' to complete
|
||||||
z() + y()
|
z() + y()
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(ly.tryAwaitUninterruptible(100, TimeUnit.MILLISECONDS))
|
assert(ly.await(100 milliseconds))
|
||||||
assert(!lz.tryAwaitUninterruptible(100, TimeUnit.MILLISECONDS))
|
lz.awaitTimeout(100 milliseconds)
|
||||||
|
|
||||||
flow { x << 5 }
|
flow { x << 5 }
|
||||||
|
|
||||||
|
|
@ -557,10 +557,10 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
}
|
}
|
||||||
|
|
||||||
"shouldNotAddOrRunCallbacksAfterFailureToBeCompletedBeforeExpiry" in {
|
"shouldNotAddOrRunCallbacksAfterFailureToBeCompletedBeforeExpiry" in {
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val f = Promise[Int](0)
|
val f = Promise[Int](0)
|
||||||
Thread.sleep(25)
|
Thread.sleep(25)
|
||||||
f.onComplete(_ ⇒ latch.open) //Shouldn't throw any exception here
|
f.onComplete(_ ⇒ latch.open()) //Shouldn't throw any exception here
|
||||||
|
|
||||||
assert(f.isExpired) //Should be expired
|
assert(f.isExpired) //Should be expired
|
||||||
|
|
||||||
|
|
@ -599,7 +599,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
"futureDataFlowShouldEmulateBlocking2" in {
|
"futureDataFlowShouldEmulateBlocking2" in {
|
||||||
import Future.flow
|
import Future.flow
|
||||||
val x1, x2, y1, y2 = Promise[Int](1000 * 60)
|
val x1, x2, y1, y2 = Promise[Int](1000 * 60)
|
||||||
val lx, ly, lz = new StandardLatch
|
val lx, ly, lz = new TestLatch
|
||||||
val result = flow {
|
val result = flow {
|
||||||
lx.open()
|
lx.open()
|
||||||
x1 << y1
|
x1 << y1
|
||||||
|
|
@ -608,20 +608,20 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
lz.open()
|
lz.open()
|
||||||
x1() + x2()
|
x1() + x2()
|
||||||
}
|
}
|
||||||
assert(lx.tryAwaitUninterruptible(2000, TimeUnit.MILLISECONDS))
|
assert(lx.await(2000 milliseconds))
|
||||||
assert(!ly.isOpen)
|
assert(!ly.isOpen)
|
||||||
assert(!lz.isOpen)
|
assert(!lz.isOpen)
|
||||||
assert(List(x1, x2, y1, y2).forall(_.isCompleted == false))
|
assert(List(x1, x2, y1, y2).forall(_.isCompleted == false))
|
||||||
|
|
||||||
flow { y1 << 1 } // When this is set, it should cascade down the line
|
flow { y1 << 1 } // When this is set, it should cascade down the line
|
||||||
|
|
||||||
assert(ly.tryAwaitUninterruptible(2000, TimeUnit.MILLISECONDS))
|
assert(ly.await(2000 milliseconds))
|
||||||
assert(x1.get === 1)
|
assert(x1.get === 1)
|
||||||
assert(!lz.isOpen)
|
assert(!lz.isOpen)
|
||||||
|
|
||||||
flow { y2 << 9 } // When this is set, it should cascade down the line
|
flow { y2 << 9 } // When this is set, it should cascade down the line
|
||||||
|
|
||||||
assert(lz.tryAwaitUninterruptible(2000, TimeUnit.MILLISECONDS))
|
assert(lz.await(2000 milliseconds))
|
||||||
assert(x2.get === 9)
|
assert(x2.get === 9)
|
||||||
|
|
||||||
assert(List(x1, x2, y1, y2).forall(_.isCompleted == true))
|
assert(List(x1, x2, y1, y2).forall(_.isCompleted == true))
|
||||||
|
|
@ -632,20 +632,20 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
"dataFlowAPIshouldbeSlick" in {
|
"dataFlowAPIshouldbeSlick" in {
|
||||||
import Future.flow
|
import Future.flow
|
||||||
|
|
||||||
val i1, i2, s1, s2 = new StandardLatch
|
val i1, i2, s1, s2 = new TestLatch
|
||||||
|
|
||||||
val callService1 = Future { i1.open; s1.awaitUninterruptible; 1 }
|
val callService1 = Future { i1.open(); s1.await; 1 }
|
||||||
val callService2 = Future { i2.open; s2.awaitUninterruptible; 9 }
|
val callService2 = Future { i2.open(); s2.await; 9 }
|
||||||
|
|
||||||
val result = flow { callService1() + callService2() }
|
val result = flow { callService1() + callService2() }
|
||||||
|
|
||||||
assert(!s1.isOpen)
|
assert(!s1.isOpen)
|
||||||
assert(!s2.isOpen)
|
assert(!s2.isOpen)
|
||||||
assert(!result.isCompleted)
|
assert(!result.isCompleted)
|
||||||
assert(i1.tryAwaitUninterruptible(2000, TimeUnit.MILLISECONDS))
|
assert(i1.await(2000 milliseconds))
|
||||||
assert(i2.tryAwaitUninterruptible(2000, TimeUnit.MILLISECONDS))
|
assert(i2.await(2000 milliseconds))
|
||||||
s1.open
|
s1.open()
|
||||||
s2.open
|
s2.open()
|
||||||
assert(result.get === 10)
|
assert(result.get === 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -654,19 +654,19 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
import Future.flow
|
import Future.flow
|
||||||
|
|
||||||
val x, y, z = Promise[Int]()
|
val x, y, z = Promise[Int]()
|
||||||
val ly, lz = new StandardLatch
|
val ly, lz = new TestLatch
|
||||||
|
|
||||||
val result = flow {
|
val result = flow {
|
||||||
y << x
|
y << x
|
||||||
ly.open
|
ly.open()
|
||||||
val oops = 1 / 0
|
val oops = 1 / 0
|
||||||
z << x
|
z << x
|
||||||
lz.open
|
lz.open()
|
||||||
z() + y() + oops
|
z() + y() + oops
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!ly.tryAwaitUninterruptible(100, TimeUnit.MILLISECONDS))
|
ly.awaitTimeout(100 milliseconds)
|
||||||
assert(!lz.tryAwaitUninterruptible(100, TimeUnit.MILLISECONDS))
|
lz.awaitTimeout(100 milliseconds)
|
||||||
|
|
||||||
flow { x << 5 }
|
flow { x << 5 }
|
||||||
|
|
||||||
|
|
@ -680,7 +680,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
"futureContinuationsShouldNotBlock" in {
|
"futureContinuationsShouldNotBlock" in {
|
||||||
import Future.flow
|
import Future.flow
|
||||||
|
|
||||||
val latch = new StandardLatch
|
val latch = new TestLatch
|
||||||
val future = Future {
|
val future = Future {
|
||||||
latch.await
|
latch.await
|
||||||
"Hello"
|
"Hello"
|
||||||
|
|
@ -692,7 +692,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
|
|
||||||
assert(!result.isCompleted)
|
assert(!result.isCompleted)
|
||||||
|
|
||||||
latch.open
|
latch.open()
|
||||||
|
|
||||||
assert(result.get === Some("Hello"))
|
assert(result.get === Some("Hello"))
|
||||||
}
|
}
|
||||||
|
|
@ -763,39 +763,39 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
}
|
}
|
||||||
|
|
||||||
"run callbacks async" in {
|
"run callbacks async" in {
|
||||||
val latch = Vector.fill(10)(new StandardLatch)
|
val latch = Vector.fill(10)(new TestLatch)
|
||||||
|
|
||||||
val f1 = Future { latch(0).open; latch(1).await; "Hello" }
|
val f1 = Future { latch(0).open(); latch(1).await; "Hello" }
|
||||||
val f2 = f1 map { s ⇒ latch(2).open; latch(3).await; s.length }
|
val f2 = f1 map { s ⇒ latch(2).open(); latch(3).await; s.length }
|
||||||
f2 foreach (_ ⇒ latch(4).open)
|
f2 foreach (_ ⇒ latch(4).open())
|
||||||
|
|
||||||
latch(0).await
|
latch(0).await
|
||||||
|
|
||||||
f1 must not be ('completed)
|
f1 must not be ('completed)
|
||||||
f2 must not be ('completed)
|
f2 must not be ('completed)
|
||||||
|
|
||||||
latch(1).open
|
latch(1).open()
|
||||||
latch(2).await
|
latch(2).await
|
||||||
|
|
||||||
f1 must be('completed)
|
f1 must be('completed)
|
||||||
f2 must not be ('completed)
|
f2 must not be ('completed)
|
||||||
|
|
||||||
val f3 = f1 map { s ⇒ latch(5).open; latch(6).await; s.length * 2 }
|
val f3 = f1 map { s ⇒ latch(5).open(); latch(6).await; s.length * 2 }
|
||||||
f3 foreach (_ ⇒ latch(3).open)
|
f3 foreach (_ ⇒ latch(3).open())
|
||||||
|
|
||||||
latch(5).await
|
latch(5).await
|
||||||
|
|
||||||
f3 must not be ('completed)
|
f3 must not be ('completed)
|
||||||
|
|
||||||
latch(6).open
|
latch(6).open()
|
||||||
latch(4).await
|
latch(4).await
|
||||||
|
|
||||||
f2 must be('completed)
|
f2 must be('completed)
|
||||||
f3 must be('completed)
|
f3 must be('completed)
|
||||||
|
|
||||||
val p1 = Promise[String]()
|
val p1 = Promise[String]()
|
||||||
val f4 = p1 map { s ⇒ latch(7).open; latch(8).await; s.length }
|
val f4 = p1 map { s ⇒ latch(7).open(); latch(8).await; s.length }
|
||||||
f4 foreach (_ ⇒ latch(9).open)
|
f4 foreach (_ ⇒ latch(9).open())
|
||||||
|
|
||||||
p1 must not be ('completed)
|
p1 must not be ('completed)
|
||||||
f4 must not be ('completed)
|
f4 must not be ('completed)
|
||||||
|
|
@ -807,7 +807,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
p1 must be('completed)
|
p1 must be('completed)
|
||||||
f4 must not be ('completed)
|
f4 must not be ('completed)
|
||||||
|
|
||||||
latch(8).open
|
latch(8).open()
|
||||||
latch(9).await
|
latch(9).await
|
||||||
|
|
||||||
f4.await must be('completed)
|
f4.await must be('completed)
|
||||||
|
|
@ -817,13 +817,13 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
val simple = Future() map (_ ⇒ (Future(()) map (_ ⇒ ())).get)
|
val simple = Future() map (_ ⇒ (Future(()) map (_ ⇒ ())).get)
|
||||||
simple.await must be('completed)
|
simple.await must be('completed)
|
||||||
|
|
||||||
val l1, l2 = new StandardLatch
|
val l1, l2 = new TestLatch
|
||||||
val complex = Future() map { _ ⇒
|
val complex = Future() map { _ ⇒
|
||||||
Future.blocking()
|
Future.blocking()
|
||||||
val nested = Future()
|
val nested = Future()
|
||||||
nested foreach (_ ⇒ l1.open)
|
nested foreach (_ ⇒ l1.open())
|
||||||
l1.await // make sure nested is completed
|
l1.await // make sure nested is completed
|
||||||
nested foreach (_ ⇒ l2.open)
|
nested foreach (_ ⇒ l2.open())
|
||||||
l2.await
|
l2.await
|
||||||
}
|
}
|
||||||
assert(complex.await.isCompleted)
|
assert(complex.await.isCompleted)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ Java API
|
||||||
logging
|
logging
|
||||||
futures
|
futures
|
||||||
dataflow
|
dataflow
|
||||||
stm
|
|
||||||
transactors
|
transactors
|
||||||
fault-tolerance
|
fault-tolerance
|
||||||
dispatchers
|
dispatchers
|
||||||
|
|
|
||||||
6
akka-docs/java/transactors.rst
Normal file
6
akka-docs/java/transactors.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
.. _transactors-java:
|
||||||
|
|
||||||
|
Transactors (Java)
|
||||||
|
==================
|
||||||
|
|
||||||
|
The Akka Transactors module has not been migrated to Akka 2.0-SNAPSHOT yet.
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,447 +0,0 @@
|
||||||
Migration Guide 0.10.x to 1.0.x
|
|
||||||
====================================
|
|
||||||
|
|
||||||
Akka & Akka Modules separated into two different repositories and distributions
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Akka is split up into two different parts:
|
|
||||||
* Akka - Reflects all the sections under 'Scala API' and 'Java API' in the navigation bar.
|
|
||||||
* Akka Modules - Reflects all the sections under 'Add-on modules' in the navigation bar.
|
|
||||||
|
|
||||||
Download the release you need (Akka core or Akka Modules) from `<http://akka.io/downloads>`_ and unzip it.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Changed Akka URI
|
|
||||||
----------------
|
|
||||||
|
|
||||||
http://akkasource.org changed to http://akka.io
|
|
||||||
|
|
||||||
Reflects XSDs, Maven repositories, ScalaDoc etc.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Removed 'se.scalablesolutions' prefix
|
|
||||||
-------------------------------------
|
|
||||||
|
|
||||||
We have removed some boilerplate by shortening the Akka package from
|
|
||||||
**se.scalablesolutions.akka** to just **akka** so just do a search-replace in your project,
|
|
||||||
we apologize for the inconvenience, but we did it for our users.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Akka-core is no more
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Akka-core has been split into akka-actor, akka-stm, akka-typed-actor & akka-remote this means that you need to update any deps you have on akka-core.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Config
|
|
||||||
------
|
|
||||||
|
|
||||||
Turning on/off modules
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
All the 'service = on' elements for turning modules on and off have been replaced by a top-level list of the enabled services.
|
|
||||||
|
|
||||||
Services available for turning on/off are:
|
|
||||||
* "remote"
|
|
||||||
* "http"
|
|
||||||
* "camel"
|
|
||||||
|
|
||||||
**All** services are **OFF** by default. Enable the ones you are using.
|
|
||||||
|
|
||||||
.. code-block:: ruby
|
|
||||||
|
|
||||||
akka {
|
|
||||||
enabled-modules = [] # Comma separated list of the enabled modules. Options: ["remote", "camel", "http"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Renames
|
|
||||||
^^^^^^^
|
|
||||||
|
|
||||||
* 'rest' section - has been renamed to 'http' to align with the module name 'akka-http'.
|
|
||||||
* 'storage' section - has been renamed to 'persistence' to align with the module name 'akka-persistence'.
|
|
||||||
|
|
||||||
.. code-block:: ruby
|
|
||||||
|
|
||||||
akka {
|
|
||||||
http {
|
|
||||||
..
|
|
||||||
}
|
|
||||||
|
|
||||||
persistence {
|
|
||||||
..
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Important changes from RC2-RC3
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
**akka.config.SupervisionSupervise**
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
def apply(actorRef: ActorRef, lifeCycle: LifeCycle, registerAsRemoteService: Boolean = false)
|
|
||||||
|
|
||||||
- boolean instead of remoteAddress, registers that actor with it's id as service name on the local server
|
|
||||||
|
|
||||||
**akka.actor.Actors now is the API for Java to interact with Actors, Remoting and ActorRegistry:**
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import static akka.actor.Actors.*; // <-- The important part
|
|
||||||
|
|
||||||
actorOf();
|
|
||||||
remote().actorOf();
|
|
||||||
registry().actorsFor("foo");
|
|
||||||
|
|
||||||
***akka.actor.Actor now is the API for Scala to interact with Actors, Remoting and ActorRegistry:***
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import akka.actor.Actor._ // <-- The important part
|
|
||||||
|
|
||||||
actorOf().method
|
|
||||||
remote.actorOf()
|
|
||||||
registry.actorsFor("foo")
|
|
||||||
|
|
||||||
**object UntypedActor has been deleted and replaced with akka.actor.Actors/akka.actor.Actor (Java/Scala)**
|
|
||||||
|
|
||||||
- UntypedActor.actorOf -> Actors.actorOf (Java) or Actor.actorOf (Scala)
|
|
||||||
|
|
||||||
**object ActorRegistry has been deleted and replaced with akka.actor.Actors.registry()/akka.actor.Actor.registry (Java/Scala)**
|
|
||||||
|
|
||||||
- ActorRegistry. -> Actors.registry(). (Java) or Actor.registry. (Scala)
|
|
||||||
|
|
||||||
**object RemoteClient has been deleted and replaced with akka.actor.Actors.remote()/akka.actor.Actor.remote (Java/Scala)**
|
|
||||||
|
|
||||||
- RemoteClient -> Actors.remote() (Java) or Actor.remote (Scala)
|
|
||||||
|
|
||||||
**object RemoteServer has been deleted and replaced with akka.actor.Actors.remote()/akka.actor.Actor.remote (Java/Scala)**
|
|
||||||
|
|
||||||
- RemoteServer - deleted -> Actors.remote() (Java) or Actor.remote (Scala)
|
|
||||||
|
|
||||||
**classes RemoteActor, RemoteUntypedActor and RemoteUntypedConsumerActors has been deleted and replaced with akka.actor.Actors.remote().actorOf(x, host port)/akka.actor.Actor.remote.actorOf(x, host, port)**
|
|
||||||
|
|
||||||
- RemoteActor, RemoteUntypedActor - deleted, use: remote().actorOf(YourActor.class, host, port) (Java) or remote.actorOf(Props[YourActor](host, port)
|
|
||||||
|
|
||||||
**Remoted spring-actors now default to spring id as service-name, use "service-name" attribute on "remote"-tag to override**
|
|
||||||
|
|
||||||
**Listeners for RemoteServer and RemoteClient** are now registered on Actors.remote().addListener (Java) or Actor.remote.addListener (Scala), this means that all listeners get all remote events, both remote server evens and remote client events, **so adjust your code accordingly.**
|
|
||||||
|
|
||||||
**ActorRef.startLinkRemote has been removed since one specified on creation wether the actor is client-managed or not.**
|
|
||||||
|
|
||||||
Important change from RC3 to RC4
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
The Akka-Spring namespace has changed from akkasource.org and scalablesolutions.se to http://akka.io/schema and http://akka.io/akka-<version>.xsd
|
|
||||||
|
|
||||||
Module akka-actor
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
The Actor.init callback has been renamed to "preStart" to align with the general callback naming and is more clear about when it's called.
|
|
||||||
|
|
||||||
The Actor.shutdown callback has been renamed to "postStop" to align with the general callback naming and is more clear about when it's called.
|
|
||||||
|
|
||||||
The Actor.initTransactionalState callback has been removed, logic should be moved to preStart and be wrapped in an atomic block
|
|
||||||
|
|
||||||
**se.scalablesolutions.akka.config.ScalaConfig** and **se.scalablesolutions.akka.config.JavaConfig** have been merged into **akka.config.Supervision**
|
|
||||||
|
|
||||||
**RemoteAddress** has moved from **se.scalablesolutions.akka.config.ScalaConfig** to **akka.config**
|
|
||||||
|
|
||||||
The ActorRef.lifeCycle has changed signature from Option[LifeCycle] to LifeCycle, this means you need to change code that looks like this:
|
|
||||||
**self.lifeCycle = Some(LifeCycle(Permanent))** to **self.lifeCycle = Permanent**
|
|
||||||
|
|
||||||
The equivalent to **self.lifeCycle = None** is **self.lifeCycle = UndefinedLifeCycle**
|
|
||||||
**LifeCycle(Permanent)** becomes **Permanent**
|
|
||||||
**new LifeCycle(permanent())** becomes **permanent()** (need to do: import static se.scalablesolutions.akka.config.Supervision.*; first)
|
|
||||||
|
|
||||||
**JavaConfig.Component** and **ScalaConfig.Component** have been consolidated and renamed as **Supervision.SuperviseTypedActor**
|
|
||||||
|
|
||||||
**self.trapExit** has been moved into the FaultHandlingStrategy, and **ActorRef.faultHandler** has switched type from Option[FaultHandlingStrategy]
|
|
||||||
to FaultHandlingStrategy:
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import akka.config.Supervision._
|
|
||||||
|
|
||||||
self.faultHandler = OneForOneStrategy(List(classOf[Exception]), 3, 5000)
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import static akka.Supervision.*;
|
|
||||||
|
|
||||||
getContext().setFaultHandler(new OneForOneStrategy(new Class[] { Exception.class },50,1000))
|
|
||||||
|
|
||||||
**RestartStrategy, AllForOne, OneForOne** have been replaced with **AllForOneStrategy** and **OneForOneStrategy** in **se.scalablesolutions.akka.config.Supervision**
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import akka.config.Supervision._
|
|
||||||
SupervisorConfig(
|
|
||||||
OneForOneStrategy(List(classOf[Exception]), 3, 5000),
|
|
||||||
Supervise(pingpong1,Permanent) :: Nil
|
|
||||||
)
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import static akka.Supervision.*;
|
|
||||||
|
|
||||||
new SupervisorConfig(
|
|
||||||
new OneForOneStrategy(new Class[] { Exception.class },50,1000),
|
|
||||||
new Server[] { new Supervise(pingpong1, permanent()) }
|
|
||||||
)
|
|
||||||
|
|
||||||
***We have removed the following factory methods:***
|
|
||||||
|
|
||||||
**Actor.actor { case foo => bar }**
|
|
||||||
**Actor.transactor { case foo => bar }**
|
|
||||||
**Actor.temporaryActor { case foo => bar }**
|
|
||||||
**Actor.init {} receive { case foo => bar }**
|
|
||||||
|
|
||||||
They started the actor and no config was possible, it was inconsistent and irreparable.
|
|
||||||
|
|
||||||
replace with your own factories, or:
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
actorOf( new Actor { def receive = { case foo => bar } } ).start
|
|
||||||
actorOf( new Actor { self.lifeCycle = Temporary; def receive = { case foo => bar } } ).start
|
|
||||||
|
|
||||||
ReceiveTimeout is now rescheduled after every message, before there was only an initial timeout.
|
|
||||||
To stop rescheduling of ReceiveTimeout, set **receiveTimeout = None**
|
|
||||||
|
|
||||||
HotSwap
|
|
||||||
-------
|
|
||||||
|
|
||||||
HotSwap does no longer use behavior stacking by default, but that is an option to both "become" and HotSwap.
|
|
||||||
|
|
||||||
HotSwap now takes for Scala a Function from ActorRef to a Receive, the ActorRef passed in is the reference to self, so you can do self.reply() etc.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Module akka-stm
|
|
||||||
---------------
|
|
||||||
|
|
||||||
The STM stuff is now in its own module. This means that there is no support for transactions or transactors in akka-actor.
|
|
||||||
|
|
||||||
Local and global
|
|
||||||
^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The **local/global** distinction has been dropped. This means that if the following general import was being used:
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import akka.stm.local._
|
|
||||||
|
|
||||||
this is now just:
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import akka.stm._
|
|
||||||
|
|
||||||
Coordinated is the new global
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
There is a new explicit mechanism for coordinated transactions. See the `Scala Transactors <transactors-scala>`_ and `Java Transactors <transactors-java>`_ documentation for more information. Coordinated transactions and transactors are found in the ``akka.transactor`` package now. The usage of transactors has changed.
|
|
||||||
|
|
||||||
Agents
|
|
||||||
^^^^^^
|
|
||||||
|
|
||||||
Agent is now in the akka-stm module and has moved to the ``akka.agent`` package. The implementation has been reworked and is now closer to Clojure agents. There is not much difference in general usage, the main changes involve interaction with the STM.
|
|
||||||
|
|
||||||
While updates to Agents are asynchronous, the state of an Agent is always immediately available for reading by any thread. Agents are integrated with the STM - any dispatches made in a transaction are held until that transaction commits, and are discarded if it is retried or aborted. There is a new ``sendOff`` method for long-running or blocking update functions.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Module akka-camel
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Access to the CamelService managed by CamelServiceManager has changed:
|
|
||||||
|
|
||||||
* Method service renamed to mandatoryService (Scala)
|
|
||||||
* Method service now returns Option[CamelService] (Scala)
|
|
||||||
* Introduced method getMandatoryService() (Java)
|
|
||||||
* Introduced method getService() (Java)
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import se.scalablesolutions.akka.camel.CamelServiceManager._
|
|
||||||
import se.scalablesolutions.akka.camel.CamelService
|
|
||||||
|
|
||||||
val o: Option[CamelService] = service
|
|
||||||
val s: CamelService = mandatoryService
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import se.scalablesolutions.akka.camel.CamelService;
|
|
||||||
import se.scalablesolutions.akka.japi.Option;
|
|
||||||
import static se.scalablesolutions.akka.camel.CamelServiceManager.*;
|
|
||||||
|
|
||||||
Option<CamelService> o = getService();
|
|
||||||
CamelService s = getMandatoryService();
|
|
||||||
|
|
||||||
Access to the CamelContext and ProducerTemplate managed by CamelContextManager has changed:
|
|
||||||
|
|
||||||
* Method context renamed to mandatoryContext (Scala)
|
|
||||||
* Method template renamed to mandatoryTemplate (Scala)
|
|
||||||
* Method service now returns Option[CamelContext] (Scala)
|
|
||||||
* Method template now returns Option[ProducerTemplate] (Scala)
|
|
||||||
* Introduced method getMandatoryContext() (Java)
|
|
||||||
* Introduced method getContext() (Java)
|
|
||||||
* Introduced method getMandatoryTemplate() (Java)
|
|
||||||
* Introduced method getTemplate() (Java)
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import org.apache.camel.CamelContext
|
|
||||||
import org.apache.camel.ProducerTemplate
|
|
||||||
|
|
||||||
import se.scalablesolutions.akka.camel.CamelContextManager._
|
|
||||||
|
|
||||||
val co: Option[CamelContext] = context
|
|
||||||
val to: Option[ProducerTemplate] = template
|
|
||||||
|
|
||||||
val c: CamelContext = mandatoryContext
|
|
||||||
val t: ProducerTemplate = mandatoryTemplate
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import org.apache.camel.CamelContext;
|
|
||||||
import org.apache.camel.ProducerTemplate;
|
|
||||||
|
|
||||||
import se.scalablesolutions.akka.japi.Option;
|
|
||||||
import static se.scalablesolutions.akka.camel.CamelContextManager.*;
|
|
||||||
|
|
||||||
Option<CamelContext> co = getContext();
|
|
||||||
Option<ProducerTemplate> to = getTemplate();
|
|
||||||
|
|
||||||
CamelContext c = getMandatoryContext();
|
|
||||||
ProducerTemplate t = getMandatoryTemplate();
|
|
||||||
|
|
||||||
The following methods have been renamed on class se.scalablesolutions.akka.camel.Message:
|
|
||||||
|
|
||||||
* bodyAs(Class) has been renamed to getBodyAs(Class)
|
|
||||||
* headerAs(String, Class) has been renamed to getHeaderAs(String, Class)
|
|
||||||
|
|
||||||
The API for waiting for consumer endpoint activation and de-activation has been changed
|
|
||||||
|
|
||||||
* CamelService.expectEndpointActivationCount has been removed and replaced by CamelService.awaitEndpointActivation
|
|
||||||
* CamelService.expectEndpointDeactivationCount has been removed and replaced by CamelService.awaitEndpointDeactivation
|
|
||||||
|
|
||||||
**Scala**
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import se.scalablesolutions.akka.actor.Actor
|
|
||||||
import se.scalablesolutions.akka.camel.CamelServiceManager._
|
|
||||||
|
|
||||||
val s = startCamelService
|
|
||||||
val actor = Actor.actorOf(Props[SampleConsumer]
|
|
||||||
|
|
||||||
// wait for 1 consumer being activated
|
|
||||||
s.awaitEndpointActivation(1) {
|
|
||||||
actor.start
|
|
||||||
}
|
|
||||||
|
|
||||||
// wait for 1 consumer being de-activated
|
|
||||||
s.awaitEndpointDeactivation(1) {
|
|
||||||
actor.stop
|
|
||||||
}
|
|
||||||
|
|
||||||
s.stop
|
|
||||||
|
|
||||||
**Java**
|
|
||||||
|
|
||||||
.. code-block:: java
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import se.scalablesolutions.akka.actor.ActorRef;
|
|
||||||
import se.scalablesolutions.akka.actor.Actors;
|
|
||||||
import se.scalablesolutions.akka.camel.CamelService;
|
|
||||||
import se.scalablesolutions.akka.japi.SideEffect;
|
|
||||||
import static se.scalablesolutions.akka.camel.CamelServiceManager.*;
|
|
||||||
|
|
||||||
CamelService s = startCamelService();
|
|
||||||
final ActorRef actor = Actors.actorOf(SampleUntypedConsumer.class);
|
|
||||||
|
|
||||||
// wait for 1 consumer being activated
|
|
||||||
s.awaitEndpointActivation(1, new SideEffect() {
|
|
||||||
public void apply() {
|
|
||||||
actor.start();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// wait for 1 consumer being de-activated
|
|
||||||
s.awaitEndpointDeactivation(1, new SideEffect() {
|
|
||||||
public void apply() {
|
|
||||||
actor.stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
s.stop();
|
|
||||||
|
|
||||||
Module Akka-Http
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Atmosphere support has been removed. If you were using akka.comet.AkkaServlet for Jersey support only,
|
|
||||||
you can switch that to: akka.http.AkkaRestServlet and it should work just like before.
|
|
||||||
|
|
||||||
Atmosphere has been removed because we have a new async http support in the form of Akka Mist, a very thin bridge
|
|
||||||
between Servlet3.0/JettyContinuations and Actors, enabling Http-as-messages, read more about it here:
|
|
||||||
http://doc.akka.io/http#Mist%20-%20Lightweight%20Asynchronous%20HTTP
|
|
||||||
|
|
||||||
If you really need Atmosphere support, you can add it yourself by following the steps listed at the start of:
|
|
||||||
http://doc.akka.io/comet
|
|
||||||
|
|
||||||
Module akka-spring
|
|
||||||
------------------
|
|
||||||
|
|
||||||
The Akka XML schema URI has changed to http://akka.io/schema/akka
|
|
||||||
|
|
||||||
.. code-block:: xml
|
|
||||||
|
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns:akka="http://akka.io/schema/akka"
|
|
||||||
xsi:schemaLocation="
|
|
||||||
http://www.springframework.org/schema/beans
|
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
|
||||||
http://akka.io/schema/akka
|
|
||||||
http://akka.io/akka-1.0.xsd">
|
|
||||||
|
|
||||||
<!-- ... -->
|
|
||||||
|
|
||||||
</beans>
|
|
||||||
|
|
@ -1,172 +0,0 @@
|
||||||
Migration Guide 0.8.x to 0.9.x
|
|
||||||
==============================
|
|
||||||
|
|
||||||
**This document describes between the 0.8.x and the 0.9 release.**
|
|
||||||
|
|
||||||
Background for the new ActorRef
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
In the work towards 0.9 release we have now done a major change to how Actors are created. In short we have separated identity and value, created an 'ActorRef' that holds the actual Actor instance. This allows us to do many great things such as for example:
|
|
||||||
|
|
||||||
* Create serializable, immutable, network-aware Actor references that can be freely shared across the network. They "remember" their origin and will always work as expected.
|
|
||||||
* Not only kill and restart the same supervised Actor instance when it has crashed (as we do now), but dereference it, throw it away and make it eligible for garbage collection.
|
|
||||||
* etc. much more
|
|
||||||
|
|
||||||
These work very much like the 'PID' (process id) in Erlang.
|
|
||||||
|
|
||||||
These changes means that there is no difference in defining Actors. You still use the old Actor trait, all methods are there etc. But you can't just new this Actor up and send messages to it since all its public API methods are gone. They now reside in a new class; 'ActorRef' and use need to use instances of this class to interact with the Actor (sending messages etc.).
|
|
||||||
|
|
||||||
Here is a short migration guide with the things that you have to change. It is a big conceptual change but in practice you don't have to change much.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Creating Actors with default constructor
|
|
||||||
----------------------------------------
|
|
||||||
|
|
||||||
From:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val a = new MyActor
|
|
||||||
a ! msg
|
|
||||||
|
|
||||||
To:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import Actor._
|
|
||||||
val a = actorOf(Props[MyActor]
|
|
||||||
a ! msg
|
|
||||||
|
|
||||||
You can also start it in the same statement:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val a = actorOf(Props[MyActor]
|
|
||||||
|
|
||||||
Creating Actors with non-default constructor
|
|
||||||
--------------------------------------------
|
|
||||||
|
|
||||||
From:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val a = new MyActor(..)
|
|
||||||
a ! msg
|
|
||||||
|
|
||||||
To:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
import Actor._
|
|
||||||
val a = actorOf(Props(new MyActor(..))
|
|
||||||
a ! msg
|
|
||||||
|
|
||||||
Use of 'self' ActorRef API
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
Where you have used 'this' to refer to the Actor from within itself now use 'self':
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
self ! MessageToMe
|
|
||||||
|
|
||||||
Now the Actor trait only has the callbacks you can implement:
|
|
||||||
* receive
|
|
||||||
* postRestart/preRestart
|
|
||||||
* init/shutdown
|
|
||||||
|
|
||||||
It has no state at all.
|
|
||||||
|
|
||||||
All API has been moved to ActorRef. The Actor is given its ActorRef through the 'self' member variable.
|
|
||||||
Here you find functions like:
|
|
||||||
* !, !!, !!! and forward
|
|
||||||
* link, unlink, startLink, spawnLink etc
|
|
||||||
* makeTransactional, makeRemote etc.
|
|
||||||
* start, stop
|
|
||||||
* etc.
|
|
||||||
|
|
||||||
Here you also find fields like
|
|
||||||
* dispatcher = ...
|
|
||||||
* id = ...
|
|
||||||
* lifeCycle = ...
|
|
||||||
* faultHandler = ...
|
|
||||||
* trapExit = ...
|
|
||||||
* etc.
|
|
||||||
|
|
||||||
This means that to use them you have to prefix them with 'self', like this:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
self ! Message
|
|
||||||
|
|
||||||
However, for convenience you can import these functions and fields like below, which will allow you do drop the 'self' prefix:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
class MyActor extends Actor {
|
|
||||||
import self._
|
|
||||||
id = ...
|
|
||||||
dispatcher = ...
|
|
||||||
spawnLink[OtherActor]
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
Serialization
|
|
||||||
-------------
|
|
||||||
|
|
||||||
If you want to serialize it yourself, here is how to do it:
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val actorRef1 = actorOf(Props[MyActor]
|
|
||||||
|
|
||||||
val bytes = actorRef1.toBinary
|
|
||||||
|
|
||||||
val actorRef2 = ActorRef.fromBinary(bytes)
|
|
||||||
|
|
||||||
If you are also using Protobuf then you can use the methods that work with Protobuf's Messages directly.
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val actorRef1 = actorOf(Props[MyActor]
|
|
||||||
|
|
||||||
val protobufMessage = actorRef1.toProtocol
|
|
||||||
|
|
||||||
val actorRef2 = ActorRef.fromProtocol(protobufMessage)
|
|
||||||
|
|
||||||
Camel
|
|
||||||
-----
|
|
||||||
|
|
||||||
Some methods of the se.scalablesolutions.akka.camel.Message class have been deprecated in 0.9. These are
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
package se.scalablesolutions.akka.camel
|
|
||||||
|
|
||||||
case class Message(...) {
|
|
||||||
// ...
|
|
||||||
@deprecated def bodyAs[T](clazz: Class[T]): T
|
|
||||||
@deprecated def setBodyAs[T](clazz: Class[T]): Message
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
They will be removed in 1.0. Instead use
|
|
||||||
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
package se.scalablesolutions.akka.camel
|
|
||||||
|
|
||||||
case class Message(...) {
|
|
||||||
// ...
|
|
||||||
def bodyAs[T](implicit m: Manifest[T]): T =
|
|
||||||
def setBodyAs[T](implicit m: Manifest[T]): Message
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
Usage example:
|
|
||||||
.. code-block:: scala
|
|
||||||
|
|
||||||
val m = Message(1.4)
|
|
||||||
val b = m.bodyAs[String]
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
package akka.docs.stm
|
|
||||||
|
|
||||||
import org.scalatest.WordSpec
|
|
||||||
import org.scalatest.matchers.MustMatchers
|
|
||||||
|
|
||||||
class StmDocSpec extends WordSpec with MustMatchers {
|
|
||||||
|
|
||||||
"simple counter example" in {
|
|
||||||
//#simple
|
|
||||||
import akka.stm._
|
|
||||||
|
|
||||||
val ref = Ref(0)
|
|
||||||
|
|
||||||
def counter = atomic {
|
|
||||||
ref alter (_ + 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
counter
|
|
||||||
// -> 1
|
|
||||||
|
|
||||||
counter
|
|
||||||
// -> 2
|
|
||||||
//#simple
|
|
||||||
|
|
||||||
ref.get must be === 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -12,7 +12,6 @@ Scala API
|
||||||
futures
|
futures
|
||||||
dataflow
|
dataflow
|
||||||
agents
|
agents
|
||||||
stm
|
|
||||||
transactors
|
transactors
|
||||||
fault-tolerance
|
fault-tolerance
|
||||||
dispatchers
|
dispatchers
|
||||||
|
|
|
||||||
6
akka-docs/scala/transactors.rst
Normal file
6
akka-docs/scala/transactors.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
.. _transactors-scala:
|
||||||
|
|
||||||
|
Transactors (Scala)
|
||||||
|
===================
|
||||||
|
|
||||||
|
The Akka Transactors module has not been migrated to Akka 2.0-SNAPSHOT yet.
|
||||||
|
|
@ -29,7 +29,9 @@ class TestLatch(count: Int = 1)(implicit system: ActorSystem) {
|
||||||
|
|
||||||
def countDown() = latch.countDown()
|
def countDown() = latch.countDown()
|
||||||
|
|
||||||
def open() = countDown()
|
def isOpen: Boolean = latch.getCount == 0
|
||||||
|
|
||||||
|
def open() = while (!isOpen) countDown()
|
||||||
|
|
||||||
def await(): Boolean = await(TestLatch.DefaultTimeout)
|
def await(): Boolean = await(TestLatch.DefaultTimeout)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ object AkkaBuild extends Build {
|
||||||
Unidoc.unidocExclude := Seq(samples.id, tutorials.id),
|
Unidoc.unidocExclude := Seq(samples.id, tutorials.id),
|
||||||
Dist.distExclude := Seq(actorTests.id, akkaSbtPlugin.id, docs.id)
|
Dist.distExclude := Seq(actorTests.id, akkaSbtPlugin.id, docs.id)
|
||||||
),
|
),
|
||||||
aggregate = Seq(actor, testkit, actorTests, stm, remote, slf4j, amqp, mailboxes, akkaSbtPlugin, samples, tutorials, docs)
|
aggregate = Seq(actor, testkit, actorTests, remote, slf4j, amqp, mailboxes, akkaSbtPlugin, samples, tutorials, docs)
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val actor = Project(
|
lazy val actor = Project(
|
||||||
|
|
@ -66,19 +66,10 @@ object AkkaBuild extends Build {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val stm = Project(
|
|
||||||
id = "akka-stm",
|
|
||||||
base = file("akka-stm"),
|
|
||||||
dependencies = Seq(actor, testkit % "test->test"),
|
|
||||||
settings = defaultSettings ++ Seq(
|
|
||||||
libraryDependencies ++= Dependencies.stm
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
lazy val remote = Project(
|
lazy val remote = Project(
|
||||||
id = "akka-remote",
|
id = "akka-remote",
|
||||||
base = file("akka-remote"),
|
base = file("akka-remote"),
|
||||||
dependencies = Seq(stm, actorTests % "test->test", testkit % "test->test"),
|
dependencies = Seq(actor, actorTests % "test->test", testkit % "test->test"),
|
||||||
settings = defaultSettings ++ multiJvmSettings ++ Seq(
|
settings = defaultSettings ++ multiJvmSettings ++ Seq(
|
||||||
libraryDependencies ++= Dependencies.cluster,
|
libraryDependencies ++= Dependencies.cluster,
|
||||||
extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src =>
|
extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src =>
|
||||||
|
|
@ -256,7 +247,7 @@ object AkkaBuild extends Build {
|
||||||
lazy val docs = Project(
|
lazy val docs = Project(
|
||||||
id = "akka-docs",
|
id = "akka-docs",
|
||||||
base = file("akka-docs"),
|
base = file("akka-docs"),
|
||||||
dependencies = Seq(actor, testkit % "test->test", stm, remote, slf4j, fileMailbox, mongoMailbox, redisMailbox, beanstalkMailbox, zookeeperMailbox),
|
dependencies = Seq(actor, testkit % "test->test", remote, slf4j, fileMailbox, mongoMailbox, redisMailbox, beanstalkMailbox, zookeeperMailbox),
|
||||||
settings = defaultSettings ++ Seq(
|
settings = defaultSettings ++ Seq(
|
||||||
unmanagedSourceDirectories in Test <<= baseDirectory { _ ** "code" get },
|
unmanagedSourceDirectories in Test <<= baseDirectory { _ ** "code" get },
|
||||||
libraryDependencies ++= Dependencies.docs,
|
libraryDependencies ++= Dependencies.docs,
|
||||||
|
|
@ -359,12 +350,10 @@ object Dependencies {
|
||||||
val testkit = Seq(Test.scalatest, Test.junit)
|
val testkit = Seq(Test.scalatest, Test.junit)
|
||||||
|
|
||||||
val actorTests = Seq(
|
val actorTests = Seq(
|
||||||
Test.junit, Test.scalatest, Test.multiverse, Test.commonsMath, Test.mockito,
|
Test.junit, Test.scalatest, Test.commonsMath, Test.mockito,
|
||||||
Test.scalacheck, protobuf, jacksonMapper, sjson
|
Test.scalacheck, protobuf, jacksonMapper, sjson
|
||||||
)
|
)
|
||||||
|
|
||||||
val stm = Seq(multiverse, Test.junit, Test.scalatest)
|
|
||||||
|
|
||||||
val cluster = Seq(
|
val cluster = Seq(
|
||||||
bookkeeper, commonsCodec, commonsIo, guice, h2Lzf, jacksonCore, jacksonMapper, log4j, netty,
|
bookkeeper, commonsCodec, commonsIo, guice, h2Lzf, jacksonCore, jacksonMapper, log4j, netty,
|
||||||
protobuf, sjson, zkClient, zookeeper, zookeeperLock, Test.junit, Test.scalatest
|
protobuf, sjson, zkClient, zookeeper, zookeeperLock, Test.junit, Test.scalatest
|
||||||
|
|
@ -412,7 +401,6 @@ object Dependency {
|
||||||
val Jersey = "1.3"
|
val Jersey = "1.3"
|
||||||
val Jetty = "7.4.0.v20110414"
|
val Jetty = "7.4.0.v20110414"
|
||||||
val Logback = "0.9.28"
|
val Logback = "0.9.28"
|
||||||
val Multiverse = "0.6.2"
|
|
||||||
val Netty = "3.2.5.Final"
|
val Netty = "3.2.5.Final"
|
||||||
val Protobuf = "2.4.1"
|
val Protobuf = "2.4.1"
|
||||||
val Scalatest = "1.6.1"
|
val Scalatest = "1.6.1"
|
||||||
|
|
@ -439,7 +427,6 @@ object Dependency {
|
||||||
val jettyServlet = "org.eclipse.jetty" % "jetty-servlet" % V.Jetty // Eclipse license
|
val jettyServlet = "org.eclipse.jetty" % "jetty-servlet" % V.Jetty // Eclipse license
|
||||||
val log4j = "log4j" % "log4j" % "1.2.15" // ApacheV2
|
val log4j = "log4j" % "log4j" % "1.2.15" // ApacheV2
|
||||||
val mongoAsync = "com.mongodb.async" % "mongo-driver_2.9.0-1" % "0.2.9-1" // ApacheV2
|
val mongoAsync = "com.mongodb.async" % "mongo-driver_2.9.0-1" % "0.2.9-1" // ApacheV2
|
||||||
val multiverse = "org.multiverse" % "multiverse-alpha" % V.Multiverse // ApacheV2
|
|
||||||
val netty = "org.jboss.netty" % "netty" % V.Netty // ApacheV2
|
val netty = "org.jboss.netty" % "netty" % V.Netty // ApacheV2
|
||||||
val osgi = "org.osgi" % "org.osgi.core" % "4.2.0" // ApacheV2
|
val osgi = "org.osgi" % "org.osgi.core" % "4.2.0" // ApacheV2
|
||||||
val protobuf = "com.google.protobuf" % "protobuf-java" % V.Protobuf // New BSD
|
val protobuf = "com.google.protobuf" % "protobuf-java" % V.Protobuf // New BSD
|
||||||
|
|
@ -482,7 +469,6 @@ object Dependency {
|
||||||
val junit = "junit" % "junit" % "4.5" % "test" // Common Public License 1.0
|
val junit = "junit" % "junit" % "4.5" % "test" // Common Public License 1.0
|
||||||
val logback = "ch.qos.logback" % "logback-classic" % V.Logback % "test" // EPL 1.0 / LGPL 2.1
|
val logback = "ch.qos.logback" % "logback-classic" % V.Logback % "test" // EPL 1.0 / LGPL 2.1
|
||||||
val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" // MIT
|
val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" // MIT
|
||||||
val multiverse = "org.multiverse" % "multiverse-alpha" % V.Multiverse % "test" // ApacheV2
|
|
||||||
val scalatest = "org.scalatest" %% "scalatest" % V.Scalatest % "test" // ApacheV2
|
val scalatest = "org.scalatest" %% "scalatest" % V.Scalatest % "test" // ApacheV2
|
||||||
val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "1.9" % "test" // New BSD
|
val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "1.9" % "test" // New BSD
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue