org.teiid.cache.jboss
Class ExpirationAwareCache<K,V>

java.lang.Object
  extended by org.teiid.cache.jboss.JBossCache<K,V>
      extended by org.teiid.cache.jboss.ExpirationAwareCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class ExpirationAwareCache<K,V>
extends JBossCache<K,V>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.teiid.cache.Cache
Cache.Type
 
Field Summary
 
Fields inherited from class org.teiid.cache.jboss.JBossCache
cacheListener, cacheStore, config, rootFqn
 
Constructor Summary
ExpirationAwareCache(org.jboss.cache.Cache cacheStore, org.jboss.cache.Fqn fqn)
           
 
Method Summary
 void clear()
          Removes all the keys and their values from the Cache
 V get(K key)
          Retrieves the value for the given Key
 V put(K key, V value)
           
 V put(K key, V value, java.lang.Long ttl)
          Associates the specified value with the specified key this cache.
 V remove(K key)
          Removes the value for this key from a Cache.
 int size()
          Size of the cache
 
Methods inherited from class org.teiid.cache.jboss.JBossCache
addChild, addListener, getChild, getChildren, getName, getRootNode, keySet, removeChild, removeListener, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpirationAwareCache

public ExpirationAwareCache(org.jboss.cache.Cache cacheStore,
                            org.jboss.cache.Fqn fqn)
Method Detail

get

public V get(K key)
Description copied from interface: Cache
Retrieves the value for the given Key

Specified by:
get in interface Cache<K,V>
Overrides:
get in class JBossCache<K,V>
Parameters:
key - key under which value is to be retrieved.
Returns:
returns data held under specified key in cache

put

public V put(K key,
             V value)
Overrides:
put in class JBossCache<K,V>

put

public V put(K key,
             V value,
             java.lang.Long ttl)
Description copied from interface: Cache
Associates the specified value with the specified key this cache. If the cache previously contained a mapping for this key, the old value is replaced by the specified value.

Specified by:
put in interface Cache<K,V>
Overrides:
put in class JBossCache<K,V>
Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
ttl - the time for this entry to live
Returns:
previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the key previously associated null with the specified key, if the implementation supports null values.

remove

public V remove(K key)
Description copied from interface: Cache
Removes the value for this key from a Cache. Returns the value to which the Key previously associated , or null if the Key contained no mapping.

Specified by:
remove in interface Cache<K,V>
Overrides:
remove in class JBossCache<K,V>
Parameters:
key - key whose mapping is to be removed
Returns:
previous value associated with specified Node's key

clear

public void clear()
Description copied from interface: Cache
Removes all the keys and their values from the Cache

Specified by:
clear in interface Cache<K,V>
Overrides:
clear in class JBossCache<K,V>

size

public int size()
Description copied from interface: Cache
Size of the cache

Specified by:
size in interface Cache<K,V>
Overrides:
size in class JBossCache<K,V>
Returns:
number of items in this cache


Copyright © 2010. All Rights Reserved.