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
Class UrlDefinitionsFactory

    java.lang.Object
      org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory
          org.apache.tiles.definition.UrlDefinitionsFactory

All Implemented Interfaces:
  TilesApplicationContextAware, DefinitionsFactory, Refreshable, RefreshMonitor

Deprecated. Use `UnresolvingLocaleDefinitionsFactory` and using `ResolvingLocaleUrlDefinitionDAO` as Tiles DAO.

    public class UrlDefinitionsFactory

extends UnresolvingLocaleDefinitionsFactory
implements Refreshable

`DefinitionsFactory` implementation that manages Definitions configuration data from URLs, resolving inheritance when the URL is loaded.

The Definition objects are read from the `DigesterDefinitionsReader` class unless another implementation is specified.

Version:
  $Rev: 934508 $ $Date: 2010-04-15 20:30:51 +0200 (gio, 15 apr 2010) $

Field Summary
`protected java.util.Map<java.lang.String,java.lang.Long>` | `lastModifiedDates` Deprecated. No more used.
`protected DefinitionsReader` | `reader` Deprecated. No more used.
`protected java.util.List<java.lang.Object>` | `sources` Deprecated. Use `URLReader.addSourceURL(URL)`.

Fields inherited from class org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory
`applicationContext, definitionDao, localeResolver`

Fields inherited from interface org.apache.tiles.definition.DefinitionsFactory
`DEFINITION_DAO_INIT_PARAM, DEFINITIONS_CONFIG, LOCALE_RESOLVER_IMPL_PROPERTY, READER_IMPL_PROPERTY`

Constructor Summary
`UrlDefinitionsFactory()` Deprecated.

Method Summary
`protected void` | `addDefinitions(Definitions definitions, TilesRequestContext tilesContext)` Deprecated. Let the definitions be loaded by a `DefinitionDAO`.
`void` | `addSource(java.lang.Object source)` Deprecated. Use `URLReader.addSourceURL(URL)`.
`protected static java.util.List<java.lang.String>` | `calculatePostfixes(java.util.Locale locale)` Deprecated. Use `LocaleUtil.calculatePostfixes(Locale)` instead.
`protected static java.lang.String` | `concatPostfix(java.lang.String name, java.lang.String postfix)` Deprecated. Use `LocaleUtil.concatPostfix(String,String)` instead
`protected ResolvingLocaleUrlDefinitionDAO` | `createDefaultDefinitionDAO()` Deprecated. Creates the default definition DAO, if it has not been specified outside.
`protected Definitions` | `createDefinitions()` Deprecated. Do not use! Deprecated with no replacement.
`protected Definitions` | `getDefinitions()` Deprecated. Do not use! Deprecated with no replacement.
`protected java.util.List<java.lang.String>` | `getResourceNames(java.lang.String resourceString)` Deprecated. Deprecated without replacement.
`protected java.lang.String` | `getResourceString(java.util.Map<java.lang.String,java.lang.String> parms)` Deprecated. Deprecated without replacement.
`void` | `init(java.util.Map<java.lang.String,java.lang.String> params)` Deprecated. Initializes the DefinitionsFactory and its subcomponents.
`protected boolean` | `isContextProcessed(TilesRequestContext tilesContext)` Deprecated. It always return `true`.
`Definitions` | `readDefinitions()` Deprecated. Let the Definitions Factory use it.
`void` | `refresh()` Deprecated. Refreshes the stored definitions, reloading them.
`boolean` | `refreshRequired()` Deprecated. Indicates whether the DefinitionsFactory is out of date and needs to be reloaded.

Methods inherited from class org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory
`getDefinition, setApplicationContext, setDefinitionDAO, setLocaleResolver`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### sources

    protected java.util.List<java.lang.Object> sources

  Deprecated. Use `URLReader.addSourceURL(URL)`.
  Contains the URL objects identifying where configuration data is found.

### reader

    protected DefinitionsReader reader

  Deprecated. No more used.
  Reader used to get definitions from the sources.

### lastModifiedDates

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

  Deprecated. No more used.
  Contains the dates that the URL sources were last modified.

Constructor Detail

### UrlDefinitionsFactory

    public UrlDefinitionsFactory()

  Deprecated.

Method Detail

### refresh

    public void refresh()

  Deprecated.
  Refreshes the stored definitions, reloading them.

  Specified by:
    `refresh` in interface `Refreshable`

### refreshRequired

    public boolean refreshRequired()

  Deprecated.
  Indicates whether the DefinitionsFactory is out of date and needs to be reloaded.

  Specified by:
    `refreshRequired` in interface `RefreshMonitor`
  Returns:
    If the factory needs refresh.

