org.apache.tiles.impl.mgmt
Class CachingKeyedDefinitionsFactoryTilesContainer
java.lang.Object
org.apache.tiles.impl.BasicTilesContainer
org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer
org.apache.tiles.impl.mgmt.CachingKeyedDefinitionsFactoryTilesContainer
- All Implemented Interfaces:
- org.apache.tiles.mgmt.MutableTilesContainer, org.apache.tiles.TilesContainer
public class CachingKeyedDefinitionsFactoryTilesContainer
- extends KeyedDefinitionsFactoryTilesContainer
- implements org.apache.tiles.mgmt.MutableTilesContainer
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.
Methods inherited from class org.apache.tiles.impl.BasicTilesContainer |
checkInit, endContext, endContext, getApplicationContext, getComponentContext, getComponentContext, getContextFactory, getPreparerFactory, getResourceNames, getResourceString, getResourceString, init, initializeDefinitionsFactory, isValidDefinition, isValidDefinition, prepare, prepare, render, render, render, setApplicationContext, setContextFactory, setPreparerFactory, startContext, 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, endContext, getApplicationContext, getComponentContext, getComponentContext, init, isValidDefinition, isValidDefinition, prepare, prepare, render, render, render, startContext, startContext |
CachingKeyedDefinitionsFactoryTilesContainer
public CachingKeyedDefinitionsFactoryTilesContainer()
register
public void register(org.apache.tiles.mgmt.TileDefinition definition)
throws org.apache.tiles.TilesException
- Specified by:
register
in interface org.apache.tiles.mgmt.MutableTilesContainer
- Throws:
org.apache.tiles.TilesException
getDefinition
protected ComponentDefinition getDefinition(java.lang.String definition,
TilesRequestContext context)
throws DefinitionsFactoryException
- Overrides:
getDefinition
in class KeyedDefinitionsFactoryTilesContainer
- Throws:
DefinitionsFactoryException
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory()
- Description copied from class:
BasicTilesContainer
- Standard Getter
- Overrides:
getDefinitionsFactory
in class BasicTilesContainer
- Returns:
- the definitions factory used by this container.
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory(java.lang.String key)
- Description copied from class:
KeyedDefinitionsFactoryTilesContainer
- Standard Getter
- Overrides:
getDefinitionsFactory
in class KeyedDefinitionsFactoryTilesContainer
- Parameters:
key
- The key of the needed definitions factory.
- Returns:
- the definitions factory used by this container. If the key is not
valid, the default factory will be returned.
setDefinitionsFactory
public void setDefinitionsFactory(DefinitionsFactory definitionsFactory)
- Description copied from class:
BasicTilesContainer
- Set the definitions factory. This method first ensures
that the container has not yet been initialized.
- Overrides:
setDefinitionsFactory
in class BasicTilesContainer
- Parameters:
definitionsFactory
- the definitions factory for this instance.
setDefinitionsFactory
public void setDefinitionsFactory(java.lang.String key,
DefinitionsFactory definitionsFactory,
java.util.Map<java.lang.String,java.lang.String> initParameters)
throws org.apache.tiles.TilesException
- Description copied from class:
KeyedDefinitionsFactoryTilesContainer
- Set the definitions factory. This method first ensures
that the container has not yet been initialized.
- Overrides:
setDefinitionsFactory
in class KeyedDefinitionsFactoryTilesContainer
definitionsFactory
- the definitions factory for this instance.
- Throws:
org.apache.tiles.TilesException
- If something goes wrong during initialization of
the definitions factory.
getOrCreateDefinitionManager
protected DefinitionManager getOrCreateDefinitionManager(java.lang.String key)
- Returns a definition manager if found, otherwise it will create a new
one.
- Parameters:
key
- The key of the definition manager.
- Returns:
- The needed definition manager.
getProperDefinitionManager
protected DefinitionManager getProperDefinitionManager(java.lang.String key)
- Returns a definition manager if found.
- Parameters:
key
- The key of the definition manager.
- Returns:
- The needed definition manager.