public abstract class AbstractBasicMessageListener<T extends BasicMessage> extends Object implements javax.jms.MessageListener
AbstractBasicMessageListener(Class) or
determineBasicMessageClass() unless either (a) the subclass hierarchy has generic types that are specific
enough for reflection to determine the type of BasicMessage being listened for or (b) the message type being
listened for is BasicMessage and not one of its subclasses.| Modifier | Constructor and Description |
|---|---|
|
AbstractBasicMessageListener() |
protected |
AbstractBasicMessageListener(Class<T> jsonDecoderRing)
If a subclass knows the type and can give it to us, that will be the type used to decode JSON strings into that
message type.
|
| Modifier and Type | Method and Description |
|---|---|
protected Class<T> |
determineBasicMessageClass()
In order to decode the JSON, we need the class representation of the basic message type.
|
protected Class<T> |
getBasicMessageClass() |
protected T |
getBasicMessageFromMessage(javax.jms.Message message)
Given the Message received over the wire, convert it to our T representation of the message.
|
ConsumerConnectionContext |
getConsumerConnectionContext()
When this listener is attached to a consumer, this field should be filled in to allow the listener to perform
other tasks it needs which might require access to the context.
|
protected org.jboss.logging.Logger |
getLog() |
void |
setConsumerConnectionContext(ConsumerConnectionContext consumerConnectionContext) |
public AbstractBasicMessageListener()
protected AbstractBasicMessageListener(Class<T> jsonDecoderRing)
determineBasicMessageClass() unless BasicMessage is the message type that subclass wants to
explicitly use (as opposed to a subclass of BasicMessage).jsonDecoderRing - the class representation of the generic type Tpublic ConsumerConnectionContext getConsumerConnectionContext()
null if not associated with a
consumer yetpublic void setConsumerConnectionContext(ConsumerConnectionContext consumerConnectionContext)
protected T getBasicMessageFromMessage(javax.jms.Message message)
message - the over-the-wire messageprotected Class<T> determineBasicMessageClass()
AbstractBasicMessageListener(Class) to tell this object what the class of T
is.protected org.jboss.logging.Logger getLog()
Copyright © 2015 Red Hat, Inc.. All rights reserved.