ColdBox Platform Version 3.7.0

coldbox.system.cache.store
Class ConcurrentSoftReferenceStore

WEB-INF.cftags.component
        extended by coldbox.system.cache.store.ConcurrentStore
            extended by coldbox.system.cache.store.ConcurrentSoftReferenceStore
All Implemented Interfaces:
IObjectStore

public class ConcurrentSoftReferenceStore
extends ConcurrentStore

I am a concurrent soft reference object store. In other words, I am fancy!


Constructor Summary
init(any<ICacheProvider> cacheProvider)
          Constructor
 
Method Summary
 any clear(any objectKey)
          Clears an object from the storage pool
 void clearAll()
          Clear all elements of the store
private any createSoftReference(any objectKey, any target)
          Create SR, register cached object and reference
 any get(any objectKey)
          Get an object from cache
 any getQuiet(any objectKey)
          Get an object from cache
 any getReferenceQueue()
          Get soft reference queue object
 any getSoftRefKey(any softRef)
          Get the soft reference's key from the soft reference lookback map
 any getSoftRefKeyMap()
          Get the soft reference key map
 any lookup(any objectKey)
          Check if an object is in cache
 void reap()
          Reap the storage, clean it from old stuff
 void set(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [any extras='[runtime expression]'])
          sets an object in the storage
 any softRefLookup(any softRef)
          See if the soft reference is in the reference key map
 
Methods inherited from class coldbox.system.cache.store.ConcurrentStore
expireObject, flush, getIndexer, getKeys, getPool, getSize, getStoreID, isExpired
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any<ICacheProvider> cacheProvider)
Constructor

Parameters:
cacheProvider - The associated cache provider as coldbox.system.cache.ICacheProvider
Method Detail

clear

public any clear(any objectKey)
Clears an object from the storage pool

Overrides:
clear in class ConcurrentStore
Parameters:
objectKey - The object key

clearAll

public void clearAll()
Clear all elements of the store

Overrides:
clearAll in class ConcurrentStore

createSoftReference

private any createSoftReference(any objectKey, any target)
Create SR, register cached object and reference

Parameters:
objectKey - The value of the key pair
target - The object to wrap

get

public any get(any objectKey)
Get an object from cache. If its a soft reference object it might return a null value.

Overrides:
get in class ConcurrentStore
Parameters:
objectKey - The key of the object

getQuiet

public any getQuiet(any objectKey)
Get an object from cache. If its a soft reference object it might return a null value.

Overrides:
getQuiet in class ConcurrentStore
Parameters:
objectKey - The key of the object

getReferenceQueue

public any getReferenceQueue()
Get soft reference queue object


getSoftRefKey

public any getSoftRefKey(any softRef)
Get the soft reference's key from the soft reference lookback map

Parameters:
softRef - The soft reference to check

getSoftRefKeyMap

public any getSoftRefKeyMap()
Get the soft reference key map


lookup

public any lookup(any objectKey)
Check if an object is in cache.

Overrides:
lookup in class ConcurrentStore
Parameters:
objectKey - The key of the object

reap

public void reap()
Reap the storage, clean it from old stuff

Overrides:
reap in class ConcurrentStore

set

public void set(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [any extras='[runtime expression]'])
sets an object in the storage.

Overrides:
set in class ConcurrentStore
Parameters:
objectKey - The object key
object - The object to save
timeout - Timeout in minutes
lastAccessTimeout - Idle Timeout in minutes
extras - A map of extra name-value pairs

softRefLookup

public any softRefLookup(any softRef)
See if the soft reference is in the reference key map

Parameters:
softRef - The soft reference to check

ColdBox Platform Version 3.7.0