|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.Closeable
org.apache.qpid.client.BasicMessageConsumer<U>
public abstract class BasicMessageConsumer<U>
Field Summary | |
---|---|
protected int |
_acknowledgeMode
The acknowledge mode in force for this consumer. |
protected int |
_channelId
We need to know the channel id when constructing frames |
protected AMQConnection |
_connection
The connection being used by this consumer |
protected int |
_consumerTag
The consumer tag allows us to close the consumer by sending a jmsCancel method to the broker |
protected AMQDestination |
_destination
|
protected boolean |
_exclusive
We store the exclusive field in order to be able to reuse it when resubscribing in the event of failover |
protected MessageFactoryRegistry |
_messageFactory
|
protected String |
_messageSelector
|
protected AMQProtocolHandler |
_protocolHandler
|
protected AMQSession |
_session
|
protected BlockingQueue |
_synchronousQueue
Used in the blocking receive methods to receive a message from the Session thread. |
Fields inherited from class org.apache.qpid.client.Closeable |
---|
_closed, _closing |
Constructor Summary | |
---|---|
protected |
BasicMessageConsumer(int channelId,
AMQConnection connection,
AMQDestination destination,
String messageSelector,
boolean noLocal,
MessageFactoryRegistry messageFactory,
AMQSession session,
AMQProtocolHandler protocolHandler,
org.apache.qpid.framing.FieldTable arguments,
int prefetchHigh,
int prefetchLow,
boolean exclusive,
int acknowledgeMode,
boolean noConsume,
boolean autoClose)
|
Method Summary | |
---|---|
(package private) void |
acknowledgeDelivered()
Acknowledge up to last message delivered (if any). |
void |
addBindingKey(AMQDestination amqd,
String routingKey)
|
void |
clearReceiveQueue()
|
void |
close()
Closes this object. |
void |
close(boolean sendClose)
|
abstract AbstractJMSMessage |
createJMSMessageFromUnprocessedMessage(AMQMessageDelegateFactory delegateFactory,
U messageFrame)
|
String |
debugIdentity()
|
List<Long> |
drainReceiverQueueAndRetrieveDeliveryTags()
|
void |
failedOverPost()
|
void |
failedOverPre()
to be called when a failover has occured |
int |
getAcknowledgeMode()
|
org.apache.qpid.framing.FieldTable |
getArguments()
|
int |
getConsumerTag()
|
AMQDestination |
getDestination()
|
(package private) Long |
getLastDelivered()
Acknowledge up to last message delivered (if any). |
Object |
getMessageFromQueue(long l)
|
MessageListener |
getMessageListener()
|
String |
getMessageSelector()
|
int |
getPrefetch()
|
int |
getPrefetchHigh()
|
int |
getPrefetchLow()
|
org.apache.qpid.framing.AMQShortString |
getQueuename()
|
AMQSession |
getSession()
|
boolean |
isAutoClose()
|
boolean |
isExclusive()
|
protected boolean |
isMessageListenerSet()
|
boolean |
isNoConsume()
|
boolean |
isNoLocal()
|
boolean |
isReceiving()
|
(package private) void |
markClosed()
Called when you need to invalidate a consumer. |
void |
notifyCloseMessage(CloseConsumerMessage closeMessage)
|
(package private) void |
notifyError(Throwable cause)
|
void |
notifyMessage(AbstractJMSMessage jmsMessage)
|
(package private) void |
notifyMessage(U messageFrame)
Called from the AMQSession when a message has arrived for this consumer. |
(package private) void |
postDeliver(AbstractJMSMessage msg)
|
protected void |
preApplicationProcessing(AbstractJMSMessage jmsMsg)
|
(package private) void |
preDeliver(AbstractJMSMessage msg)
|
Message |
receive()
|
Message |
receive(long l)
|
(package private) abstract Message |
receiveBrowse()
|
Message |
receiveNoWait()
|
void |
rollback()
|
void |
rollbackPendingMessages()
|
(package private) abstract void |
sendCancel()
|
void |
setConsumerTag(int consumerTag)
|
void |
setMessageListener(MessageListener messageListener)
|
void |
setQueuename(org.apache.qpid.framing.AMQShortString queuename)
|
Methods inherited from class org.apache.qpid.client.Closeable |
---|
checkNotClosed, isClosed, isClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final AMQConnection _connection
protected final String _messageSelector
protected AMQDestination _destination
protected int _consumerTag
protected final int _channelId
protected final BlockingQueue _synchronousQueue
protected final MessageFactoryRegistry _messageFactory
protected final AMQSession _session
protected final AMQProtocolHandler _protocolHandler
protected boolean _exclusive
protected final int _acknowledgeMode
Constructor Detail |
---|
protected BasicMessageConsumer(int channelId, AMQConnection connection, AMQDestination destination, String messageSelector, boolean noLocal, MessageFactoryRegistry messageFactory, AMQSession session, AMQProtocolHandler protocolHandler, org.apache.qpid.framing.FieldTable arguments, int prefetchHigh, int prefetchLow, boolean exclusive, int acknowledgeMode, boolean noConsume, boolean autoClose)
Method Detail |
---|
public AMQDestination getDestination()
public String getMessageSelector() throws JMSException
getMessageSelector
in interface MessageConsumer
JMSException
public MessageListener getMessageListener() throws JMSException
getMessageListener
in interface MessageConsumer
JMSException
public int getAcknowledgeMode()
protected boolean isMessageListenerSet()
public void setMessageListener(MessageListener messageListener) throws JMSException
setMessageListener
in interface MessageConsumer
JMSException
protected void preApplicationProcessing(AbstractJMSMessage jmsMsg) throws JMSException
JMSException
public org.apache.qpid.framing.FieldTable getArguments()
public int getPrefetch()
public int getPrefetchHigh()
public int getPrefetchLow()
public boolean isNoLocal()
public boolean isExclusive()
public boolean isReceiving()
public Message receive() throws JMSException
receive
in interface MessageConsumer
JMSException
public Message receive(long l) throws JMSException
receive
in interface MessageConsumer
JMSException
public Object getMessageFromQueue(long l) throws InterruptedException
InterruptedException
abstract Message receiveBrowse() throws JMSException
JMSException
public Message receiveNoWait() throws JMSException
receiveNoWait
in interface MessageConsumer
JMSException
public void close() throws JMSException
Closeable
close
in interface MessageConsumer
close
in class Closeable
JMSException
- If this cannot be closed for any reason.public void close(boolean sendClose) throws JMSException
JMSException
abstract void sendCancel() throws org.apache.qpid.AMQException, FailoverException
org.apache.qpid.AMQException
FailoverException
void markClosed()
public void notifyCloseMessage(CloseConsumerMessage closeMessage)
closeMessage
- this message signals that we should close the browservoid notifyMessage(U messageFrame)
messageFrame
- the raw unprocessed mesagepublic abstract AbstractJMSMessage createJMSMessageFromUnprocessedMessage(AMQMessageDelegateFactory delegateFactory, U messageFrame) throws Exception
Exception
public void notifyMessage(AbstractJMSMessage jmsMessage)
jmsMessage
- this message has already been processed so can't redo preDelivervoid preDeliver(AbstractJMSMessage msg)
void postDeliver(AbstractJMSMessage msg) throws JMSException
JMSException
Long getLastDelivered()
void acknowledgeDelivered()
void notifyError(Throwable cause)
public int getConsumerTag()
public void setConsumerTag(int consumerTag)
public AMQSession getSession()
public boolean isAutoClose()
public boolean isNoConsume()
public void rollback()
public void rollbackPendingMessages()
public String debugIdentity()
public void clearReceiveQueue()
public List<Long> drainReceiverQueueAndRetrieveDeliveryTags()
public org.apache.qpid.framing.AMQShortString getQueuename()
public void setQueuename(org.apache.qpid.framing.AMQShortString queuename)
public void addBindingKey(AMQDestination amqd, String routingKey) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void failedOverPre()
public void failedOverPost()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |