|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tiles.definition.UrlDefinitionsFactory
public class UrlDefinitionsFactory
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 Map<String,Long> |
lastModifiedDates
Contains the dates that the URL sources were last modified. |
protected DefinitionsReader |
reader
Reader used to get definitions from the sources. |
protected List<Object> |
sources
Contains the URL objects identifying where configuration data is found. |
Fields inherited from interface org.apache.tiles.definition.DefinitionsFactory |
---|
LOCALE_RESOLVER_IMPL_PROPERTY, READER_IMPL_PROPERTY |
Constructor Summary | |
---|---|
UrlDefinitionsFactory()
Creates a new instance of UrlDefinitionsFactory. |
Method Summary | |
---|---|
protected void |
addDefinitions(Definitions definitions,
TilesRequestContext tilesContext)
Appends locale-specific Definition objects to an existing
Definitions set by reading locale-specific versions of
the applied sources. |
void |
addSource(Object source)
Adds a source where Definition objects are stored. |
protected static List<String> |
calculatePostfixes(Locale locale)
Calculate the postfixes along the search path from the base bundle to the bundle specified by baseName and locale. |
protected String |
concatPostfix(String name,
String postfix)
Concat postfix to the name. |
protected Definitions |
createDefinitions()
Creates a new instance of Definitions . |
Definition |
getDefinition(String name,
TilesRequestContext tilesContext)
Returns a Definition object that matches the given name and Tiles context. |
protected Definitions |
getDefinitions()
Returns the definitions holder object. |
void |
init(Map<String,String> params)
Initializes the DefinitionsFactory and its subcomponents. |
protected boolean |
isContextProcessed(TilesRequestContext tilesContext)
Indicates whether a given context has been processed or not. |
Definitions |
readDefinitions()
Creates and returns a Definitions 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 List<Object> sources
protected DefinitionsReader reader
protected Map<String,Long> lastModifiedDates
Constructor Detail |
---|
public UrlDefinitionsFactory()
Method Detail |
---|
public void init(Map<String,String> params) throws TilesException
init
in interface DefinitionsFactory
params
- The Map of configuration properties.
TilesException
- if an initialization error occurs.protected Definitions getDefinitions() throws DefinitionsFactoryException
DefinitionsFactoryException
- If something goes wrong during
reading definitions.public Definition getDefinition(String name, TilesRequestContext tilesContext) throws DefinitionsFactoryException
getDefinition
in interface DefinitionsFactory
name
- The name of the Definition to return.tilesContext
- The Tiles context to use to resolve the definition.
DefinitionsFactoryException
- if an error occurs reading definitions.public void addSource(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(Definitions definitions, TilesRequestContext tilesContext) throws DefinitionsFactoryException
Definition
objects to an existing
Definitions
set by reading locale-specific versions of
the applied sources.
definitions
- The Definitions object to append to.tilesContext
- The requested locale.
DefinitionsFactoryException
- if an error occurs reading definitions.public Definitions readDefinitions() throws DefinitionsFactoryException
Definitions
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 Definitions createDefinitions()
Definitions
. Override this method
to provide your custom instance of Definitions.
Definitions
.protected String concatPostfix(String name, String postfix)
name
- Filename.postfix
- Postfix to add.
protected static List<String> calculatePostfixes(Locale locale)
locale
- the locale
public void refresh() throws DefinitionsFactoryException
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 |