### isContextProcessed

    @Deprecated
    protected boolean isContextProcessed(TilesRequestContext tilesContext)

  Deprecated. It always return `true`.

  Indicates whether a given context has been processed or not.

  This method can be used to avoid unnecessary synchronization of the DefinitionsFactory in multi-threaded situations. Check the return of isContextProcessed before synchronizing the object and reading locale-specific definitions.

  Parameters:
    `tilesContext` - The Tiles context to check.
  Returns:
    true if the given context has been processed and false otherwise.

### addSource

    public void addSource(java.lang.Object source)

  Deprecated. Use `URLReader.addSourceURL(URL)`.

  Adds a source where Definition objects are stored.

  Implementations should publish what type of source object they expect. The source should contain enough information to resolve a configuration source containing definitions. The source should be a "base" source for configurations. Internationalization and Localization properties will be applied by implementations to discriminate the correct data sources based on locale.

  Specified by:
    `addSource` in interface `DefinitionsFactory`
  Overrides:
    `addSource` in class `UnresolvingLocaleDefinitionsFactory`
  Parameters:
    `source` - The configuration source for definitions.
  Throws:
    `DefinitionsFactoryException` - if an invalid source is passed in or an error occurs resolving the source to an actual data store.

### createDefaultDefinitionDAO

    protected ResolvingLocaleUrlDefinitionDAO createDefaultDefinitionDAO()

  Deprecated.
  Creates the default definition DAO, if it has not been specified outside.

  Returns:
    The default definition DAO.
  Since:
    2.1.0

### init

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

  Deprecated.
  Description copied from class: `UnresolvingLocaleDefinitionsFactory`
  Initializes the DefinitionsFactory and its subcomponents.

  Implementations may support configuration properties to be passed in via the params Map.

  Specified by:
    `init` in interface `DefinitionsFactory`
  Overrides:
    `init` in class `UnresolvingLocaleDefinitionsFactory`
  Parameters:
    `params` - The Map of configuration properties.

### readDefinitions

    @Deprecated
    public Definitions readDefinitions()

  Deprecated. Let the Definitions Factory use it.

  Creates and returns a `Definitions` set by reading configuration data from the applied sources.

  Specified by:
    `readDefinitions` in interface `DefinitionsFactory`
  Overrides:
    `readDefinitions` in class `UnresolvingLocaleDefinitionsFactory`
  Returns:
    The definitions holder object, filled with base definitions.
  Throws:
    `DefinitionsFactoryException` - if an error occurs reading the sources.

### getDefinitions

    @Deprecated
    protected Definitions getDefinitions()

  Deprecated. Do not use! Deprecated with no replacement.

  Returns the definitions holder object.

  Returns:
    The definitions holder.

### addDefinitions

    @Deprecated
    protected void addDefinitions(Definitions definitions,
                                             TilesRequestContext tilesContext)

  Deprecated. Let the definitions be loaded by a `DefinitionDAO`.

  Appends locale-specific `Definition` objects to an existing `Definitions` set by reading locale-specific versions of the applied sources.

  Parameters:
    `definitions` - The Definitions object to append to.
    `tilesContext` - The requested locale.
  Throws:
    `DefinitionsFactoryException` - if an error occurs reading definitions.

### createDefinitions

    @Deprecated
    protected Definitions createDefinitions()

  Deprecated. Do not use! Deprecated with no replacement.

  Creates a new instance of `Definitions`. Override this method to provide your custom instance of Definitions.

  Returns:
    A new instance of `Definitions`.

### concatPostfix

    protected static java.lang.String concatPostfix(java.lang.String name,
                                                    java.lang.String postfix)

  Deprecated. Use `LocaleUtil.concatPostfix(String,String)` instead

  Concat postfix to the name. Take care of existing filename extension. Transform the given name "name.ext" to have "name" + "postfix" + "ext". If there is no ext, return "name" + "postfix".

  Parameters:
    `name` - Filename.
    `postfix` - Postfix to add.
  Returns:
    Concatenated filename.

### calculatePostfixes

    protected static java.util.List<java.lang.String> calculatePostfixes(java.util.Locale locale)

  Deprecated. Use `LocaleUtil.calculatePostfixes(Locale)` instead.

  Calculate the postfixes along the search path from the base bundle to the bundle specified by baseName and locale. Method copied from java.util.ResourceBundle

  Parameters:
    `locale` - the locale
  Returns:
    a list of

### getResourceString

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

  Deprecated. Deprecated without replacement.

  Derive the resource string from the initialization parameters. If no parameter `DefinitionsFactory.DEFINITIONS_CONFIG` is available, attempts to retrieve `BasicTilesContainer.DEFINITIONS_CONFIG` 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

    @Deprecated
    protected java.util.List<java.lang.String> getResourceNames(java.lang.String resourceString)

  Deprecated. Deprecated without replacement.

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

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

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.