|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tiles.definition.UrlDefinitionsFactory
public class UrlDefinitionsFactory
DefinitionsFactory
implementation
that manages ComponentDefinitions configuration data from URLs.
The ComponentDefinition objects are read from the
DigesterDefinitionsReader
class unless another implementation is specified.
Field Summary | |
---|---|
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.lang.Object> |
sources
Contains the URL objects identifying where configuration data is found. |
Fields inherited from interface org.apache.tiles.definition.DefinitionsFactory |
---|
DEFINITIONS_IMPL_PROPERTY, READER_IMPL_PROPERTY |
Constructor Summary | |
---|---|
UrlDefinitionsFactory()
Creates a new instance of UrlDefinitionsFactory |
Method Summary | |
---|---|
protected void |
addDefinitions(ComponentDefinitions definitions,
TilesRequestContext tilesContext)
Appends locale-specific ComponentDefinition objects to an existing
ComponentDefinitions set by reading locale-specific versions of
the applied sources. |
void |
addSource(java.lang.Object source)
Adds a source where ComponentDefinition objects are stored. |
protected static java.util.List<java.lang.String> |
calculatePostfixes(java.util.Locale locale)
Calculate the postfixes along the search path from the base bundle to the bundle specified by baseName and locale. |
protected java.lang.String |
concatPostfix(java.lang.String name,
java.lang.String postfix)
Concat postfix to the name. |
ComponentDefinition |
getDefinition(java.lang.String name,
TilesRequestContext tilesContext)
Returns a ComponentDefinition object that matches the given name and Tiles context |
void |
init(java.util.Map<java.lang.String,java.lang.String> params)
Initializes the DefinitionsFactory and its subcomponents. |
protected boolean |
isContextProcessed(TilesRequestContext tilesContext)
Indicates whether a given context has been processed or not. |
ComponentDefinitions |
readDefinitions()
Creates and returns a ComponentDefinitions set by reading
configuration data from the applied sources. |
void |
refresh()
Refreshes the stored definitions, reloading them. |
boolean |
refreshRequired()
Indicates whether the DefinitionsFactory is out of date and needs to be reloaded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<java.lang.Object> sources
protected DefinitionsReader reader
protected java.util.Map<java.lang.String,java.lang.Long> lastModifiedDates
Constructor Detail |
---|
public UrlDefinitionsFactory()
Method Detail |
---|
public void init(java.util.Map<java.lang.String,java.lang.String> params) throws org.apache.tiles.TilesException
init
in interface DefinitionsFactory
params
- The Map of configuration properties.
DefinitionsFactoryException
- if an initialization error occurs.
org.apache.tiles.TilesException
public ComponentDefinition getDefinition(java.lang.String name, TilesRequestContext tilesContext) throws DefinitionsFactoryException
getDefinition
in interface DefinitionsFactory
name
- The name of the ComponentDefinition to return.tilesContext
- The Tiles context to use to resolve the definition.
DefinitionsFactoryException
- if an error occurs reading definitions.public void addSource(java.lang.Object source) throws DefinitionsFactoryException
addSource
in interface DefinitionsFactory
source
- The configuration source for definitions.
DefinitionsFactoryException
- if an invalid source is passed in or
an error occurs resolving the source to an actual data store.protected void addDefinitions(ComponentDefinitions definitions, TilesRequestContext tilesContext) throws DefinitionsFactoryException
ComponentDefinition
objects to an existing
ComponentDefinitions
set by reading locale-specific versions of
the applied sources.
definitions
- The ComponentDefinitions object to append to.tilesContext
- The requested locale.
DefinitionsFactoryException
- if an error occurs reading definitions.public ComponentDefinitions readDefinitions() throws DefinitionsFactoryException
ComponentDefinitions
set by reading
configuration data from the applied sources.
readDefinitions
in interface DefinitionsFactory
DefinitionsFactoryException
- if an error occurs reading the
sources.protected boolean isContextProcessed(TilesRequestContext tilesContext)
tilesContext
- The Tiles context to check.
protected java.lang.String concatPostfix(java.lang.String name, java.lang.String postfix)
name
- Filename.postfix
- Postfix to add.
protected static java.util.List<java.lang.String> calculatePostfixes(java.util.Locale locale)
locale
- the locale
public void refresh() throws DefinitionsFactoryException
ReloadableDefinitionsFactory
refresh
in interface ReloadableDefinitionsFactory
DefinitionsFactoryException
- If something goes wrong during
refresh.public boolean refreshRequired()
refreshRequired
in interface ReloadableDefinitionsFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |