org.codehaus.spice.salt.i18n
Class ResourceManager

java.lang.Object
  extended byorg.codehaus.spice.salt.i18n.ResourceManager

public class ResourceManager
extends Object

Manager for resources.

Author:
Peter Donald, Eung-ju Park

Constructor Summary
ResourceManager()
           
 
Method Summary
static void clearResourceCache()
          Clear the cache of all resources currently loaded into the system.
static Resources getBaseResources(String basename, ClassLoader classLoader)
          Retrieve resource with specified basename.
static Resources getClassResources(Class clazz)
          Retrieve resource for specified Class.
static Resources getPackageResources(Class clazz)
          Retrieve resource for specified Classes package.
static Resources getResources(String resource, ClassLoader classLoader)
          Retrieve resource for specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

clearResourceCache

public static final void clearResourceCache()
                                     throws SecurityException
Clear the cache of all resources currently loaded into the system. This method is useful if you need to dump the complete cache and because part of the application is reloading and thus the resources may need to be reloaded.

Note that the caller must have been granted the "i18n.clearCompleteCache" RuntimePermission or else a security exception will be thrown.

Throws:
SecurityException - if the caller does not have permission to clear cache

getBaseResources

public static final Resources getBaseResources(String basename,
                                               ClassLoader classLoader)
Retrieve resource with specified basename.

Parameters:
basename - the basename
Returns:
the Resources

getResources

public static final Resources getResources(String resource,
                                           ClassLoader classLoader)
Retrieve resource for specified name. The baseName is determined by name postfixed with ".Resources".

Parameters:
resource - the base location
Returns:
the Resources

getPackageResources

public static final Resources getPackageResources(Class clazz)
Retrieve resource for specified Classes package. The baseName is determined by name of classes package postfixed with ".Resources".

Parameters:
clazz - the Class
Returns:
the Resources

getClassResources

public static final Resources getClassResources(Class clazz)
Retrieve resource for specified Class. The baseName is determined by name of Class postfixed with ".Resources".

Parameters:
clazz - the Class
Returns:
the Resources


Copyright © 1999-2006 Codehaus. All Rights Reserved.