| org.jaffa.util.PropertyMessageResources
PropertyMessageResources | public class PropertyMessageResources extends org.apache.struts.util.PropertyMessageResources (Code) | | Concrete subclass of MessageResources that reads message keys
and corresponding strings from named property resources in the same manner
that java.util.PropertyResourceBundle does. The
base property defines the base property resource name, and
must be specified.
IMPLEMENTATION NOTE - This class trades memory for
speed by caching all messages located via generalizing the Locale under
the original locale as well.
This results in specific messages being stored in the message cache
more than once, but improves response time on subsequent requests for
the same locale + key combination.
This class is based on the struts class org.apache.struts.util.PropertyMessageResources
It loads the properties file using File I/O. This allows us to view the changes to the file, without having to reload the webapp.
It supports the flushing of the message-resource cache.
author: GautamJ |
Constructor Summary | |
public | PropertyMessageResources(MessageResourcesFactory factory, String config) Construct a new PropertyMessageResources according to the
specified parameters. | public | PropertyMessageResources(MessageResourcesFactory factory, String config, boolean returnNull) Construct a new PropertyMessageResources according to the
specified parameters. |
Method Summary | |
public synchronized void | flushCache() This method flushes the cache that holds all the messages read from the resource. | protected synchronized void | loadLocale(String localeKey) This method is a copy of the implementation in the base class
The only difference is that it tries to first load the properties file using File I/O; if that doesn't work, then it uses the ClassLoader to load the file.
Load the messages associated with the specified Locale key. |
PropertyMessageResources | public PropertyMessageResources(MessageResourcesFactory factory, String config)(Code) | | Construct a new PropertyMessageResources according to the
specified parameters.
Parameters: factory - The MessageResourcesFactory that created us Parameters: config - The configuration parameter for this MessageResources |
PropertyMessageResources | public PropertyMessageResources(MessageResourcesFactory factory, String config, boolean returnNull)(Code) | | Construct a new PropertyMessageResources according to the
specified parameters.
Parameters: factory - The MessageResourcesFactory that created us Parameters: config - The configuration parameter for this MessageResources Parameters: returnNull - The returnNull property we should initialize with |
flushCache | public synchronized void flushCache()(Code) | | This method flushes the cache that holds all the messages read from the resource.
|
loadLocale | protected synchronized void loadLocale(String localeKey)(Code) | | This method is a copy of the implementation in the base class
The only difference is that it tries to first load the properties file using File I/O; if that doesn't work, then it uses the ClassLoader to load the file.
Load the messages associated with the specified Locale key. For this
implementation, the config property should contain a fully
qualified package and resource name, separated by periods, of a series
of property resources to be loaded from the class loader that created
this PropertyMessageResources instance. This is exactly the same name
format you would use when utilizing the
java.util.PropertyResourceBundle class.
Parameters: localeKey - Locale key for the messages to be retrieved |
|
|