org.viewaframework.util
Class LastModifiedControl

java.lang.Object
  extended by java.util.ResourceBundle.Control
      extended by org.viewaframework.util.LastModifiedControl
All Implemented Interfaces:
ChildResourceBundleAware

public class LastModifiedControl
extends ResourceBundle.Control
implements ChildResourceBundleAware

This class tells the resource bundle loader how to handle it. Whether if it has to be loaded in the cache or not. By default a resource bundle with this control is checked every time is called. If the resource has changed then it will be loaded again, if it has not then it will be loaded from the cache.

Author:
Mario Garcia

Field Summary
 
Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
 
Constructor Summary
LastModifiedControl()
           
 
Method Summary
 ResourceBundle getParent()
           
 long getPreviousModification()
           
 long getTimeToLive()
           
 long getTimeToLive(String baseName, Locale locale)
           
 boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime)
           
 ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
           
 void setParent(ResourceBundle parent)
           
 void setPreviousModification(long previousModification)
           
 void setTimeToLive(long timeToLive)
           
 
Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getFallbackLocale, getFormats, getNoFallbackControl, toBundleName, toResourceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastModifiedControl

public LastModifiedControl()
Method Detail

getParent

public ResourceBundle getParent()
Specified by:
getParent in interface ChildResourceBundleAware
Returns:

getPreviousModification

public long getPreviousModification()
Returns:

getTimeToLive

public long getTimeToLive()
Returns:

getTimeToLive

public long getTimeToLive(String baseName,
                          Locale locale)
Overrides:
getTimeToLive in class ResourceBundle.Control

needsReload

public boolean needsReload(String baseName,
                           Locale locale,
                           String format,
                           ClassLoader loader,
                           ResourceBundle bundle,
                           long loadTime)
Overrides:
needsReload in class ResourceBundle.Control

newBundle

public ResourceBundle newBundle(String baseName,
                                Locale locale,
                                String format,
                                ClassLoader loader,
                                boolean reload)
                         throws IllegalAccessException,
                                InstantiationException,
                                IOException
Overrides:
newBundle in class ResourceBundle.Control
Throws:
IllegalAccessException
InstantiationException
IOException

setParent

public void setParent(ResourceBundle parent)
Specified by:
setParent in interface ChildResourceBundleAware

setPreviousModification

public void setPreviousModification(long previousModification)
Parameters:
previousModification -

setTimeToLive

public void setTimeToLive(long timeToLive)
Parameters:
timeToLive -


Copyright © 2010. All Rights Reserved.