Changed so that the configured FQCN of the mailboxType must be a MailboxType, not the Mailbox. See #1458

This commit is contained in:
Patrik Nordwall 2011-12-21 19:37:18 +01:00
parent 6eb7e1d438
commit c4401f1ca8
17 changed files with 71 additions and 50 deletions

View file

@ -8,6 +8,7 @@ import akka.util.duration._
import akka.testkit.AkkaSpec
import akka.actor.ActorRef
import akka.actor.ActorContext
import com.typesafe.config.Config
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAndAfterEach {
@ -152,10 +153,14 @@ class PriorityMailboxSpec extends MailboxSpec {
object CustomMailboxSpec {
val config = """
my-dispatcher {
mailboxType = "akka.dispatch.CustomMailboxSpec$MyMailbox"
mailboxType = "akka.dispatch.CustomMailboxSpec$MyMailboxType"
}
"""
class MyMailboxType(config: Config) extends MailboxType {
override def create(owner: ActorContext) = new MyMailbox(owner)
}
class MyMailbox(owner: ActorContext) extends CustomMailbox(owner)
with QueueBasedMessageQueue with UnboundedMessageQueueSemantics with DefaultSystemMessageQueue {
final val queue = new ConcurrentLinkedQueue[Envelope]()