Home » tiles-2.2.1-src » org.apache.tiles.definition.dao » [javadoc | source]
org.apache.tiles.definition.dao
public class: CachingLocaleUrlDefinitionDAO [javadoc | source]
java.lang.Object
   org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO
      org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO

All Implemented Interfaces:
    Refreshable, PatternDefinitionResolverAware, URLReader, RefreshMonitor, TilesApplicationContextAware, DefinitionDAO, Initializable

Direct Known Subclasses:
    ResolvingLocaleUrlDefinitionDAO

A definitions DAO (loading URLs and using Locale as a customization key) that caches definitions that have been loaded in a raw way (i.e. with inheritance that is not resolved).

It can check if the URLs change, but by default this feature is turned off.

Field Summary
public static final  String CHECK_REFRESH_INIT_PARAMETER    Initialization parameter to set whether we want to refresh URLs when they change.
    since: 2.1.0 -
 
protected  Map<String, Definition> locale2definitionMap    The locale-specific set of definitions objects.
    since: 2.1.0 -
 
protected  boolean checkRefresh    Flag that, when true, enables automatic checking of URLs changing.
    since: 2.1.0 -
 
protected  PatternDefinitionResolver<Locale> definitionResolver    Resolves definitions using patterns.
    since: 2.2.0 -
 
Fields inherited from org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO:
sourceURLs,  lastModifiedDates,  applicationContext,  reader
Constructor:
 public CachingLocaleUrlDefinitionDAO() 
Method from org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO Summary:
checkAndloadDefinitions,   copyDefinitionMap,   getDefinition,   getDefinitionFromResolver,   getDefinitions,   init,   loadDefinitions,   loadDefinitionsFromURLs,   loadParentDefinitions,   loadRawDefinitionsFromURLs,   postDefinitionLoadOperations,   refresh,   setCheckRefresh,   setPatternDefinitionResolver
Methods from org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO:
addSourceURL,   getResourceNames,   getResourceString,   identifySources,   init,   loadDefinitionsFromURL,   refreshRequired,   setApplicationContext,   setReader,   setSourceURLs
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO Detail:
 protected synchronized Map<String, Definition> checkAndloadDefinitions(Locale customizationKey) 
    Checks if URLs have changed. If yes, it clears the cache. Then continues loading definitions.
 protected Map<String, Definition> copyDefinitionMap(Map<String, Definition> localeDefsMap) 
    Copies the definition map to be passed to a higher level of customization key.
 public Definition getDefinition(String name,
    Locale customizationKey) 
    {@inheritDoc}
 protected Definition getDefinitionFromResolver(String name,
    Locale customizationKey) 
    Returns a definition from the definition resolver.
 public Map<String, Definition> getDefinitions(Locale customizationKey) 
    {@inheritDoc}
 public  void init(Map<String, String> params) 
    {@inheritDoc}
 protected Map<String, Definition> loadDefinitions(Locale customizationKey) 
    Tries to load definitions if necessary.
 protected Map<String, Definition> loadDefinitionsFromURLs(Locale customizationKey) 
    Loads definitions from the URLs.
 protected Map<String, Definition> loadParentDefinitions(Locale parentLocale) 
    Loads parent definitions, i.e. definitions mapped to a parent locale.
 protected Map<String, Definition> loadRawDefinitionsFromURLs(Locale customizationKey) 
Deprecated! Use - #loadDefinitionsFromURLs(Locale) .

    Loads the raw definitions from the URLs associated with a locale.
 protected  void postDefinitionLoadOperations(Map<String, Definition> localeDefsMap,
    Locale customizationKey) 
Deprecated! Never - used.

    Operations to be done after definitions are loaded.
 public synchronized  void refresh() 
    {@inheritDoc}
 public  void setCheckRefresh(boolean checkRefresh) 
    Sets the flag to check URL refresh. If not called, the default is false.
 public  void setPatternDefinitionResolver(PatternDefinitionResolver<Locale> definitionResolver) 
    {@inheritDoc}