posted 16 years ago
This question actually has two pairs, A or B, C or D. For the first pair, I am not sure. For the second pair, take the example of JMS MessageListner, the onMessage(Message msg) need the JMS message type. So it actually distinguish the message type, which is a javax.jms.Message.
The thing that is confusing here is almost all the examples for MDB is using JMS MessageListener, so our thinking is confined on it. And JMS has its own message types, ObjectMessage, TextMessage and so on. MDB can not distinguish these types. But the "message type" here means a bigger scope. That is, other than JMS, MDB can support other message system.
So for the first pair, the JMS MessageListener only has one method onMessage(). That doesn't mean other message system can only have one method.
Is my understanding right?