Lets say that I have a message queue which receives messages which have the members name, type and so on.
Is there a name for a type of observer on this queue which expects a message with a certain content?
if (message.name.equals(observer.wantedName) {
observer.notify();
}
The following is just an example in pseudo code how to solve the problem. The MessageQueue has a hashtable which keys are the message types and values arrays with listeners for this message type. Also you’ll need an additional argument to
YourMessageQueue:observe()that describes the condition.