WebObjects 5.4

com.webobjects.appserver
Class WOSession.PageFragmentCache

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,com.webobjects.appserver._private.WOTransactionRecord>
              extended by com.webobjects.appserver.WOSession.PageFragmentCache
All Implemented Interfaces:
Serializable, Cloneable, Map<String,com.webobjects.appserver._private.WOTransactionRecord>
Enclosing class:
WOSession

public static class WOSession.PageFragmentCache
extends LinkedHashMap<String,com.webobjects.appserver._private.WOTransactionRecord>

Used primarily in Ajax style page caching. We remove the eldest entry if the page frament cache size has grown beyone 2X the settting for WOApplication.pageFragmentCacheSize().

Since:
5.4
See Also:
Serialized Form

Constructor Summary
WOSession.PageFragmentCache()
           
 
Method Summary
 boolean cleanPageCache(String fragmentKey)
          Maintenance the page fragement cache.
 WOComponent pageForContextID(String contextID)
          For a given contextID, return the page.
protected  boolean removeEldestEntry(Map.Entry<String,com.webobjects.appserver._private.WOTransactionRecord> eldest)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

WOSession.PageFragmentCache

public WOSession.PageFragmentCache()
Method Detail

removeEldestEntry

protected boolean removeEldestEntry(Map.Entry<String,com.webobjects.appserver._private.WOTransactionRecord> eldest)
Overrides:
removeEldestEntry in class LinkedHashMap<String,com.webobjects.appserver._private.WOTransactionRecord>

pageForContextID

public WOComponent pageForContextID(String contextID)
For a given contextID, return the page.

Parameters:
contextID -
Returns:
WOComponent
Since:
5.4

cleanPageCache

public boolean cleanPageCache(String fragmentKey)
Maintenance the page fragement cache. Remove the oldest entry if we're about to add a new one and that would put us over the cache size. Also, clears out expired pages from the cache when invoked.

Parameters:
fragmentKey - if null, will perform maintenance on the cache
Returns:
boolean true if cache entry successfully cleared
Since:
5.4

Last updated Tuesday, October 9, 2007 08:58 PDT

Copyright © 2000-2007 Apple Inc.