Class LocalMessageConsumer
- java.lang.Object
-
- net.timewalker.ffmq4.common.session.AbstractMessageHandler
-
- net.timewalker.ffmq4.common.session.AbstractMessageConsumer
-
- net.timewalker.ffmq4.local.session.LocalMessageConsumer
-
- All Implemented Interfaces:
javax.jms.MessageConsumer
- Direct Known Subclasses:
LocalQueueReceiver,LocalTopicSubscriber
public class LocalMessageConsumer extends AbstractMessageConsumer
Implementation of a local JMS
MessageConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected FFMQEngineengineprotected MessageSelectorparsedSelector-
Fields inherited from class net.timewalker.ffmq4.common.session.AbstractMessageConsumer
autoAcknowledge, messageListener, messageSelector, noLocal
-
Fields inherited from class net.timewalker.ffmq4.common.session.AbstractMessageHandler
closed, connection, destination, externalAccessLock, id, session
-
-
Constructor Summary
Constructors Constructor Description LocalMessageConsumer(FFMQEngine engine, LocalSession session, javax.jms.Destination destination, String messageSelector, boolean noLocal, IntegerID consumerId, String subscriberId)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalQueuegetLocalQueue()Get the local queue associated to this consumerbooleangetNoLocal()MessageSelectorgetParsedSelector()Get the parsed message selector for this consumerintgetPrefetchSize()MessageSelectorgetReceiveSelector()Get the parsed message selector for this consumer to be used when receiving a message from the local queueprotected SettingsgetSettings()StringgetSubscriberId()protected voidinitDestination()booleanisDurable()Test if the consumer is durableprotected voidonConsumerClose()protected voidonConsumerClosed()voidprefetchMore()AbstractMessagereceiveFromDestination(long timeout, boolean duplicateRequired)Receive a message from a destinationvoidrestorePrefetchCapacity(int amount)voidsetMessageListener(javax.jms.MessageListener messageListener)protected booleanshouldLogListenersFailures()voidwakeUp()Wake up the consumer (SYNCHRONOUS)-
Methods inherited from class net.timewalker.ffmq4.common.session.AbstractMessageConsumer
close, getMessageListener, getMessageSelector, receive, receive, receiveNoWait, wakeUpMessageListener
-
Methods inherited from class net.timewalker.ffmq4.common.session.AbstractMessageHandler
checkNotClosed, getEntitiesDescription, getId, getSession, toString
-
-
-
-
Field Detail
-
engine
protected FFMQEngine engine
-
parsedSelector
protected MessageSelector parsedSelector
-
-
Constructor Detail
-
LocalMessageConsumer
public LocalMessageConsumer(FFMQEngine engine, LocalSession session, javax.jms.Destination destination, String messageSelector, boolean noLocal, IntegerID consumerId, String subscriberId) throws javax.jms.JMSException
Constructor- Throws:
javax.jms.JMSException
-
-
Method Detail
-
shouldLogListenersFailures
protected final boolean shouldLogListenersFailures()
- Specified by:
shouldLogListenersFailuresin classAbstractMessageConsumer
-
getPrefetchSize
public final int getPrefetchSize()
- Returns:
- the prefetchSize
-
getSettings
protected final Settings getSettings()
-
initDestination
protected final void initDestination() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
setMessageListener
public final void setMessageListener(javax.jms.MessageListener messageListener) throws javax.jms.JMSException- Specified by:
setMessageListenerin interfacejavax.jms.MessageConsumer- Overrides:
setMessageListenerin classAbstractMessageConsumer- Throws:
javax.jms.JMSException
-
isDurable
public boolean isDurable()
Test if the consumer is durable
-
getParsedSelector
public final MessageSelector getParsedSelector()
Get the parsed message selector for this consumer- Returns:
- the parsedSelector
-
getReceiveSelector
public final MessageSelector getReceiveSelector()
Get the parsed message selector for this consumer to be used when receiving a message from the local queue- Returns:
- the parsedSelector
-
onConsumerClose
protected final void onConsumerClose()
- Overrides:
onConsumerClosein classAbstractMessageConsumer
-
onConsumerClosed
protected final void onConsumerClosed()
- Overrides:
onConsumerClosedin classAbstractMessageConsumer
-
receiveFromDestination
public final AbstractMessage receiveFromDestination(long timeout, boolean duplicateRequired) throws javax.jms.JMSException
Description copied from class:AbstractMessageConsumerReceive a message from a destination- Specified by:
receiveFromDestinationin classAbstractMessageConsumer- Throws:
javax.jms.JMSException
-
wakeUp
public final void wakeUp() throws javax.jms.JMSExceptionDescription copied from class:AbstractMessageConsumerWake up the consumer (SYNCHRONOUS)- Specified by:
wakeUpin classAbstractMessageConsumer- Throws:
javax.jms.JMSException
-
prefetchMore
public final void prefetchMore() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
restorePrefetchCapacity
public final void restorePrefetchCapacity(int amount) throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
getNoLocal
public final boolean getNoLocal()
-
getLocalQueue
public final LocalQueue getLocalQueue()
Get the local queue associated to this consumer
-
getSubscriberId
public final String getSubscriberId()
- Returns:
- the subscriberId
-
-