Stellent
HowToComponents
JavaDoc

intradoc.resource
Class ResourceCacheState

java.lang.Object
  |
  +--intradoc.resource.ResourceCacheState

public class ResourceCacheState
extends java.lang.Object

Class holds state information about resources that are cacheds.


Field Summary
protected static int m_ageResourceFilesTimeoutInSecs
          Timeout for aging dynamically referenced resource files.
protected static java.util.Hashtable m_cacheInfo
          Holds current resource info for templates and other resources (use lookup keys).
protected static int m_maximumSizeMillions
          Maximum size for storing resources in millions of double byte characters.
protected static int m_removeResourceFilesTimeoutInMins
          Timeout for removing dynamically referenced resource files.
protected static java.util.Hashtable m_resourceInfo
          Holds lookup table of loaded resource files.
protected static java.util.Vector m_resourceList
          Holds array of loaded global resource files.
protected static ResourceCacheInfo m_tempEnd
          End of linked list of temporary resource cached infos.
protected static java.util.Hashtable m_temporaryCaches
          Holds temporary caches that are automatically timed out.
protected static ResourceCacheInfo m_tempStart
          Start of linked list of temporary resource cached infos.
 
Constructor Summary
ResourceCacheState()
           
 
Method Summary
static ResourceCacheInfo addCacheInfo(java.lang.String key, java.lang.String type, java.lang.String filePath)
          Adds information about a template (returns a structure holding current information which can be used to update of template).
static ResourceCacheInfo addResourceInfo(java.lang.String key, java.lang.String filePath)
          Adds a resource to the list.
static void addTemporaryCache(java.lang.String key, ResourceCacheInfo info)
          Add to the temporary cache.
static void addTimedTemporaryCache(java.lang.String key, ResourceCacheInfo info, long startTime)
           
static void checkTemporaryCache(long curTime)
          Remove timeout cached resources
protected static void detachFromCache(ResourceCacheInfo res)
          Support method to remove from linked list and update totals.
static int getAgeResourceFilesTimeoutInSecs()
           
static ResourceCacheInfo getCacheInfo(java.lang.String key)
          Gets information about a template.
static int getMaxSizeResourceFileCacheMillions()
           
static int getRemoveResourceFilesTimeoutInMins()
           
static void getReport(boolean fullReport, DataBinder binder)
          Reports current cache state.
static java.util.Vector getResourceList()
          Gets resource list.
static ResourceCacheInfo getTemporaryCache(java.lang.String key, long curTime)
          Gets information about a temporary cache object.
protected static void promoteCache(ResourceCacheInfo res)
          Support methods for linked list management.
static ResourceCacheInfo removeTemporaryCache(java.lang.String key)
           
static void setAgeResourceFilesTimeoutInSecs(int ageResourceFilesTimeoutInSecs)
           
static void setMaxSizeResourceFileCacheMillions(int maximumSizeMillions)
           
static void setRemoveResourceFilesTimeoutInMins(int removeResourceFilesTimeoutInMins)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cacheInfo

protected static java.util.Hashtable m_cacheInfo
Holds current resource info for templates and other resources (use lookup keys).


m_resourceList

protected static java.util.Vector m_resourceList
Holds array of loaded global resource files. Timestamps on all resource files have to be validated.


m_resourceInfo

protected static java.util.Hashtable m_resourceInfo
Holds lookup table of loaded resource files. Used to determine if resource is known about.


m_temporaryCaches

protected static java.util.Hashtable m_temporaryCaches
Holds temporary caches that are automatically timed out.


m_tempStart

protected static ResourceCacheInfo m_tempStart
Start of linked list of temporary resource cached infos.


m_tempEnd

protected static ResourceCacheInfo m_tempEnd
End of linked list of temporary resource cached infos.


m_ageResourceFilesTimeoutInSecs

protected static int m_ageResourceFilesTimeoutInSecs
Timeout for aging dynamically referenced resource files. Value in seconds.


m_removeResourceFilesTimeoutInMins

protected static int m_removeResourceFilesTimeoutInMins
Timeout for removing dynamically referenced resource files. Value in minutes.


m_maximumSizeMillions

protected static int m_maximumSizeMillions
Maximum size for storing resources in millions of double byte characters. Note this is the size of the files before they are read in and parsed. Multiply sizes by about 2.5 to get better estimate of true size in memory (Unicode strings plus overhead for all the GrammerElement structures).

Constructor Detail

ResourceCacheState

public ResourceCacheState()
Method Detail

getAgeResourceFilesTimeoutInSecs

public static int getAgeResourceFilesTimeoutInSecs()

setRemoveResourceFilesTimeoutInMins

public static void setRemoveResourceFilesTimeoutInMins(int removeResourceFilesTimeoutInMins)

getRemoveResourceFilesTimeoutInMins

public static int getRemoveResourceFilesTimeoutInMins()

setAgeResourceFilesTimeoutInSecs

public static void setAgeResourceFilesTimeoutInSecs(int ageResourceFilesTimeoutInSecs)

getMaxSizeResourceFileCacheMillions

public static int getMaxSizeResourceFileCacheMillions()

setMaxSizeResourceFileCacheMillions

public static void setMaxSizeResourceFileCacheMillions(int maximumSizeMillions)

addCacheInfo

public static ResourceCacheInfo addCacheInfo(java.lang.String key,
                                             java.lang.String type,
                                             java.lang.String filePath)
Adds information about a template (returns a structure holding current information which can be used to update of template).


getCacheInfo

public static ResourceCacheInfo getCacheInfo(java.lang.String key)
Gets information about a template.


getResourceList

public static java.util.Vector getResourceList()
Gets resource list.


addResourceInfo

public static ResourceCacheInfo addResourceInfo(java.lang.String key,
                                                java.lang.String filePath)
Adds a resource to the list. Returns an information object about resource which can be used to update state about resource.


getTemporaryCache

public static ResourceCacheInfo getTemporaryCache(java.lang.String key,
                                                  long curTime)
Gets information about a temporary cache object.


addTemporaryCache

public static void addTemporaryCache(java.lang.String key,
                                     ResourceCacheInfo info)
Add to the temporary cache.


addTimedTemporaryCache

public static void addTimedTemporaryCache(java.lang.String key,
                                          ResourceCacheInfo info,
                                          long startTime)

removeTemporaryCache

public static ResourceCacheInfo removeTemporaryCache(java.lang.String key)

checkTemporaryCache

public static void checkTemporaryCache(long curTime)
Remove timeout cached resources


getReport

public static void getReport(boolean fullReport,
                             DataBinder binder)
Reports current cache state.


detachFromCache

protected static void detachFromCache(ResourceCacheInfo res)
Support method to remove from linked list and update totals. Must be inside a synchronization block.


promoteCache

protected static void promoteCache(ResourceCacheInfo res)
Support methods for linked list management. Must be inside a synchronization block.



(c) 1996-2005  All rights reserved.  Stellent, Inc.