diff --git a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala index 28bacbe34f..902d014707 100644 --- a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala @@ -106,7 +106,7 @@ class ExecutorBasedEventDrivenDispatcher( override def mailboxSize(actorRef: ActorRef) = getMailbox(actorRef).size - def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailboxType): AnyRef = mailboxType match { + def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailbox): AnyRef = mailboxType match { case UnboundedMailbox(blocking) => new DefaultUnboundedMessageQueue(blocking) with ExecutableMailbox { def dispatcher = ExecutorBasedEventDrivenDispatcher.this } @@ -120,7 +120,7 @@ class ExecutorBasedEventDrivenDispatcher( /** * Creates and returns a durable mailbox for the given actor. */ - private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailboxType): AnyRef = + private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailbox): AnyRef = createMailbox(mailboxType.mailboxImplClassname, actorRef) private[akka] def start = log.slf4j.debug("Starting up {}\n\twith throughput [{}]", this, throughput) diff --git a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala index 284512db82..03e2c37303 100644 --- a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenWorkStealingDispatcher.scala @@ -194,7 +194,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher( override val toString = "ExecutorBasedEventDrivenWorkStealingDispatcher[" + name + "]" - private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailboxType): AnyRef = mailboxType match { + private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailbox): AnyRef = mailboxType match { case UnboundedMailbox(blocking) => // FIXME make use of 'blocking' in work stealer ConcurrentLinkedDeque new ConcurrentLinkedDeque[MessageInvocation] with MessageQueue with Runnable { def enqueue(handle: MessageInvocation): Unit = this.add(handle) @@ -224,7 +224,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher( /** * Creates and returns a durable mailbox for the given actor. */ - private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailboxType): AnyRef = + private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailbox): AnyRef = createMailbox(mailboxType.mailboxImplClassname, actorRef) private[akka] override def register(actorRef: ActorRef) = { diff --git a/akka-actor/src/main/scala/akka/dispatch/HawtDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/HawtDispatcher.scala index d35fc46617..34449d16b6 100644 --- a/akka-actor/src/main/scala/akka/dispatch/HawtDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/HawtDispatcher.scala @@ -166,12 +166,12 @@ class HawtDispatcher(val aggregate: Boolean = true, val parent: DispatchQueue = def suspend(actorRef: ActorRef) = mailbox(actorRef).suspend def resume(actorRef:ActorRef) = mailbox(actorRef).resume - private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailboxType): AnyRef = null.asInstanceOf[AnyRef] + private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailbox): AnyRef = null.asInstanceOf[AnyRef] /** * Creates and returns a durable mailbox for the given actor. */ - private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailboxType): AnyRef = null.asInstanceOf[AnyRef] + private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailbox): AnyRef = null.asInstanceOf[AnyRef] override def toString = "HawtDispatcher" } diff --git a/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala b/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala index d6c13bfda4..49aa26b840 100644 --- a/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala +++ b/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala @@ -31,17 +31,17 @@ trait MessageQueue { */ sealed trait MailboxType -abstract class TransientMailboxType(val blocking: Boolean = false) extends MailboxType -case class UnboundedMailbox(block: Boolean = false) extends TransientMailboxType(block) +abstract class TransientMailbox(val blocking: Boolean = false) extends MailboxType +case class UnboundedMailbox(block: Boolean = false) extends TransientMailbox(block) case class BoundedMailbox( block: Boolean = false, val capacity: Int = { if (Dispatchers.MAILBOX_CAPACITY < 0) Int.MaxValue else Dispatchers.MAILBOX_CAPACITY }, - val pushTimeOut: Duration = Dispatchers.MAILBOX_PUSH_TIME_OUT) extends TransientMailboxType(block) { + val pushTimeOut: Duration = Dispatchers.MAILBOX_PUSH_TIME_OUT) extends TransientMailbox(block) { if (capacity < 0) throw new IllegalArgumentException("The capacity for BoundedMailbox can not be negative") if (pushTimeOut eq null) throw new IllegalArgumentException("The push time-out for BoundedMailbox can not be null") } -case class DurableMailboxType(mailboxImplClassname: String) extends MailboxType +case class DurableMailbox(mailboxImplClassname: String) extends MailboxType class DefaultUnboundedMessageQueue(blockDequeue: Boolean) extends LinkedBlockingQueue[MessageInvocation] with MessageQueue { @@ -83,17 +83,17 @@ trait MailboxFactory { */ private[akka] def createMailbox(actorRef: ActorRef): AnyRef = mailboxType.getOrElse(throw new IllegalStateException("No mailbox type defined")) match { - case mb: TransientMailboxType => createTransientMailbox(actorRef, mb) - case mb: DurableMailboxType => createDurableMailbox(actorRef, mb) + case mb: TransientMailbox => createTransientMailbox(actorRef, mb) + case mb: DurableMailbox => createDurableMailbox(actorRef, mb) } /** * Creates and returns a transient mailbox for the given actor. */ - private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailboxType): AnyRef + private[akka] def createTransientMailbox(actorRef: ActorRef, mailboxType: TransientMailbox): AnyRef /** * Creates and returns a durable mailbox for the given actor. */ - private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailboxType): AnyRef + private[akka] def createDurableMailbox(actorRef: ActorRef, mailboxType: DurableMailbox): AnyRef }