abstract class MessageConsumerListener extends Object implements ReplyListener
Modifier and Type | Class and Description |
---|---|
private static class |
MessageConsumerListener.ReceiveStatus |
protected static class |
MessageConsumerListener.Status
Status of the message consumer listener.
|
Modifier and Type | Field and Description |
---|---|
private String |
destName |
private boolean |
durable |
private int |
listenerPosition |
private ArrayList<MessageListener> |
listeners |
static org.objectweb.util.monolog.api.Logger |
logger |
private int |
messageCount
The number of messages which are in queue (Session.qin)
waiting for being consumed.
|
private Vector<String> |
messagesToAck |
private int |
queueMessageReadMax |
private boolean |
queueMode |
private int |
receiveStatus
The receive status of this message listener:
- WAIT_FOR_REPLY if a reply is expected from the destination
- CONSUMING_REPLY if a reply is being consumed and no new request has
been sent
|
private int |
requestId
The identifier of the subscription request.
|
private RequestMultiplexer |
rm |
private String |
selector |
private int |
status |
private String |
targetName |
private int |
topicAckBufferMax |
private int |
topicActivationThreshold |
private boolean |
topicMsgInputPassivated
Indicates whether the topic message input has been passivated or not.
|
private int |
topicPassivationThreshold |
Constructor and Description |
---|
MessageConsumerListener(boolean queueMode,
boolean durable,
String selector,
String destName,
String targetName,
MessageListener listener,
int queueMessageReadMax,
int topicActivationThreshold,
int topicPassivationThreshold,
int topicAckBufferMax,
RequestMultiplexer reqMultiplexer) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
ack(String msgId,
int ackMode) |
private void |
acknowledge(int threshold) |
protected void |
activateListener(Message msg,
MessageListener listener,
int ackMode) |
(package private) void |
activateMessageInput() |
(package private) void |
addMessageListener(MessageListener messageListener) |
protected abstract boolean |
checkSessionThread() |
void |
close()
Called by Session.
|
private int |
decreaseMessageCount(int ackMode)
Decrease the message count.
|
void |
errorReceived(int requestId,
MomExceptionReply exc) |
String |
getDestName() |
MessageListener |
getMessageListener() |
int |
getMessageListenersSize() |
private MessageListener |
getNextlistener() |
boolean |
getQueueMode() |
protected int |
getStatus() |
String |
getTargetName() |
boolean |
isClosed() |
void |
onMessage(Message msg,
int ackMode)
Called by Session (standard JMS, mono-threaded)
|
abstract void |
onMessage(Message msg,
MessageListener listener,
int ackMode) |
(package private) void |
passivateMessageInput() |
abstract void |
pushMessages(ConsumerMessages cm)
Pushes the received messages.
|
(package private) boolean |
removeMessageListener(MessageListener messageListener) |
void |
replyAborted(int requestId) |
boolean |
replyReceived(AbstractJmsReply reply)
Called by RequestMultiplexer.
|
private void |
setReceiveStatus(int s) |
protected void |
setStatus(int status) |
(package private) void |
start()
Called by Session.
|
private void |
subscribe(String[] toAck,
int msgCount) |
public static org.objectweb.util.monolog.api.Logger logger
private boolean queueMode
private boolean durable
private String selector
private String destName
private String targetName
private volatile int requestId
private int status
private volatile int messageCount
private volatile int receiveStatus
private boolean topicMsgInputPassivated
private int queueMessageReadMax
private RequestMultiplexer rm
private int topicActivationThreshold
private int topicPassivationThreshold
private int topicAckBufferMax
private ArrayList<MessageListener> listeners
private int listenerPosition
MessageConsumerListener(boolean queueMode, boolean durable, String selector, String destName, String targetName, MessageListener listener, int queueMessageReadMax, int topicActivationThreshold, int topicPassivationThreshold, int topicAckBufferMax, RequestMultiplexer reqMultiplexer)
public final String getDestName()
protected final int getStatus()
protected void setStatus(int status)
private void setReceiveStatus(int s)
private int decreaseMessageCount(int ackMode) throws JMSException
JMSException
void start() throws JMSException
JMSException
private void subscribe(String[] toAck, int msgCount) throws JMSException
JMSException
protected abstract boolean checkSessionThread()
public void close() throws JMSException
JMSException
private void acknowledge(int threshold)
public boolean replyReceived(AbstractJmsReply reply) throws AbortedRequestException
replyReceived
in interface ReplyListener
AbortedRequestException
public abstract void pushMessages(ConsumerMessages cm) throws JMSException
cm
- JMSException
public void replyAborted(int requestId)
replyAborted
in interface ReplyListener
public void errorReceived(int requestId, MomExceptionReply exc)
errorReceived
in interface ReplyListener
public boolean isClosed()
public final MessageListener getMessageListener()
public final boolean getQueueMode()
public final String getTargetName()
protected void activateListener(Message msg, MessageListener listener, int ackMode) throws JMSException
JMSException
public abstract void onMessage(Message msg, MessageListener listener, int ackMode) throws JMSException
JMSException
void addMessageListener(MessageListener messageListener)
boolean removeMessageListener(MessageListener messageListener)
public int getMessageListenersSize()
private MessageListener getNextlistener()
public void onMessage(Message msg, int ackMode) throws JMSException
JMSException
void ack(String msgId, int ackMode) throws JMSException
JMSException
void activateMessageInput() throws JMSException
JMSException
void passivateMessageInput() throws JMSException
JMSException
Copyright © 2020 ScalAgent D.T.. All rights reserved.