remove app argument from Dispatchers

(cascading into all dispatchers, mailboxes, other stuff; had to move
deadLetter stuff to ActorSystem again and split its initialization due
to cyclic dependency)
This commit is contained in:
Roland 2011-11-14 16:03:26 +01:00
parent 79daccdce1
commit f2bf27b4de
20 changed files with 180 additions and 130 deletions

View file

@ -12,6 +12,8 @@ import java.lang.ref.WeakReference
import scala.annotation.tailrec
import akka.actor.{ ActorCell, ActorRef, ActorSystem }
import akka.dispatch._
import akka.actor.Scheduler
import akka.event.EventStream
/*
* Locking rules:
@ -103,7 +105,11 @@ private[testkit] object CallingThreadDispatcher {
* @author Roland Kuhn
* @since 1.1
*/
class CallingThreadDispatcher(_app: ActorSystem, val name: String = "calling-thread") extends MessageDispatcher(_app) {
class CallingThreadDispatcher(
_deadLetterMailbox: Mailbox,
_eventStream: EventStream,
_scheduler: Scheduler,
val name: String = "calling-thread") extends MessageDispatcher(_deadLetterMailbox, _eventStream, _scheduler) {
import CallingThreadDispatcher._
protected[akka] override def createMailbox(actor: ActorCell) = new CallingThreadMailbox(this, actor)
@ -213,12 +219,12 @@ class CallingThreadDispatcher(_app: ActorSystem, val name: String = "calling-thr
true
} catch {
case ie: InterruptedException
app.eventStream.publish(Error(this, ie))
eventStream.publish(Error(this, ie))
Thread.currentThread().interrupt()
intex = ie
true
case e
app.eventStream.publish(Error(this, e))
eventStream.publish(Error(this, e))
queue.leave
false
}