fall back to unhandled() in onReceive() in docs
This commit is contained in:
parent
4e3e2633a4
commit
d181a35fa7
11 changed files with 30 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ public class SchedulerDocTestBase {
|
|||
public void onReceive(Object message) {
|
||||
if (message.equals("Tick")) {
|
||||
// Do someting
|
||||
} else {
|
||||
unhandled(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,6 +290,8 @@ public class FutureDocTestBase {
|
|||
} else {
|
||||
getSender().tell(i);
|
||||
}
|
||||
} else {
|
||||
unhandled(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public class CoordinatedCounter extends UntypedActor {
|
|||
}
|
||||
} else if ("GetCount".equals(incoming)) {
|
||||
getSender().tell(count.single().get());
|
||||
} else {
|
||||
unhandled(incoming);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ public class Coordinator extends UntypedActor {
|
|||
});
|
||||
//#coordinated-atomic
|
||||
}
|
||||
} else {
|
||||
unhandled(incoming);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue