|
||||||||
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()
DestinationCache
getDestination
in class DestinationCache
org.exolab.jms.messagemgr.DestinationCache
public boolean messageAdded(JmsDestination destination, MessageImpl message)
DestinationCache
MessageMgr
adds a message
for this destination to the cachemessageAdded
in class DestinationCache
org.exolab.jms.messagemgr.DestinationCache
message
- - message added to cachepublic void messageRemoved(JmsDestination destination, MessageImpl message)
DestinationCache
MessageMgr
removes a
message from the cache.messageRemoved
in class DestinationCache
org.exolab.jms.messagemgr.DestinationCache
message
- - 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.org.exolab.jms.messagemgr.MessageManagerEventListener
connection
- the database connectiondestination
- the message's destinationmessage
- message added to cachetrue
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.org.exolab.jms.messagemgr.MessageManagerEventListener
connection
- the database connectionmessage
- message to remove from cachedestination
- the message's destinationPersistenceException
- - if there is a persistence related problempublic boolean registerConsumer(ConsumerEndpoint consumer)
DestinationCache
ConsumerEndpoint
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 DestinationCache
org.exolab.jms.messagemgr.DestinationCache
consumer
- - message consumer for this destinationpublic int getMessageCount()
DestinationCache
getMessageCount
in class DestinationCache
org.exolab.jms.messagemgr.DestinationCache
public boolean canDestroy()
TopicDestinationCache
can be destroyed if there
are no active consumers.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
protected MessageImpl resolveExpiredMessage(MessageHandle handle)
resolveExpiredMessage
in class DestinationCache
handle
- the expired message's handle
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |