Updates after feedback

This commit is contained in:
Patrik Nordwall 2011-12-20 09:19:34 +01:00
parent 83b08b20d9
commit 5fd40e53ca
9 changed files with 33 additions and 71 deletions

View file

@ -11,16 +11,11 @@ import akka.actor.Props;
//#imports
//#imports2
import akka.actor.mailbox.DurableMailboxType;
//#imports2
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import akka.testkit.AkkaSpec;
import akka.docs.dispatcher.DispatcherDocSpec;
import com.typesafe.config.ConfigFactory;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
@ -55,22 +50,9 @@ public class DurableMailboxDocTestBase {
myActor.tell("test");
}
@Test
public void programaticallyDefinedDispatcher() {
//#prog-define-dispatcher
MessageDispatcher dispatcher = system.dispatcherFactory()
.newDispatcher("my-dispatcher", 1, DurableMailboxType.fileDurableMailboxType()).build();
ActorRef myActor = system.actorOf(new Props().withDispatcher(dispatcher).withCreator(new UntypedActorFactory() {
public UntypedActor create() {
return new MyUntypedActor();
}
}), "myactor");
//#prog-define-dispatcher
myActor.tell("test");
}
public static class MyUntypedActor extends UntypedActor {
public void onReceive(Object message) {
}
}
}