railo.runtime.cache
Class CacheSupport

java.lang.Object
  extended by railo.runtime.cache.CacheSupport
All Implemented Interfaces:
Cache
Direct Known Subclasses:
EHCacheRemote, EHCacheSupport, RamCache

public abstract class CacheSupport
extends Object
implements Cache


Field Summary
 
Fields inherited from interface railo.commons.io.cache.Cache
DEFAULT_CACHE_NAME
 
Constructor Summary
CacheSupport()
           
 
Method Summary
 List entries()
          Returns a List of entries containing in this cache Each element in the returned list is a CacheEntry.
 List entries(CacheEntryFilter filter)
          Returns a list of entries containing in this cache that match the given filter.
 List entries(CacheKeyFilter filter)
          Returns a list of entries containing in this cache that match the given filter.
 CacheEntry getCacheEntry(String key)
          return cache entry that match the key, throws a CacheException when entry does not exists or is stale
 Struct getCustomInfo()
          get all information data available for this cache
 CacheEntry getQuiet(String key)
           
abstract  CacheEntry getQuiet(String key, CacheEntry defaultValue)
           
 Object getValue(String key)
          return value that match the key, throws a CacheException when entry does not exists or is stale
 Object getValue(String key, Object defaultValue)
          return value that match the key or the defaultValue when entry does not exist
 List keys(CacheEntryFilter filter)
          Returns a List of the keys contained in this cache that match the given filter.
 List keys(CacheKeyFilter filter)
          Returns a List of the keys contained in this cache that match the given filter.
 int remove(CacheEntryFilter filter)
          remove all entries that match the given filter
 int remove(CacheKeyFilter filter)
          remove all entries that match the given filter
 List values()
          Returns a List of values containing in this cache.
 List values(CacheEntryFilter filter)
          Returns a list of values containing in this cache that match the given filter.
 List values(CacheKeyFilter filter)
          Returns a list of values containing in this cache that match the given filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface railo.commons.io.cache.Cache
contains, getCacheEntry, hitCount, init, keys, missCount, put, remove
 

Constructor Detail

CacheSupport

public CacheSupport()
Method Detail

keys

public List keys(CacheKeyFilter filter)
Description copied from interface: Cache
Returns a List of the keys contained in this cache that match the given filter. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
keys in interface Cache
Returns:
a set of the keys contained in this cache.
See Also:
Cache.keys(railo.commons.io.cache.CacheKeyFilter)

keys

public List keys(CacheEntryFilter filter)
Description copied from interface: Cache
Returns a List of the keys contained in this cache that match the given filter. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
keys in interface Cache
Returns:
a set of the keys contained in this cache.
See Also:
Cache.keys(railo.commons.io.cache.CacheEntryFilter)

entries

public List entries()
Description copied from interface: Cache
Returns a List of entries containing in this cache Each element in the returned list is a CacheEntry. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
entries in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.entries()

entries

public List entries(CacheKeyFilter filter)
Description copied from interface: Cache
Returns a list of entries containing in this cache that match the given filter. Each element in the returned set is a CacheEntry. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
entries in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.entries(railo.commons.io.cache.CacheKeyFilter)

entries

public List entries(CacheEntryFilter filter)
Description copied from interface: Cache
Returns a list of entries containing in this cache that match the given filter. Each element in the returned set is a CacheEntry. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
entries in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.entries(railo.commons.io.cache.CacheEntryFilter)

values

public List values()
Description copied from interface: Cache
Returns a List of values containing in this cache. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
values in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.values()

values

public List values(CacheEntryFilter filter)
Description copied from interface: Cache
Returns a list of values containing in this cache that match the given filter. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
values in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.values(railo.commons.io.cache.CacheEntryFilter)

values

public List values(CacheKeyFilter filter)
Description copied from interface: Cache
Returns a list of values containing in this cache that match the given filter. The set is NOT backed by the cache, so changes to the cache are NOT reflected in the set, and vice-versa.

Specified by:
values in interface Cache
Returns:
a set of the entries contained in this cache.
See Also:
Cache.values(railo.commons.io.cache.CacheKeyFilter)

remove

public int remove(CacheEntryFilter filter)
Description copied from interface: Cache
remove all entries that match the given filter

Specified by:
remove in interface Cache
Returns:
returns the count of the removal or -1 if this information is not available
See Also:
Cache.remove(railo.commons.io.cache.CacheEntryFilter)

remove

public int remove(CacheKeyFilter filter)
Description copied from interface: Cache
remove all entries that match the given filter

Specified by:
remove in interface Cache
Returns:
returns the count of the removal or -1 if this information is not available
See Also:
Cache.remove(railo.commons.io.cache.CacheKeyFilter)

getCustomInfo

public Struct getCustomInfo()
Description copied from interface: Cache
get all information data available for this cache

Specified by:
getCustomInfo in interface Cache

getValue

public Object getValue(String key)
                throws IOException
Description copied from interface: Cache
return value that match the key, throws a CacheException when entry does not exists or is stale

Specified by:
getValue in interface Cache
Parameters:
key - key of the value to get
Returns:
value
Throws:
IOException
See Also:
Cache.getValue(java.lang.String)

getValue

public Object getValue(String key,
                       Object defaultValue)
Description copied from interface: Cache
return value that match the key or the defaultValue when entry does not exist

Specified by:
getValue in interface Cache
Parameters:
key - key of the value to get
Returns:
value
See Also:
Cache.getValue(java.lang.String, java.lang.Object)

getCacheEntry

public CacheEntry getCacheEntry(String key)
                         throws IOException
Description copied from interface: Cache
return cache entry that match the key, throws a CacheException when entry does not exists or is stale

Specified by:
getCacheEntry in interface Cache
Parameters:
key - key of the cache entry to get
Returns:
cache entry
Throws:
IOException
See Also:
Cache.getCacheEntry(java.lang.String)

getQuiet

public CacheEntry getQuiet(String key)
                    throws IOException
Throws:
IOException

getQuiet

public abstract CacheEntry getQuiet(String key,
                                    CacheEntry defaultValue)


Copyright © 2012 Railo