ColdBox Platform Version 2.6.4

coldbox.system.cache
Class ObjectPool

WEB-INF.cftags.component
        extended by coldbox.system.cache.ObjectPool
Direct Known Subclasses:
MTObjectPool

public class ObjectPool
extends WEB-INF.cftags.component

I manage persistance for objects.


Constructor Summary
init()
          Constructor
 
Method Summary
 boolean clearKey(string objectKey)
          Clears a key from the cache
private any createSoftReference(any objectKey, any MyObject)
          Create SR, register cached object and reference
 void expireObject(any objectKey)
          Set an object for expiration
 any get(any objectKey)
          Get an object from cache
 any getMetadataProperty(any objectKey, any property)
          Get a metadata property for a specific cache entry
 any getObjectMetadata(any objectKey)
          Get a metadata entry for a specific cache entry
 string getObjectsKeyList()
          Get the cache's object entries listing
 any getPool()
          Get the cache pool
 any getPoolKeys()
          Get all the pool keys
 any getPoolMetadata()
          Get the cache pool metadata
 any getReferenceQueue()
          Get ReferenceQueue
 numeric getSize()
          Get the cache's size in items
 any getSoftRefKey(any softRef)
          Get the soft reference's key from the soft reference lookback map
 any getSoftRefKeyMap()
          Get SoftRefKeyMap
private boolean isSoftReference(any MyObject)
          Whether the passed object is a soft reference
 boolean lookup(any objectKey)
          Check if an object is in cache, it doesn't tell you if the soft reference expired or not
 void set(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''])
          sets an object in cache
 void setMetadataProperty(any objectKey, any property, any value)
          Set a metadata property for a specific cache entry
 void setObjectMetadata(any objectKey, any metadata)
          Set the metadata entry for a specific cache entry
private void setReferenceQueue(any ReferenceQueue)
          Set ReferenceQueue
private void setSoftRefKeyMap(any SoftRefKeyMap)
          Set SoftRefKeyMap
private void setpool(struct pool)
          Set the cache pool
 void setpool_metadata(struct pool_metadata)
          Set the cache pool metadata
 boolean softRefLookup(any softRef)
          See if the soft reference is in the key map
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init()
Constructor

Method Detail

clearKey

public boolean clearKey(string objectKey)
Clears a key from the cache.

Parameters:
objectKey

createSoftReference

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

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

expireObject

public void expireObject(any objectKey)
Set an object for expiration

Parameters:
objectKey - The object key

get

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

Parameters:
objectKey

getMetadataProperty

public any getMetadataProperty(any objectKey, any property)
Get a metadata property for a specific cache entry

Parameters:
objectKey
property

getObjectMetadata

public any getObjectMetadata(any objectKey)
Get a metadata entry for a specific cache entry

Parameters:
objectKey

getObjectsKeyList

public string getObjectsKeyList()
Get the cache's object entries listing.


getPool

public any getPool()
Get the cache pool


getPoolKeys

public any getPoolKeys()
Get all the pool keys


getPoolMetadata

public any getPoolMetadata()
Get the cache pool metadata


getReferenceQueue

public any getReferenceQueue()
Get ReferenceQueue


getSize

public numeric getSize()
Get the cache's size in items


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 SoftRefKeyMap


isSoftReference

private boolean isSoftReference(any MyObject)
Whether the passed object is a soft reference

Parameters:
MyObject - The object to test

lookup

public boolean lookup(any objectKey)
Check if an object is in cache, it doesn't tell you if the soft reference expired or not

Parameters:
objectKey

set

public void set(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''])
sets an object in cache.

Parameters:
objectKey - The object key
object - The object to save
timeout - Timeout in minutes. If timeout = 0 then object never times out. If timeout is blank, then timeout will be inherited from framework.
lastAccessTimeout - Timeout in minutes. If timeout is blank, then timeout will be inherited from framework.

setMetadataProperty

public void setMetadataProperty(any objectKey, any property, any value)
Set a metadata property for a specific cache entry

Parameters:
objectKey
property
value

setObjectMetadata

public void setObjectMetadata(any objectKey, any metadata)
Set the metadata entry for a specific cache entry

Parameters:
objectKey
metadata

setReferenceQueue

private void setReferenceQueue(any ReferenceQueue)
Set ReferenceQueue

Parameters:
ReferenceQueue

setSoftRefKeyMap

private void setSoftRefKeyMap(any SoftRefKeyMap)
Set SoftRefKeyMap

Parameters:
SoftRefKeyMap

setpool

private void setpool(struct pool)
Set the cache pool

Parameters:
pool

setpool_metadata

public void setpool_metadata(struct pool_metadata)
Set the cache pool metadata

Parameters:
pool_metadata

softRefLookup

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

Parameters:
softRef - The soft reference to check

ColdBox Platform Version 2.6.4