Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tiles.definition.dao
Class BaseLocaleUrlDefinitionDAO

    java.lang.Object
      org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO

All Implemented Interfaces:
  TilesApplicationContextAware, DefinitionDAO<java.util.Locale>, URLReader, RefreshMonitor, Initializable

Direct Known Subclasses:
  CachingLocaleUrlDefinitionDAO, LocaleUrlDefinitionDAO

    public abstract class BaseLocaleUrlDefinitionDAO

extends java.lang.Object
implements DefinitionDAO<java.util.Locale>, Initializable, TilesApplicationContextAware, RefreshMonitor, URLReader

Base abstract class for a DAO that is based on URLs and locale as a customization key.

Since:
  2.1.0
Version:
  $Rev: 797540 $ $Date: 2009-07-24 17:42:00 +0200 (ven, 24 lug 2009) $

Field Summary
`protected TilesApplicationContext` | `applicationContext` The application context.
`protected java.util.Map<java.lang.String,java.lang.Long>` | `lastModifiedDates` Contains the dates that the URL sources were last modified.
`protected DefinitionsReader` | `reader` Reader used to get definitions from the sources.
`protected java.util.List<java.net.URL>` | `sourceURLs` Contains the URL objects identifying where configuration data is found.

Constructor Summary
`BaseLocaleUrlDefinitionDAO()` Constructor.

Method Summary
`void` | `addSourceURL(java.net.URL sourceURL)` Adds a single URL to use.
`protected java.lang.String[]` | `getResourceNames(java.lang.String resourceString)` Parse the resourceString into a list of resource paths which can be loaded by the application context.
`protected java.lang.String` | `getResourceString(java.util.Map<java.lang.String,java.lang.String> parms)` Derive the resource string from the initialization parameters.
`protected void` | `identifySources(java.util.Map<java.lang.String,java.lang.String> initParameters)` Detects the sources to load.
`void` | `init(java.util.Map<java.lang.String,java.lang.String> params)` Initializes the object.
`protected java.util.Map<java.lang.String,Definition>` | `loadDefinitionsFromURL(java.net.URL url)` 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` | `setApplicationContext(TilesApplicationContext applicationContext)` Sets the Tiles application context.
`void` | `setReader(DefinitionsReader reader)` Sets the definitions reader that will read the URLs.
`void` | `setSourceURLs(java.util.List<java.net.URL> sourceURLs)` Sets the source URLs to use.

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

### sourceURLs

    protected java.util.List<java.net.URL> sourceURLs

  Contains the URL objects identifying where configuration data is found.

  Since:
    2.1.0

### lastModifiedDates

    protected java.util.Map<java.lang.String,java.lang.Long> lastModifiedDates

  Contains the dates that the URL sources were last modified.

  Since:
    2.1.0

### applicationContext

    protected TilesApplicationContext applicationContext

  The application context.

  Since:
    2.1.0

### reader

    protected DefinitionsReader reader

  Reader used to get definitions from the sources.

  Since:
    2.1.0

Constructor Detail

### BaseLocaleUrlDefinitionDAO

    public BaseLocaleUrlDefinitionDAO()

  Constructor.

Method Detail

### setSourceURLs

    public void setSourceURLs(java.util.List<java.net.URL> sourceURLs)

  Sets the source URLs to use.

  Specified by:
    `setSourceURLs` in interface `URLReader`
  Parameters:
    `sourceURLs` - The source URLs.

### setReader

    public void setReader(DefinitionsReader reader)

  Sets the definitions reader that will read the URLs.

  Specified by:
    `setReader` in interface `URLReader`
  Parameters:
    `reader` - The definitions reader.

### addSourceURL

    public void addSourceURL(java.net.URL sourceURL)

  Adds a single URL to use.

  Specified by:
    `addSourceURL` in interface `URLReader`
  Parameters:
    `sourceURL` - The source URL to add.

### setApplicationContext

    public void setApplicationContext(TilesApplicationContext applicationContext)

  Sets the Tiles application context.

  Specified by:
    `setApplicationContext` in interface `TilesApplicationContextAware`
  Parameters:
    `applicationContext` - The Tiles application context.

### init

    public void init(java.util.Map<java.lang.String,java.lang.String> params)

  Initializes the object.

  Specified by:
    `init` in interface `Initializable`
  Parameters:
    `params` - The map of parameters.

### 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.

### identifySources

    protected void identifySources(java.util.Map<java.lang.String,java.lang.String> initParameters)

  Detects the sources to load.

  Parameters:
    `initParameters` - The initialization parameters.
  Since:
    2.1.0

### getResourceString

    protected java.lang.String getResourceString(java.util.Map<java.lang.String,java.lang.String> parms)

  Derive the resource string from the initialization parameters. If no parameter `DefinitionsFactory.DEFINITIONS_CONFIG` is available, attempts to retrieve the deprecated `org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG` parameter and `LEGACY_DEFINITIONS_CONFIG`. If neither are available, returns "/WEB-INF/tiles.xml".

  Parameters:
    `parms` - The initialization parameters.
  Returns:
    resource string to be parsed.

### getResourceNames

    protected java.lang.String[] getResourceNames(java.lang.String resourceString)

  Parse the resourceString into a list of resource paths which can be loaded by the application context.

  Parameters:
    `resourceString` - comma separated resources
  Returns:
    parsed resources

### loadDefinitionsFromURL

    protected java.util.Map<java.lang.String,Definition> loadDefinitionsFromURL(java.net.URL url)

  Loads definitions from an URL without loading from "parent" URLs.

  Parameters:
    `url` - The URL to read.
  Returns:
    The definition map that has been read.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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