|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.services.cache.GenericCache com.bankframe.services.cache.JMSCache
The JMSCache class provides generic caching functionality using a distributed cache
within a clustered environment. It implements
the java.util.Map
interface. This class uses the supplied Map
implementation to maintain consistency between the cache and the data store. The
supplied Map implementation must store and read its contents from some permanent
data store. An object will remain in the cache until it expires. When the object
expires is determined by the CachePolicy object. Once an object has been removed from
the local cache a message is generted and put on a JMS Topic. This message will be
read by other instances in the cluster via the Message Driven Bean (MDB) com.bankframe.services.cache.JMSListener.
This MDB will remove the entry supplied in the message from the local cache on that
cluster node.
Nested Class Summary | |
static class |
JMSCache.JMSCacheEvent
|
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary | |
java.lang.String |
JMS_FACTORY
|
static java.lang.String |
JMS_MESSAGE_ID_CACHE
|
static java.lang.String |
JNDI_FACTORY
|
static java.lang.String |
NODE
|
java.lang.String |
TOPIC
|
Constructor Summary | |
JMSCache()
|
Method Summary | |
java.lang.Object |
addValueToCache(java.lang.String topicName,
java.lang.Object key,
java.lang.Object value)
|
void |
initialiseTopic(javax.naming.Context ctx,
JMSCache.JMSCacheEvent event)
Creates all the necessary objects for sending messages to a JMS Topic. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
This method updates the specified object to the data-store. |
void |
putAll(java.util.Map t)
This method places the specified values in the cache and the data-store. |
java.lang.Object |
remove(java.lang.Object key)
This method removes the specified object from the cache and the data store. |
void |
remove(java.util.Set keySet)
This method removes the specified keys from the cache and the data store. |
void |
removeAll()
Removes all objects from the cache and from the data store. |
void |
removeAllDontSend()
|
java.lang.Object |
removeDontSend(java.lang.Object key)
|
void |
removeDontSend(java.util.Set keySet)
|
Methods inherited from class com.bankframe.services.cache.GenericCache |
cleanup, clear, containsKey, containsValue, enableCaching, entrySet, equals, get, getCachePolicy, getFromPersistentMap, getName, getPersistentMap, hashCode, isEmpty, keySet, setCachePolicy, setName, setPersistentMap, size, toString, values |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static java.lang.String NODE
public static java.lang.String JNDI_FACTORY
public java.lang.String JMS_FACTORY
public java.lang.String TOPIC
public static final java.lang.String JMS_MESSAGE_ID_CACHE
Constructor Detail |
public JMSCache()
Method Detail |
public void initialiseTopic(javax.naming.Context ctx, JMSCache.JMSCacheEvent event) throws javax.naming.NamingException, javax.jms.JMSException
ctx
- JNDI initial context
javax.naming.NamingException
- if problem occurred with the JNDI context interface
javax.jms.JMSException
- if JMS fails to initialize due to internal errorpublic java.lang.Object put(java.lang.Object key, java.lang.Object value)
GenericCache
put
in interface java.util.Map
put
in class GenericCache
key
- Unique key identifying the objectvalue
- The objectMap.put(Object, Object)
public void putAll(java.util.Map t)
GenericCache
putAll
in interface java.util.Map
putAll
in class GenericCache
Map.putAll(Map)
public java.lang.Object removeDontSend(java.lang.Object key)
Map.remove(Object)
public void removeDontSend(java.util.Set keySet)
Cache.remove(Set)
public void removeAllDontSend()
Cache.removeAll()
public java.lang.Object remove(java.lang.Object key)
GenericCache
remove
in interface java.util.Map
remove
in class GenericCache
key
- Unique key identifying the object to removeMap.remove(Object)
public void remove(java.util.Set keySet)
GenericCache
remove
in interface Cache
remove
in class GenericCache
keySet
- the set of keys to removeCache.remove(Set)
public void removeAll()
GenericCache
removeAll
in interface Cache
removeAll
in class GenericCache
Cache.removeAll()
public java.lang.Object addValueToCache(java.lang.String topicName, java.lang.Object key, java.lang.Object value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |