Save This Page
Home » tiles-2.0.6-src » org.apache » tiles » definition » [javadoc | source]
org.apache.tiles.definition
public class: UrlDefinitionsFactory [javadoc | source]
java.lang.Object
   org.apache.tiles.definition.UrlDefinitionsFactory

All Implemented Interfaces:
    ReloadableDefinitionsFactory, DefinitionsFactory

DefinitionsFactory implementation that manages Definitions configuration data from URLs.

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

Field Summary
protected  List sources    Contains the URL objects identifying where configuration data is found. 
protected  DefinitionsReader reader    Reader used to get definitions from the sources. 
protected  Map lastModifiedDates    Contains the dates that the URL sources were last modified. 
Constructor:
 public UrlDefinitionsFactory() 
Method from org.apache.tiles.definition.UrlDefinitionsFactory Summary:
addDefinitions,   addSource,   calculatePostfixes,   concatPostfix,   createDefinitions,   getDefinition,   getDefinitions,   init,   isContextProcessed,   readDefinitions,   refresh,   refreshRequired
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tiles.definition.UrlDefinitionsFactory Detail:
 protected  void addDefinitions(Definitions definitions,
    TilesRequestContext tilesContext) throws DefinitionsFactoryException 
    Appends locale-specific Definition objects to an existing Definitions set by reading locale-specific versions of the applied sources.
 public  void addSource(Object source) throws DefinitionsFactoryException 
    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.

 protected static List calculatePostfixes(Locale locale) 
    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
 protected String concatPostfix(String name,
    String postfix) 
    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".
 protected Definitions createDefinitions() 
    Creates a new instance of Definitions. Override this method to provide your custom instance of Definitions.
 public Definition getDefinition(String name,
    TilesRequestContext tilesContext) throws DefinitionsFactoryException 
    Returns a Definition object that matches the given name and Tiles context.
 protected Definitions getDefinitions() throws DefinitionsFactoryException 
    Returns the definitions holder object.
 public  void init(Map params) throws TilesException 
    Initializes the DefinitionsFactory and its subcomponents.

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

 protected boolean isContextProcessed(TilesRequestContext tilesContext) 
    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.

 public Definitions readDefinitions() throws DefinitionsFactoryException 
    Creates and returns a Definitions set by reading configuration data from the applied sources.
 public  void refresh() throws DefinitionsFactoryException 
    {@inheritDoc}
 public boolean refreshRequired() 
    Indicates whether the DefinitionsFactory is out of date and needs to be reloaded.