org.eclipse.datatools.connectivity.oda.util
Class ResourceCache

java.lang.Object
  extended byorg.eclipse.datatools.connectivity.oda.util.ResourceCache

public final class ResourceCache
extends java.lang.Object

This class provides a cache-like functionality for storing of resource bundles. The class maintains a linked list of such bundles whose keys are stored in a hashtable. This class provides the mechanism to load a resource from the cache of stored bundles. If the desired resource is not found in the cache, the same is loaded afresh and added into the cache, provided the cache limit is not exceeded, in which case, the last resource is removed from the cache and the new one is added in to the list for future use. This class also provides a method to analyze the content of the cache using the locale provided. The method displays messages like the maximum limit of cache, number of resources held under the cache, name of the resources, display language/country of the resource, etc. On can also set the maximum limit of the cache.


Method Summary
 void flushCache()
           
 ResourceManager getResources(java.lang.String sFQClass, java.util.Locale lo)
           
static ResourceCache instance()
           
 void setCacheSize(int iMaxBundles)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static final ResourceCache instance()
Returns:
ResourceCache

getResources

public final ResourceManager getResources(java.lang.String sFQClass,
                                          java.util.Locale lo)
                                   throws java.lang.IllegalArgumentException
Parameters:
sFQClass -
lo -
Returns:
ResourceManager
Throws:
java.lang.IllegalArgumentException

flushCache

public final void flushCache()

setCacheSize

public final void setCacheSize(int iMaxBundles)
Parameters:
iMaxBundles -


Copyright © 2005 Actuate Corp. All rights reserved.