|
||||||||||
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 DestinationCache
public void addQueueListener(QueueListener listener)
listener
- - queue listenerpublic void removeQueueListener(QueueListener listener)
listener
- - queue listener to removepublic boolean messageAdded(JmsDestination destination, MessageImpl message)
DestinationCache
MessageMgr
adds a message
for this destination to the cache
messageAdded
in interface MessageManagerEventListener
messageAdded
in class DestinationCache
destination
- the message's destinationmessage
- - message added to cache
true
if this message was acceptedpublic void messageRemoved(JmsDestination destination, MessageImpl message)
MessageMgr
removes a message
from the cache.
messageRemoved
in interface MessageManagerEventListener
messageRemoved
in class DestinationCache
destination
- the message destinationmessage
- the message removed from cachepublic boolean persistentMessageAdded(java.sql.Connection connection, JmsDestination destination, MessageImpl message) throws PersistenceException
MessageManagerEventListener
MessageMgr
adds a persistent
message to the cache.
connection
- the database connectiondestination
- the message's destinationmessage
- message added to cache
true
Throws:
PersistenceException
- if there is a persistence related problempublic void persistentMessageRemoved(java.sql.Connection connection, JmsDestination destination, MessageImpl message) throws PersistenceException
MessageManagerEventListener
MessageMgr
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 DestinationCache
true
if the cache can be destroyed, otherwise
false
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |