fall back to unhandled() in onReceive() in docs

This commit is contained in:
Roland 2011-12-29 20:49:26 +01:00
parent 4e3e2633a4
commit d181a35fa7
11 changed files with 30 additions and 0 deletions

View file

@ -39,6 +39,8 @@ public class FaultHandlingTestBase {
public void onReceive(Object o) {
if (o instanceof Props) {
getSender().tell(getContext().actorOf((Props) o));
} else {
unhandled(o);
}
}
}
@ -49,6 +51,8 @@ public class FaultHandlingTestBase {
public void onReceive(Object o) {
if (o instanceof Props) {
getSender().tell(getContext().actorOf((Props) o));
} else {
unhandled(o);
}
}
@ -70,6 +74,8 @@ public class FaultHandlingTestBase {
state = (Integer) o;
} else if (o.equals("get")) {
getSender().tell(state);
} else {
unhandled(o);
}
}
}

View file

@ -69,6 +69,8 @@ public class SchedulerDocTestBase {
public void onReceive(Object message) {
if (message.equals("Tick")) {
// Do someting
} else {
unhandled(message);
}
}
};

View file

@ -259,6 +259,8 @@ public class UntypedActorDocTestBase {
getContext().become(angry);
} else if (message.equals("foo")) {
getContext().become(happy);
} else {
unhandled(message);
}
}
}
@ -282,6 +284,8 @@ public class UntypedActorDocTestBase {
if (t.getActor() == child) {
lastSender.tell("finished");
}
} else {
unhandled(message);
}
}
}

View file

@ -290,6 +290,8 @@ public class FutureDocTestBase {
} else {
getSender().tell(i);
}
} else {
unhandled(message);
}
}
}

View file

@ -34,6 +34,8 @@ public class CoordinatedCounter extends UntypedActor {
}
} else if ("GetCount".equals(incoming)) {
getSender().tell(count.single().get());
} else {
unhandled(incoming);
}
}
}

View file

@ -22,6 +22,8 @@ public class Coordinator extends UntypedActor {
});
//#coordinated-atomic
}
} else {
unhandled(incoming);
}
}
}