atg.commerce.pricing.priceLists
Class PriceCacheAdapter

java.lang.Object
  extended by atg.commerce.pricing.priceLists.PriceCacheAdapter
All Implemented Interfaces:
CacheAdapter

public class PriceCacheAdapter
extends java.lang.Object
implements CacheAdapter


Field Summary
static java.lang.String CLASS_VERSION
          class version string
 
Constructor Summary
PriceCacheAdapter()
           
 
Method Summary
 java.lang.Object getCacheElement(java.lang.Object pKey)
          Gets the element to be stored in the cache with the given key.
 java.lang.Object[] getCacheElements(java.lang.Object[] pKeys)
          Returns the array of elements corresponding to the given array of keys.
 int getCacheElementSize(java.lang.Object pElement, java.lang.Object pKey)
          Returns the approximate size in bytes of the given cache element.
 int getCacheKeySize(java.lang.Object pKey)
          Returns the approximate size in bytes of the given cache key.
 PriceListManager getPriceListManager()
           
 void removeCacheElement(java.lang.Object pElement, java.lang.Object pKey)
          This method is called by the synchronized method Cache.remove to allow the adapter to do any related clean up, if necessary, when an element is removed from the cache.
 void setPriceListManager(PriceListManager pPriceListManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
class version string

Constructor Detail

PriceCacheAdapter

public PriceCacheAdapter()
Method Detail

setPriceListManager

public void setPriceListManager(PriceListManager pPriceListManager)

getPriceListManager

public PriceListManager getPriceListManager()

getCacheElement

public java.lang.Object getCacheElement(java.lang.Object pKey)
                                 throws java.lang.Exception
Description copied from interface: CacheAdapter
Gets the element to be stored in the cache with the given key. Returns null if no element can be found for the given key.

Specified by:
getCacheElement in interface CacheAdapter
Throws:
java.lang.Exception - if some form of exception occurs while attempting to retrieve the element (e.g., SQLException). Since the type of exceptions possible depend upon the implementation of the adapter, the interface allows for generic exceptions.

getCacheElements

public java.lang.Object[] getCacheElements(java.lang.Object[] pKeys)
                                    throws java.lang.Exception
Description copied from interface: CacheAdapter
Returns the array of elements corresponding to the given array of keys. This method is provided as part of the interface to allow for more efficient retrieval of multiple elements than getting them one at a time. Implementations of this method are required to return an array of elements ordered the same as the corresponding keys in the input array. If an element cannot be found for any given key, the value returned for that array element should be null.

Specified by:
getCacheElements in interface CacheAdapter
Throws:
java.lang.Exception - if some form of exception occurs while attempting to retrieve the elements (e.g., SQLException). Since the type of exceptions possible depend upon the implementation of the adapter, the interface allows for generic exceptions.

getCacheKeySize

public int getCacheKeySize(java.lang.Object pKey)
Description copied from interface: CacheAdapter
Returns the approximate size in bytes of the given cache key. The implementation may choose to simply return zero if the size cannot be determined, but assuming both size methods return zero, the maximumEntrySize and maximumCacheSize properties of the cache using this adapter will in effect be ignored and only the maximumCacheEntries property will limit the cache size.

Specified by:
getCacheKeySize in interface CacheAdapter

getCacheElementSize

public int getCacheElementSize(java.lang.Object pElement,
                               java.lang.Object pKey)
Description copied from interface: CacheAdapter
Returns the approximate size in bytes of the given cache element. (The key is passed in as well in case the implementation needs it for any reason.) The implementation my choose to simply return zero if the size cannot be determined, but assuming both size methods return zero, the maximumEntrySize and maximumCacheSize properties of the cache using this adapter will in effect be ignored and only the maximumCacheEntries property will limit the cache size.

Specified by:
getCacheElementSize in interface CacheAdapter

removeCacheElement

public void removeCacheElement(java.lang.Object pElement,
                               java.lang.Object pKey)
Description copied from interface: CacheAdapter
This method is called by the synchronized method Cache.remove to allow the adapter to do any related clean up, if necessary, when an element is removed from the cache. Most adapters will simply implement this as an empty method.

Specified by:
removeCacheElement in interface CacheAdapter