|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.exolab.jms.messagemgr.DestinationCache
|
+--org.exolab.jms.messagemgr.TopicDestinationCache
A DestinationCache for Topics. This cache extends DestinationCache but does not actually hold a reference to the messages. Instead it forwards them on to registered consumers.
We may need to build the cache for clients that fail over to the new server so we should maintain a cache of at least persistent messages handles. This is something that needs to be considered. As for non-persistent messages well that is the penalty for using them. If you want to ensure that you get every message, even during failover then you best publsih them using persistent delivery mode.
| Fields inherited from class org.exolab.jms.messagemgr.DestinationCache |
_consumers, _leaseHelper |
| Method Summary | |
boolean |
canDestroy()
Determines if this cache can be destroyed. |
JmsDestination |
getDestination()
Return a reference to the underlying destination |
int |
getMessageCount()
Return the number of messages currently active for this destination |
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. |
boolean |
registerConsumer(ConsumerEndpoint consumer)
Register a consumer with this cache. |
protected MessageImpl |
resolveExpiredMessage(MessageHandle handle)
Resolve an expired message through its handle |
java.lang.String |
toString()
|
| Methods inherited from class org.exolab.jms.messagemgr.DestinationCache |
collectGarbage, getConsumers, getDestinationByName, getId, getMaximumSize, onLeaseExpired, setCacheEvictionPolicy, setMaximumSize, shutdown, unregisterConsumer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public JmsDestination getDestination()
DestinationCachegetDestination in class DestinationCacheorg.exolab.jms.messagemgr.DestinationCache
public boolean messageAdded(JmsDestination destination,
MessageImpl message)
DestinationCacheMessageMgr adds a message
for this destination to the cachemessageAdded in class DestinationCacheorg.exolab.jms.messagemgr.DestinationCachemessage - - message added to cache
public void messageRemoved(JmsDestination destination,
MessageImpl message)
DestinationCacheMessageMgr removes a
message from the cache.messageRemoved in class DestinationCacheorg.exolab.jms.messagemgr.DestinationCachemessage - - 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.org.exolab.jms.messagemgr.MessageManagerEventListenerconnection - the database connectiondestination - the message's destinationmessage - message added to cachetrueThrows: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.org.exolab.jms.messagemgr.MessageManagerEventListenerconnection - the database connectionmessage - message to remove from cachedestination - the message's destinationPersistenceException - - if there is a persistence related problempublic boolean registerConsumer(ConsumerEndpoint consumer)
DestinationCacheConsumerEndpoint with an initial list of
messages that it needs to consume and then feed messages to it through
the specified listener object.
Messages are subsequently passed down to the consumer's through the listener, as they enter the DestinationCache.
registerConsumer in class DestinationCacheorg.exolab.jms.messagemgr.DestinationCacheconsumer - - message consumer for this destinationpublic int getMessageCount()
DestinationCachegetMessageCount in class DestinationCacheorg.exolab.jms.messagemgr.DestinationCachepublic boolean canDestroy()
TopicDestinationCache can be destroyed if there
are no active consumers.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.Objectprotected MessageImpl resolveExpiredMessage(MessageHandle handle)
resolveExpiredMessage in class DestinationCachehandle - the expired message's handle
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||