|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tiles.impl.BasicTilesContainer org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer org.apache.tiles.impl.mgmt.CachingKeyedDefinitionsFactoryTilesContainer
public class CachingKeyedDefinitionsFactoryTilesContainer
Container that can be used to store multiple DefinitionsFactory
instances mapped to different keys, with the addition of being "mutable",
i.e. caches (in memory) the definitions registered to it. If a definition
is not found in cache, it will revert back to it's definitions factory.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer |
---|
KeyedDefinitionsFactoryTilesContainer.DefaultKeyExtractor, KeyedDefinitionsFactoryTilesContainer.KeyExtractor |
Field Summary |
---|
Fields inherited from class org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer |
---|
DEFINITIONS_CONFIG_PREFIX, key2definitionsFactory, keyExtractor |
Fields inherited from class org.apache.tiles.impl.BasicTilesContainer |
---|
DEFINITIONS_CONFIG |
Constructor Summary | |
---|---|
CachingKeyedDefinitionsFactoryTilesContainer()
|
Method Summary | |
---|---|
protected Definition |
getDefinition(String definition,
TilesRequestContext context)
Returns a definition specifying its name. |
DefinitionsFactory |
getDefinitionsFactory()
Returns the definitions factory. |
DefinitionsFactory |
getDefinitionsFactory(String key)
Returns a definition factory given its key. |
protected DefinitionManager |
getOrCreateDefinitionManager(String key)
Returns a definition manager if found, otherwise it will create a new one. |
protected DefinitionManager |
getProperDefinitionManager(String key)
Returns a definition manager if found. |
void |
register(Definition definition,
Object... requestItems)
Register a new definition with the container. |
protected void |
register(Definition definition,
TilesRequestContext request)
Registers a custom definition. |
void |
setDefinitionsFactory(DefinitionsFactory definitionsFactory)
Set the definitions factory. |
void |
setDefinitionsFactory(String key,
DefinitionsFactory definitionsFactory,
Map<String,String> initParameters)
Set the definitions factory. |
Methods inherited from class org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer |
---|
getDefinitionsFactoryKey, getProperDefinitionsFactory, setKeyExtractor |
Methods inherited from class org.apache.tiles.impl.BasicTilesContainer |
---|
checkInit, endContext, getApplicationContext, getAttributeContext, getContext, getContextFactory, getContextStack, getPreparerFactory, getResourceNames, getResourceString, getResourceString, init, initializeDefinitionsFactory, isValidDefinition, popContext, prepare, pushContext, render, render, setApplicationContext, setContextFactory, setPreparerFactory, startContext |
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.TilesContainer |
---|
endContext, getApplicationContext, getAttributeContext, init, isValidDefinition, prepare, render, render, startContext |
Constructor Detail |
---|
public CachingKeyedDefinitionsFactoryTilesContainer()
Method Detail |
---|
public void register(Definition definition, Object... requestItems) throws TilesException
register
in interface MutableTilesContainer
definition
- The definition to register.requestItems
- the current request objects.
TilesException
- If something goes wrong during registration.protected Definition getDefinition(String definition, TilesRequestContext context) throws DefinitionsFactoryException
getDefinition
in class KeyedDefinitionsFactoryTilesContainer
definition
- The name of the definition to find.context
- The request context.
DefinitionsFactoryException
- If the definitions factory throws an
exception.public DefinitionsFactory getDefinitionsFactory()
getDefinitionsFactory
in class BasicTilesContainer
public DefinitionsFactory getDefinitionsFactory(String key)
getDefinitionsFactory
in class KeyedDefinitionsFactoryTilesContainer
key
- The key of the needed definitions factory.
public void setDefinitionsFactory(DefinitionsFactory definitionsFactory)
setDefinitionsFactory
in class BasicTilesContainer
definitionsFactory
- the definitions factory for this instance.public void setDefinitionsFactory(String key, DefinitionsFactory definitionsFactory, Map<String,String> initParameters) throws TilesException
setDefinitionsFactory
in class KeyedDefinitionsFactoryTilesContainer
key
- The key under which the definitions factory is catalogued.definitionsFactory
- the definitions factory for this instance.initParameters
- The init parameters to configure the definitions
factory.
TilesException
- If something goes wrong during initialization of
the definitions factory.protected void register(Definition definition, TilesRequestContext request) throws DefinitionsFactoryException
definition
- The definition to register.request
- The request inside which the definition should be
registered.
DefinitionsFactoryException
- If something goes wrong during adding
a definition, such as missing parent definitions.protected DefinitionManager getOrCreateDefinitionManager(String key)
key
- The key of the definition manager.
protected DefinitionManager getProperDefinitionManager(String key)
key
- The key of the definition manager.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |