|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO
org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO
public class CachingLocaleUrlDefinitionDAO
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 | |
|---|---|
static String |
CHECK_REFRESH_INIT_PARAMETER
Initialization parameter to set whether we want to refresh URLs when they change. |
protected boolean |
checkRefresh
Flag that, when true, enables automatic checking of URLs
changing. |
protected PatternDefinitionResolver<Locale> |
definitionResolver
Resolves definitions using patterns. |
protected Map<Locale,Map<String,Definition>> |
locale2definitionMap
The locale-specific set of definitions objects. |
| Fields inherited from class org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO |
|---|
applicationContext, lastModifiedDates, reader, sourceURLs |
| Constructor Summary | |
|---|---|
CachingLocaleUrlDefinitionDAO()
Constructor. |
|
| Method Summary | |
|---|---|
protected Map<String,Definition> |
checkAndloadDefinitions(Locale customizationKey)
Checks if URLs have changed. |
protected Map<String,Definition> |
copyDefinitionMap(Map<String,Definition> localeDefsMap)
Copies the definition map to be passed to a higher level of customization key. |
Definition |
getDefinition(String name,
Locale customizationKey)
Returns a definition, given its name and the customization key. |
protected Definition |
getDefinitionFromResolver(String name,
Locale customizationKey)
Returns a definition from the definition resolver. |
Map<String,Definition> |
getDefinitions(Locale customizationKey)
Returns all the definitions used of a customization key. |
void |
init(Map<String,String> params)
Initializes the object. |
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). |
protected void |
postDefinitionLoadOperations(Map<String,Definition> localeDefsMap,
Locale customizationKey)
Deprecated. Never used. |
void |
refresh()
Refreshes the stored definitions, reloading them. |
void |
setCheckRefresh(boolean checkRefresh)
Sets the flag to check URL refresh. |
void |
setPatternDefinitionResolver(PatternDefinitionResolver<Locale> definitionResolver)
Sets the pattern definition resolver to use. |
| Methods inherited from class org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO |
|---|
addSourceURL, getResourceNames, getResourceString, identifySources, loadDefinitionsFromURL, refreshRequired, setApplicationContext, setReader, setSourceURLs |
| 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.RefreshMonitor |
|---|
refreshRequired |
| Field Detail |
|---|
public static final String CHECK_REFRESH_INIT_PARAMETER
protected Map<Locale,Map<String,Definition>> locale2definitionMap
protected boolean checkRefresh
true, enables automatic checking of URLs
changing.
protected PatternDefinitionResolver<Locale> definitionResolver
| Constructor Detail |
|---|
public CachingLocaleUrlDefinitionDAO()
| Method Detail |
|---|
public void init(Map<String,String> params)
init in interface Initializableinit in class BaseLocaleUrlDefinitionDAOparams - The map of parameters.public void setPatternDefinitionResolver(PatternDefinitionResolver<Locale> definitionResolver)
setPatternDefinitionResolver in interface PatternDefinitionResolverAware<Locale>definitionResolver - The pattern definition resolver.
public Definition getDefinition(String name,
Locale customizationKey)
getDefinition in interface DefinitionDAO<Locale>name - The name of the definition.customizationKey - The customization key.
null.
The inheritance of the definition must not be resolved.public Map<String,Definition> getDefinitions(Locale customizationKey)
getDefinitions in interface DefinitionDAO<Locale>customizationKey - The customization key.
public void refresh()
refresh in interface Refreshablepublic void setCheckRefresh(boolean checkRefresh)
false.
checkRefresh - When true, enables automatic checking
of URLs changing.
protected Definition getDefinitionFromResolver(String name,
Locale customizationKey)
name - The name of the definition.customizationKey - The customization key to use.
protected Map<String,Definition> checkAndloadDefinitions(Locale customizationKey)
customizationKey - The locale to use when loading URLs.
protected Map<String,Definition> loadDefinitions(Locale customizationKey)
customizationKey - The locale to use when loading URLs.
protected Map<String,Definition> loadDefinitionsFromURLs(Locale customizationKey)
customizationKey - The locale to use when loading URLs.
protected Map<String,Definition> loadRawDefinitionsFromURLs(Locale customizationKey)
loadDefinitionsFromURLs(Locale).
customizationKey - The locale to use when loading URLs.
protected Map<String,Definition> loadParentDefinitions(Locale parentLocale)
parentLocale - The locale to use when loading URLs.
protected void postDefinitionLoadOperations(Map<String,Definition> localeDefsMap,
Locale customizationKey)
localeDefsMap - The loaded definitions.customizationKey - The locale to use when loading URLs.protected Map<String,Definition> copyDefinitionMap(Map<String,Definition> localeDefsMap)
localeDefsMap - The map of definition to be copied.
localeDefsMap itself.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||