org.activemq.store.cache
Class SimpleMessageCache

java.lang.Object
  extended by org.activemq.store.cache.SimpleMessageCache
All Implemented Interfaces:
MessageCache

public class SimpleMessageCache
extends Object
implements MessageCache

A simple cache that stores messages in memory. Cache entries are evicted when they they get to old (A LRU cache is used).

Version:
$Revision: 1.1.1.1 $

Constructor Summary
SimpleMessageCache()
           
SimpleMessageCache(int cacheSize)
           
 
Method Summary
 void close()
          Lets a cache know it will not be used any further and that it can release aquired resources
 ActiveMQMessage get(String msgid)
          Gets a message that was previously put into this object.
 void put(String messageID, ActiveMQMessage message)
          Puts a message into the cache.
 void remove(String messageID)
          Remvoes a message from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMessageCache

public SimpleMessageCache()

SimpleMessageCache

public SimpleMessageCache(int cacheSize)
Method Detail

get

public ActiveMQMessage get(String msgid)
Gets a message that was previously put into this object.

Specified by:
get in interface MessageCache
Parameters:
msgid -
Returns:
null if the message was not previously put or if the message has expired out of the cache.

put

public void put(String messageID,
                ActiveMQMessage message)
Puts a message into the cache.

Specified by:
put in interface MessageCache
Parameters:
messageID -
message -

remove

public void remove(String messageID)
Remvoes a message from the cache.

Specified by:
remove in interface MessageCache
Parameters:
messageID -

close

public void close()
Description copied from interface: MessageCache
Lets a cache know it will not be used any further and that it can release aquired resources

Specified by:
close in interface MessageCache


Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.