Cleanup of methods in Actor and ActorContext trait. See #1377

* Added JavaActorContext, UntypedActor.getContext
* implicit val context in Actor needs to be implicit to support forward,
it would be nice if it wasn't implicit because now I can't override context
in UntypedActor
* Removed implicit def system in Actor
* Removed implicit def defaultTimeout in Actor
* Removed receiveTimeout, children, dispatcher, become, unbecome, watch,
unwatch in Actor
* Removed corresponding as above from UntypedActor
* Removed implicit from dispatcher in ActorSystem
* Removed implicit def timeout in TypedActor
* Changed receiveTimeout to use Duration (in api)
* Changed many tests and samples to match new api
This commit is contained in:
Patrik Nordwall 2011-12-05 20:01:42 +01:00
parent 5530c4cbdb
commit 3204269f6a
56 changed files with 251 additions and 196 deletions

View file

@ -37,6 +37,7 @@ object TestActorRefSpec {
}
class ReplyActor extends TActor {
implicit val system = context.system
var replyTo: ActorRef = null
def receiveT = {
@ -87,7 +88,7 @@ object TestActorRefSpec {
}
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach {
class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach with DefaultTimeout {
import TestActorRefSpec._
@ -156,7 +157,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach {
EventFilter[ActorKilledException]() intercept {
val a = TestActorRef(Props[WorkerActor])
val forwarder = actorOf(Props(new Actor {
watch(a)
context.startsWatching(a)
def receive = { case x testActor forward x }
}))
a.!(PoisonPill)(testActor)
@ -216,7 +217,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach {
"set receiveTimeout to None" in {
val a = TestActorRef[WorkerActor]
a.underlyingActor.receiveTimeout must be(None)
a.underlyingActor.context.receiveTimeout must be(None)
}
"set CallingThreadDispatcher" in {