remove all but one occurrence of single-arg tell()

This commit is contained in:
Roland 2012-09-19 23:55:53 +02:00
parent 2502919c6e
commit ce49ffe3c6
71 changed files with 550 additions and 538 deletions

View file

@ -20,7 +20,7 @@ public class CoordinatedCounter extends UntypedActor {
if (message instanceof Increment) {
Increment increment = (Increment) message;
if (increment.hasFriend()) {
increment.getFriend().tell(coordinated.coordinate(new Increment()));
increment.getFriend().tell(coordinated.coordinate(new Increment()), getSelf());
}
coordinated.atomic(new Runnable() {
public void run() {
@ -29,7 +29,7 @@ public class CoordinatedCounter extends UntypedActor {
});
}
} else if ("GetCount".equals(incoming)) {
getSender().tell(count.get());
getSender().tell(count.get(), getSelf());
} else {
unhandled(incoming);
}

View file

@ -20,7 +20,7 @@ public class Counter extends UntypedTransactor {
@Override public boolean normally(Object message) {
if ("GetCount".equals(message)) {
getSender().tell(count.get());
getSender().tell(count.get(), getSelf());
return true;
} else return false;
}

View file

@ -5,7 +5,6 @@
package docs.transactor;
//#class
import akka.actor.*;
import akka.transactor.*;
import java.util.Set;
import scala.concurrent.stm.Ref;
@ -31,7 +30,7 @@ public class FriendlyCounter extends UntypedTransactor {
@Override public boolean normally(Object message) {
if ("GetCount".equals(message)) {
getSender().tell(count.get());
getSender().tell(count.get(), getSelf());
return true;
} else return false;
}

View file

@ -12,7 +12,6 @@ import akka.actor.*;
import scala.concurrent.Await;
import static akka.pattern.Patterns.ask;
import akka.transactor.Coordinated;
import scala.concurrent.util.Duration;
import akka.util.Timeout;
import static java.util.concurrent.TimeUnit.SECONDS;
//#imports
@ -29,7 +28,7 @@ public class TransactorDocTest {
Timeout timeout = new Timeout(5, SECONDS);
counter1.tell(new Coordinated(new Increment(counter2), timeout));
counter1.tell(new Coordinated(new Increment(counter2), timeout), null);
Integer count = (Integer) Await.result(ask(counter1, "GetCount", timeout), timeout.duration());
//#coordinated-example
@ -50,11 +49,11 @@ public class TransactorDocTest {
ActorRef actor = system.actorOf(new Props(Coordinator.class));
//#send-coordinated
actor.tell(new Coordinated(new Message(), timeout));
actor.tell(new Coordinated(new Message(), timeout), null);
//#send-coordinated
//#include-coordinated
actor.tell(coordinated.coordinate(new Message()));
actor.tell(coordinated.coordinate(new Message()), null);
//#include-coordinated
coordinated.await();
@ -69,7 +68,7 @@ public class TransactorDocTest {
Timeout timeout = new Timeout(5, SECONDS);
Coordinated coordinated = new Coordinated(timeout);
counter.tell(coordinated.coordinate(new Increment()));
counter.tell(coordinated.coordinate(new Increment()), null);
coordinated.await();
Integer count = (Integer) Await.result(ask(counter, "GetCount", timeout), timeout.duration());
@ -86,7 +85,7 @@ public class TransactorDocTest {
Timeout timeout = new Timeout(5, SECONDS);
Coordinated coordinated = new Coordinated(timeout);
friendlyCounter.tell(coordinated.coordinate(new Increment(friend)));
friendlyCounter.tell(coordinated.coordinate(new Increment(friend)), null);
coordinated.await();
Integer count1 = (Integer) Await.result(ask(friendlyCounter, "GetCount", timeout), timeout.duration());