org.apache.tiles.definition.dao
Class BaseLocaleUrlDefinitionDAO

Package class diagram package BaseLocaleUrlDefinitionDAO
java.lang.Object
  extended by org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO
All Implemented Interfaces:
DefinitionDAO<Locale>, RefreshMonitor
Direct Known Subclasses:
CachingLocaleUrlDefinitionDAO, LocaleUrlDefinitionDAO

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
Version:
$Rev: 1297705 $ $Date: 2012-03-06 15:44:30 -0500 (Tue, 06 Mar 2012) $

Field Summary
protected  org.apache.tiles.request.ApplicationContext applicationContext
          ApplicationContext to locate the source files.
protected  Map<String,Long> lastModifiedDates
          Contains the dates that the URL sources were last modified.
protected  DefinitionsReader reader
          Reader used to get definitions from the sources.
protected  List<org.apache.tiles.request.ApplicationResource> sources
          Contains the URL objects identifying where configuration data is found.
 
Constructor Summary
BaseLocaleUrlDefinitionDAO(org.apache.tiles.request.ApplicationContext applicationContext)
          Constructor.
 
Method Summary
protected  Map<String,Definition> loadDefinitionsFromResource(org.apache.tiles.request.ApplicationResource resource)
          Loads definitions from an URL without loading from "parent" URLs.
 boolean refreshRequired()
          Indicates whether the sources are out of date and need to be reloaded.
 void setReader(DefinitionsReader reader)
           
 void setSources(List<org.apache.tiles.request.ApplicationResource> sources)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tiles.definition.dao.DefinitionDAO
getDefinition, getDefinitions
 

Field Detail

sources

protected List<org.apache.tiles.request.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 org.apache.tiles.request.ApplicationContext applicationContext
ApplicationContext to locate the source files.

Since:
3.0.0
Constructor Detail

BaseLocaleUrlDefinitionDAO

public BaseLocaleUrlDefinitionDAO(org.apache.tiles.request.ApplicationContext applicationContext)
Constructor.

Method Detail

setSources

public void setSources(List<org.apache.tiles.request.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(org.apache.tiles.request.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.


Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.