|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jrun.jms.core.messagemgr.ConsumerEndpoint
|
+--jrun.jms.core.messagemgr.TopicConsumerEndpoint
The topic destination cache is specific to a consumer that
subscribes to a Topic destination. It extends
ConsumerEndpoint and includes behaviour specific
| Field Summary | |
protected java.util.HashMap |
_caches
Maintains a list of TopicDestinationCache that this endpoint subscribes too. |
protected JmsTopic |
_topic
Cache the destination that this endpoint subscribes too |
| Fields inherited from class jrun.jms.core.messagemgr.ConsumerEndpoint |
_ackMode, _connectionId, _destroyed, _listener, _messages, _nolocal, _scheduled, _scheduler, _selector, _session, _size, _stopped, _transacted |
| Method Summary | |
boolean |
canGarbageCollect(MessageHandle handle)
Check if this message is referenced by this endpoint. |
protected void |
clearMessages()
Clear all messages in the cache, regardless of whether they are persistent or non-persistent |
void |
destinationAdded(JmsDestination destination,
DestinationCache cache)
This method is called when a new destination is added to the DestinationManager |
void |
destinationRemoved(JmsDestination destination,
DestinationCache cache)
This method is called when a new destination is removed from the DestinationManager |
void |
destroy()
Destroy this object |
JmsDestination |
getDestination()
Return the destination that this consumer is subscribed too |
int |
getUnprocessedMessageCount()
Return the number of unsent and unacked messages for this consumer |
boolean |
messageRemoved(MessageImpl message)
This event is called when a message is removed from the DestinationCache. |
boolean |
persistentMessageRemoved(MessageImpl message)
This event is called when a message is removed from the DestinationCache. |
MessageHandle |
receiveMessage()
Return the next message to the client. |
void |
recover()
This message will return all unacked messages to the queue and allow them to be resent to the consumer with the redelivery flag on. |
void |
returnMessage(MessageHandle handle,
boolean recover)
Return the specified message to the cache. |
void |
run()
The run method is used to asynchronously deliver the messages in the cache to the consumer. |
void |
setLastMessageProcessed(long id)
|
void |
setMessageListener(InternalMessageListener listener)
Set the message listener for this consmer. |
void |
stopMessageDelivery()
Stop delivering messages to the registered listener |
void |
unregister()
Unregister this consumer for the specified destination cache, so that it will stop receiving messages from it. |
| Methods inherited from class jrun.jms.core.messagemgr.ConsumerEndpoint |
getAckMode, getClientId, getConnectionId, getId, getIdAsString, getLogger, getMaximumSize, getMessageCount, getNoLocal, getSelector, getSession, getTransacted, getUnsentMessages, hashCode, messageAdded, persistentMessageAdded, schedule, setAckMode, setCacheEvictionPolicy, setClientId, setConnectionId, setMaximumSize, setNoLocal, setSelector, setStopped, setTransacted, shutdown, startMessageDelivery, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.HashMap _caches
protected JmsTopic _topic
| Method Detail |
public void run()
Scheduler.
The thread, assigned by the scheduler, will attempt to deliver all the messages in the cache and then terminate. In addition this method must be prepared to be interrupted.
public MessageHandle receiveMessage()
ConsumerEndpointreceiveMessage in class ConsumerEndpointjrun.jms.core.messagemgr.ConsumerEndpointpublic boolean messageRemoved(MessageImpl message)
DestinationCacheEventListenermessageRemoved in class ConsumerEndpointjrun.jms.core.messagemgr.DestinationCacheEventListenermessage - - message removed from cache
public boolean persistentMessageRemoved(MessageImpl message)
throws PersistenceException
DestinationCacheEventListenerpersistentMessageRemoved in class ConsumerEndpointjrun.jms.core.messagemgr.DestinationCacheEventListenerconnection - - the database connectionmessage - - message to remove from cachePersistenceException - - if there is a persistence related problempublic boolean canGarbageCollect(MessageHandle handle)
canGarbageCollect in class ConsumerEndpointhandle - - message to checkpublic JmsDestination getDestination()
ConsumerEndpointgetDestination in class ConsumerEndpointjrun.jms.core.messagemgr.ConsumerEndpointpublic void unregister()
ConsumerEndpointunregister in class ConsumerEndpointpublic void recover()
ConsumerEndpointrecover in class ConsumerEndpoint
public void returnMessage(MessageHandle handle,
boolean recover)
handle - - handle to returnrecover - - flag to reschedule endpointpublic void destroy()
destroy in class ConsumerEndpointpublic int getUnprocessedMessageCount()
ConsumerEndpointgetUnprocessedMessageCount in class ConsumerEndpointjrun.jms.core.messagemgr.ConsumerEndpointpublic void stopMessageDelivery()
ConsumerEndpointstopMessageDelivery in class ConsumerEndpoint
public void destinationAdded(JmsDestination destination,
DestinationCache cache)
DestinationEventListenerDestinationManagerdestinationAdded in interface DestinationEventListenerjrun.jms.core.messagemgr.DestinationEventListenerdestination - - destination that was addedcache - - the corresponding cache
public void destinationRemoved(JmsDestination destination,
DestinationCache cache)
DestinationEventListenerDestinationManagerdestinationRemoved in interface DestinationEventListenerjrun.jms.core.messagemgr.DestinationEventListenerdestination - - destination that was removedcache - - the corresponding cachepublic void setMessageListener(InternalMessageListener listener)
ConsumerEndpointEach consumer cache can only have a single message listener. To remove the message listener call this method with null argument
setMessageListener in class ConsumerEndpointjrun.jms.core.messagemgr.ConsumerEndpointlistener - - the message listener to add.public void setLastMessageProcessed(long id)
protected void clearMessages()
clearMessages in class ConsumerEndpoint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||