Merge pull request #17449 from akka/wip-static-props-docs-∂π

=doc add props static method to IODocText
This commit is contained in:
Roland Kuhn 2015-05-11 17:21:48 +02:00
commit d5a9c2b0c0

View file

@ -40,6 +40,10 @@ public class IODocTest {
public Server(ActorRef manager) {
this.manager = manager;
}
public static Props props(ActorRef manager) {
return Props.create(Server.class, manager);
}
@Override
public void preStart() throws Exception {
@ -90,6 +94,10 @@ public class IODocTest {
final InetSocketAddress remote;
final ActorRef listener;
public static Props props(InetSocketAddress remote, ActorRef listener) {
return Props.create(Client.class, remote, listener);
}
public Client(InetSocketAddress remote, ActorRef listener) {
this.remote = remote;
@ -150,9 +158,9 @@ public class IODocTest {
new JavaTestKit(system) {
{
@SuppressWarnings("unused")
final ActorRef server = system.actorOf(Props.create(Server.class, getRef()), "server1");
final ActorRef server = system.actorOf(Server.props(getRef()), "server1");
final InetSocketAddress listen = expectMsgClass(Bound.class).localAddress();
final ActorRef client = system.actorOf(Props.create(Client.class, listen, getRef()), "client1");
final ActorRef client = system.actorOf(Client.props(listen, getRef()), "client1");
final Connected c1 = expectMsgClass(Connected.class);
final Connected c2 = expectMsgClass(Connected.class);