Creating TypedProps and implementing support for wrapping an arbitrary ActorRef as a TypedActor

This commit is contained in:
Viktor Klang 2012-01-16 14:11:29 +01:00
parent 0470f5f9fd
commit de151617f2
11 changed files with 239 additions and 161 deletions

View file

@ -4,6 +4,7 @@
package akka.docs.actor;
//#imports
import akka.dispatch.*;
import akka.actor.*;
import akka.japi.*;
@ -103,15 +104,14 @@ public class TypedActorDocTestBase {
try {
//#typed-actor-create1
Squarer mySquarer =
TypedActor.get(system).typedActorOf(Squarer.class, SquarerImpl.class, new Props());
TypedActor.get(system).typedActorOf(new TypedProps<SquarerImpl>(Squarer.class, SquarerImpl.class));
//#typed-actor-create1
//#typed-actor-create2
Squarer otherSquarer =
TypedActor.get(system).typedActorOf(Squarer.class,
TypedActor.get(system).typedActorOf(new TypedProps<SquarerImpl>(Squarer.class,
new Creator<SquarerImpl>() {
public SquarerImpl create() { return new SquarerImpl("foo"); }
},
new Props(),
}),
"name");
//#typed-actor-create2

View file

@ -65,7 +65,6 @@ public class UntypedActorDocTestBase {
return new MyUntypedActor();
}
});
Props props5 = props4.withTimeout(new Timeout(1000));
//#creating-props-config
}