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


Constructor Summary
CacheSupport()
           
 
Method Summary
 List<CacheEntry> entries()
          Returns a List of entries containing in this cache Each element in the returned list is a CacheEntry.
 List<CacheEntry> entries(CacheEntryFilter filter)
          Returns a list of entries containing in this cache that match the given filter.
 List<CacheEntry> 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 exist 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 exist or is stale
 Object getValue(String key, Object defaultValue)
          return value that match the key or the defaultValue when entry does not exist
 List<CacheEntry> keys(CacheEntryFilter filter)
          Returns a List of the keys contained in this cache that match the given filter.
 List<String> 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<String> keys(CacheKeyFilter filter)
                  throws IOException
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.
Throws:
IOException

keys

public List<CacheEntry> keys(CacheEntryFilter filter)
                      throws IOException
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.
Throws:
IOException

entries

public List<CacheEntry> entries()
                         throws IOException
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.
Throws:
IOException

entries

public List<CacheEntry> entries(CacheKeyFilter filter)
                         throws IOException
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.
Throws:
IOException

entries

public List<CacheEntry> entries(CacheEntryFilter filter)
                         throws IOException
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.
Throws:
IOException

values

public List values()
            throws IOException
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.
Throws:
IOException

values

public List values(CacheEntryFilter filter)
            throws IOException
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.
Throws:
IOException

values

public List values(CacheKeyFilter filter)
            throws IOException
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.
Throws:
IOException

remove

public int remove(CacheEntryFilter filter)
           throws IOException
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
Throws:
IOException

remove

public int remove(CacheKeyFilter filter)
           throws IOException
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
Throws:
IOException

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 exist or is stale

Specified by:
getValue in interface Cache
Parameters:
key - key of the value to get
Returns:
value
Throws:
CacheException
IOException

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

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 exist or is stale

Specified by:
getCacheEntry in interface Cache
Parameters:
key - key of the cache entry to get
Returns:
cache entry
Throws:
CacheException
IOException

getQuiet

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

getQuiet

public abstract CacheEntry getQuiet(String key,
                                    CacheEntry defaultValue)


Copyright © 2012 Railo