|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.jms.messagemgr.DestinationCache
org.exolab.jms.messagemgr.QueueDestinationCache
public class QueueDestinationCache
A DestinationCache for Queues
| Field Summary | |
|---|---|
protected java.util.List |
_queueListeners
Maintains a list of queue listeners for this cache |
| Fields inherited from class org.exolab.jms.messagemgr.DestinationCache |
|---|
_consumers, _leaseHelper |
| Method Summary | |
|---|---|
void |
addQueueListener(QueueListener listener)
A Queue can also hav a queue listener, which simply gets informed of all messages that arrive at this destination |
boolean |
canDestroy()
Determines if this cache can be destroyed. |
JmsDestination |
getDestination()
Return a reference to the underlying destination |
MessageHandle |
getMessage(QueueConsumerEndpoint endpoint)
Return the first message of the queue or null if there are no messages in the cache |
int |
hashCode()
|
boolean |
messageAdded(JmsDestination destination,
MessageImpl message)
This method is called when the MessageMgr adds a message
for this destination to the cache |
void |
messageRemoved(JmsDestination destination,
MessageImpl message)
This method is called when the MessageMgr removes a message
from the cache. |
boolean |
persistentMessageAdded(java.sql.Connection connection,
JmsDestination destination,
MessageImpl message)
This event is called when the MessageMgr adds a persistent
message to the cache. |
void |
persistentMessageRemoved(java.sql.Connection connection,
JmsDestination destination,
MessageImpl message)
This event is called when the MessageMgr removes a persistent
message from the cache. |
void |
playbackMessages(QueueListener listener)
Playback all the messages in the cache to the specified QueueListener |
void |
removeQueueListener(QueueListener listener)
Remove the queue listener associated with this cache |
void |
returnMessage(MessageHandle handle)
Return the specified message to top of the queue. |
java.lang.String |
toString()
|
| Methods inherited from class org.exolab.jms.messagemgr.DestinationCache |
|---|
collectGarbage, getConsumers, getDestinationByName, getId, getMaximumSize, getMessageCount, onLeaseExpired, registerConsumer, resolveExpiredMessage, setCacheEvictionPolicy, setMaximumSize, shutdown, unregisterConsumer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List _queueListeners
| Method Detail |
|---|
public JmsDestination getDestination()
DestinationCache
getDestination in class DestinationCachepublic void addQueueListener(QueueListener listener)
listener - - queue listenerpublic void removeQueueListener(QueueListener listener)
listener - - queue listener to remove
public boolean messageAdded(JmsDestination destination,
MessageImpl message)
DestinationCacheMessageMgr adds a message
for this destination to the cache
messageAdded in interface MessageManagerEventListenermessageAdded in class DestinationCachedestination - the message's destinationmessage - - message added to cache
true if this message was accepted
public void messageRemoved(JmsDestination destination,
MessageImpl message)
MessageMgr removes a message
from the cache.
messageRemoved in interface MessageManagerEventListenermessageRemoved in class DestinationCachedestination - the message destinationmessage - the message removed from cache
public boolean persistentMessageAdded(java.sql.Connection connection,
JmsDestination destination,
MessageImpl message)
throws PersistenceException
MessageManagerEventListenerMessageMgr adds a persistent
message to the cache.
connection - the database connectiondestination - the message's destinationmessage - message added to cache
trueThrows:
PersistenceException - if there is a persistence related problem
public void persistentMessageRemoved(java.sql.Connection connection,
JmsDestination destination,
MessageImpl message)
throws PersistenceException
MessageManagerEventListenerMessageMgr removes a persistent
message from the cache.
connection - the database connectiondestination - the message's destinationmessage - message to remove from cache
PersistenceException - - if there is a persistence related problempublic MessageHandle getMessage(QueueConsumerEndpoint endpoint)
QueueConsumerEndpoint - - the consumer who will receive the message
public void playbackMessages(QueueListener listener)
QueueListener
listener - - the queue listenerpublic void returnMessage(MessageHandle handle)
message - - message to returnpublic boolean canDestroy()
QueueDestinationCache can be destroyed if there
are no active consumers and:
canDestroy in class DestinationCachetrue if the cache can be destroyed, otherwise
falsepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||