T - the type of the incoming request messageU - the type of the response message that is to be sent back to the request senderpublic abstract class RPCBasicMessageListener<T extends BasicMessage,U extends BasicMessage> extends AbstractBasicMessageListener<T>
onBasicMessage(BasicMessageWithExtraData) or
#onBasicMessage(AbstractMessage) methods.| Modifier | Constructor and Description |
|---|---|
|
RPCBasicMessageListener()
Initialize with a default message sender.
|
protected |
RPCBasicMessageListener(Class<T> jsonDecoderRing) |
protected |
RPCBasicMessageListener(Class<T> jsonDecoderRing,
MessageProcessor messageSender) |
|
RPCBasicMessageListener(MessageProcessor messageSender) |
| Modifier and Type | Method and Description |
|---|---|
protected MessageProcessor |
getMessageSender() |
protected U |
onBasicMessage(BasicMessageWithExtraData<T> msgWithExtraData)
Subclasses implement this method to process the received message.
|
protected U |
onBasicMessage(T basicMessage)
Subclasses can implement this method rather than
onBasicMessage(BasicMessageWithExtraData)
if they only expect to receive a AbstractMessage with no additional data. |
void |
onMessage(javax.jms.Message message) |
protected void |
setMessageSender(MessageProcessor messageSender) |
convertReceivedMessageClassNameToDesiredMessageClassName, determineBasicMessageClass, getBasicMessageClass, getConsumerConnectionContext, getLog, parseMessage, setConsumerConnectionContextpublic RPCBasicMessageListener()
public RPCBasicMessageListener(MessageProcessor messageSender)
protected RPCBasicMessageListener(Class<T> jsonDecoderRing, MessageProcessor messageSender)
protected MessageProcessor getMessageSender()
protected void setMessageSender(MessageProcessor messageSender)
public void onMessage(javax.jms.Message message)
protected U onBasicMessage(BasicMessageWithExtraData<T> msgWithExtraData)
AbstractMessage, it can do so by
overriding the onBasicMessage method that just takes the message type as a parameter
and leaving this method as-is (that is, do NOT override this method).msgWithExtraData - the basic message received with any extra data that came with itprotected U onBasicMessage(T basicMessage)
onBasicMessage(BasicMessageWithExtraData)
if they only expect to receive a AbstractMessage with no additional data.
If this method is overridden by subclasses, then the onBasicMessage(BasicMessageWithExtraData)
should not be.
This base implementation is a no-op.basicMessage - the basic message receivedCopyright © 2014–2017 Red Hat, Inc.. All rights reserved.