use of com.generallycloud.baseio.container.jms.NullMessage in project baseio by generallycloud.
the class FixedMessageConsumer method onReceive.
@Override
public void onReceive(Message message) {
int msgType = message.getMsgType();
if (Message.TYPE_MAP == msgType) {
MapMessage m = (MapMessage) message;
String eventName = m.getParameter("eventName");
OnMappedMessage onMessage = onMappedMessages.get(eventName);
if (onMessage == null) {
return;
}
onMessage.onReceive(m);
} else if (Message.TYPE_MAP_BYTE == msgType) {
MapByteMessage m = (MapByteMessage) message;
String eventName = m.getParameter("eventName");
OnMappedMessage onMessage = onMappedMessages.get(eventName);
if (onMessage == null) {
return;
}
onMessage.onReceive(m);
} else if (Message.TYPE_TEXT == msgType) {
if (onTextMessage != null) {
onTextMessage.onReceive((TextMessage) message);
}
} else if (Message.TYPE_TEXT_BYTE == msgType) {
if (onTextByteMessage != null) {
onTextByteMessage.onReceive((TextByteMessage) message);
}
} else if (Message.TYPE_ERROR == msgType) {
if (onErrorMessage != null) {
onErrorMessage.onReceive((ErrorMessage) message);
}
} else if (Message.TYPE_NULL == msgType) {
if (onNullMessage != null) {
onNullMessage.onReceive((NullMessage) message);
}
}
}
Aggregations