ColdBox Platform Version 2.6.3

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
 any get(any objectKey)
          Get an object from cache. If its a soft reference object it might return a null value.
 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 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
 any getpool()
          Get the cache pool
 any getpool_metadata()
          Get the cache pool metadata
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 MyObject, [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()

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

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.


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


getpool

public any getpool()
Get the cache pool


getpool_metadata

public any getpool_metadata()
Get the cache pool metadata


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 MyObject, [any Timeout=''], [any LastAccessTimeout=''])
sets an object in cache.

Parameters:
objectKey
MyObject
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.3