Class BaseLocaleUrlDefinitionDAO

java.lang.Object
org.apache.tiles.core.definition.dao.BaseLocaleUrlDefinitionDAO
All Implemented Interfaces:
DefinitionDAO<Locale>, RefreshMonitor
Direct Known Subclasses:
CachingLocaleUrlDefinitionDAO

public abstract class BaseLocaleUrlDefinitionDAO extends Object implements DefinitionDAO<Locale>, RefreshMonitor
Base abstract class for a DAO that is based on URLs and locale as a customization key.
Since:
2.1.0
  • Field Details

    • sources

      protected List<ApplicationResource> sources
      Contains the URL objects identifying where configuration data is found.
      Since:
      2.1.0
    • lastModifiedDates

      protected Map<String,Long> lastModifiedDates
      Contains the dates that the URL sources were last modified.
      Since:
      2.1.0
    • reader

      protected DefinitionsReader reader
      Reader used to get definitions from the sources.
      Since:
      2.1.0
    • applicationContext

      protected ApplicationContext applicationContext
      ApplicationContext to locate the source files.
      Since:
      3.0.0
  • Constructor Details

    • BaseLocaleUrlDefinitionDAO

      public BaseLocaleUrlDefinitionDAO(ApplicationContext applicationContext)
      Constructor.
  • Method Details

    • setSources

      public void setSources(List<ApplicationResource> sources)
    • setReader

      public void setReader(DefinitionsReader reader)
    • refreshRequired

      public boolean refreshRequired()
      Indicates whether the sources are out of date and need to be reloaded.
      Specified by:
      refreshRequired in interface RefreshMonitor
      Returns:
      true if the sources need to be refreshed.
    • loadDefinitionsFromResource

      protected Map<String,Definition> loadDefinitionsFromResource(ApplicationResource resource)
      Loads definitions from an URL without loading from "parent" URLs.
      Parameters:
      resource - The URL to read.
      Returns:
      The definition map that has been read.