This project has retired. For details please refer to its Attic page.
TilesContainerFactory (Tiles 2 2.1.4 API)

org.apache.tiles.factory
Class TilesContainerFactory

Package class diagram package TilesContainerFactory
java.lang.Object
  extended by org.apache.tiles.factory.AbstractTilesContainerFactory
      extended by org.apache.tiles.factory.TilesContainerFactory
Direct Known Subclasses:
KeyedDefinitionsFactoryTilesContainerFactory

public class TilesContainerFactory
extends AbstractTilesContainerFactory

Factory provided for convenience. This factory creates a default implementation of the container, initializes, and puts it into service.

Since:
2.0
Version:
$Rev: 798946 $ $Date: 2009-07-29 17:30:02 +0200 (mer, 29 lug 2009) $

Field Summary
static String ATTRIBUTE_EVALUATOR_INIT_PARAM
          Initialization parameter that represents the attribute evaluator class name.
static String CONTAINER_FACTORY_INIT_PARAM
          Deprecated. Use AbstractTilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM.
static String CONTAINER_FACTORY_MUTABLE_INIT_PARAM
          Initialization parameter that indicates if the container factory is mutable.
static String CONTEXT_FACTORY_INIT_PARAM
          Deprecated. Use AbstractTilesApplicationContextFactory.APPLICATION_CONTEXT_FACTORY_INIT_PARAM or REQUEST_CONTEXT_FACTORY_INIT_PARAM.
protected  Map<String,String> defaultConfiguration
          The default configuration to be used by the factory.
static String DEFINITIONS_FACTORY_INIT_PARAM
          Initialization parameter that represents the definitions factory class name.
static String PREPARER_FACTORY_INIT_PARAM
          Initialization parameter that represents the preparer factory class name.
static String RENDERER_FACTORY_INIT_PARAM
          Initialization parameter that represents the renderer factory class name.
static String REQUEST_CONTEXT_FACTORY_INIT_PARAM
          Initialization parameter that represents the context factory class name.
 
Constructor Summary
TilesContainerFactory()
           
 
Method Summary
 TilesContainer createContainer(Object context)
          Deprecated. Use createContainer(TilesApplicationContext).
 TilesContainer createContainer(TilesApplicationContext context)
          Creates a Tiles container.
protected static Object createFactory(Map<String,String> configuration, String initParameterName)
          Creates a factory instance.
 TilesContainer createMutableTilesContainer(Object context)
          Deprecated. Use createMutableTilesContainer(TilesApplicationContext).
 MutableTilesContainer createMutableTilesContainer(TilesApplicationContext context)
          Creates a mutable Tiles container.
 TilesContainer createTilesContainer(Object context)
          Deprecated. Use createTilesContainer(TilesApplicationContext).
 TilesContainer createTilesContainer(TilesApplicationContext context)
          Creates an immutable Tiles container.
static TilesContainerFactory getFactory(Object context)
          Deprecated. Use AbstractTilesContainerFactory#getTilesContainerFactory(Object).
static TilesContainerFactory getFactory(Object context, Map<String,String> defaults)
          Deprecated. Use AbstractTilesContainerFactory#getTilesContainerFactory(Object) and then setDefaultConfiguration(Map).
protected static String getInitParameter(Object context, String parameterName)
          Deprecated. Do not use.
protected static Map<String,String> getInitParameterMap(Object context)
          Deprecated. Do not use.
protected  void initializeContainer(Object context, BasicTilesContainer container)
          Deprecated. Use initializeContainer(TilesApplicationContext, BasicTilesContainer).
protected  void initializeContainer(TilesApplicationContext context, BasicTilesContainer container)
          Initializes a container.
protected  void postCreationOperations(TilesRequestContextFactory contextFactory, TilesApplicationContext tilesContext, RendererFactory rendererFactory, AttributeEvaluator evaluator, Map<String,String> initParameters, Map<String,String> configuration, BasicTilesContainer container)
          After the creation of the elements, it is possible to do other operations that will be done after the creation and before the assignment to the container.
protected static String resolveFactoryName(Map<String,String> configuration, String parameterName)
          Resolves a factory class name.
 void setDefaultConfiguration(Map<String,String> defaultConfiguration)
          Sets the default configuration parameters.
 void setDefaultValue(String key, String value)
          Sets one default configuration parameter value.
protected  void storeContainerDependencies(Object context, Map<String,String> initParameters, Map<String,String> configuration, BasicTilesContainer container)
          Deprecated. Use storeContainerDependencies(TilesApplicationContext, Map, Map, BasicTilesContainer) .
protected  void storeContainerDependencies(TilesApplicationContext context, Map<String,String> initParameters, Map<String,String> configuration, BasicTilesContainer container)
          Stores container dependencies, that is called before TilesContainer.init(Map).
 
Methods inherited from class org.apache.tiles.factory.AbstractTilesContainerFactory
getTilesContainerFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_FACTORY_INIT_PARAM

public static final String CONTAINER_FACTORY_INIT_PARAM
Deprecated. Use AbstractTilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM.
Initialization parameter that represents the container factory class name.

See Also:
Constant Field Values

CONTAINER_FACTORY_MUTABLE_INIT_PARAM

public static final String CONTAINER_FACTORY_MUTABLE_INIT_PARAM
Initialization parameter that indicates if the container factory is mutable.

See Also:
Constant Field Values

CONTEXT_FACTORY_INIT_PARAM

public static final String CONTEXT_FACTORY_INIT_PARAM
Deprecated. Use AbstractTilesApplicationContextFactory.APPLICATION_CONTEXT_FACTORY_INIT_PARAM or REQUEST_CONTEXT_FACTORY_INIT_PARAM.
Initialization parameter that represents the context factory class name.

See Also:
Constant Field Values

REQUEST_CONTEXT_FACTORY_INIT_PARAM

public static final String REQUEST_CONTEXT_FACTORY_INIT_PARAM
Initialization parameter that represents the context factory class name.

Since:
2.1.1
See Also:
Constant Field Values

DEFINITIONS_FACTORY_INIT_PARAM

public static final String DEFINITIONS_FACTORY_INIT_PARAM
Initialization parameter that represents the definitions factory class name.

See Also:
Constant Field Values

PREPARER_FACTORY_INIT_PARAM

public static final String PREPARER_FACTORY_INIT_PARAM
Initialization parameter that represents the preparer factory class name.

See Also:
Constant Field Values

RENDERER_FACTORY_INIT_PARAM

public static final String RENDERER_FACTORY_INIT_PARAM
Initialization parameter that represents the renderer factory class name.

Since:
2.1.0
See Also:
Constant Field Values

ATTRIBUTE_EVALUATOR_INIT_PARAM

public static final String ATTRIBUTE_EVALUATOR_INIT_PARAM
Initialization parameter that represents the attribute evaluator class name.

Since:
2.1.0
See Also:
Constant Field Values

defaultConfiguration

protected Map<String,String> defaultConfiguration
The default configuration to be used by the factory.

Constructor Detail

TilesContainerFactory

public TilesContainerFactory()
Method Detail

getFactory

@Deprecated
public static TilesContainerFactory getFactory(Object context)
Deprecated. Use AbstractTilesContainerFactory#getTilesContainerFactory(Object).

Retrieve a factory instance as configured through the specified context.

The context will be queried and if a init parameter named 'org.apache.tiles.factory.TilesContainerFactory' is discovered this class will be instantiated and returned. Otherwise, the factory will attempt to utilize one of it's internal factories.

Parameters:
context - the executing applications context. Typically a ServletContext or PortletContext
Returns:
a tiles container
Throws:
TilesContainerFactoryException - if an error occurs creating the factory.
Since:
2.1.0

getFactory

public static TilesContainerFactory getFactory(Object context,
                                               Map<String,String> defaults)
Deprecated. Use AbstractTilesContainerFactory#getTilesContainerFactory(Object) and then setDefaultConfiguration(Map).

Retrieve a factory instance as configured through the specified context.

The context will be queried and if a init parameter named 'org.apache.tiles.factory.TilesContainerFactory' is discovered this class will be instantiated and returned. Otherwise, the factory will attempt to utilize one of it's internal factories.

Parameters:
context - the executing applications context. Typically a ServletContext or PortletContext
defaults - Default configuration parameters values, used if the context object has not the corresponding parameters.
Returns:
a tiles container
Throws:
TilesContainerFactoryException - if an error occurs creating the factory.

createContainer

@Deprecated
public TilesContainer createContainer(Object context)
Deprecated. Use createContainer(TilesApplicationContext).

Creates a Tiles container.

Parameters:
context - The (application) context object.
Returns:
The created container.
Throws:
TilesContainerFactoryException - If something goes wrong during instantiation.

createContainer

public TilesContainer createContainer(TilesApplicationContext context)
Creates a Tiles container.

Specified by:
createContainer in class AbstractTilesContainerFactory
Parameters:
context - The Tiles application context object.
Returns:
The created container.

setDefaultConfiguration

public void setDefaultConfiguration(Map<String,String> defaultConfiguration)
Sets the default configuration parameters.

Parameters:
defaultConfiguration - The default configuration parameters.

setDefaultValue

public void setDefaultValue(String key,
                            String value)
Sets one default configuration parameter value.

Parameters:
key - The key of the configuration parameter.
value - The value of the configuration parameter.

createTilesContainer

@Deprecated
public TilesContainer createTilesContainer(Object context)
Deprecated. Use createTilesContainer(TilesApplicationContext).

Creates an immutable Tiles container.

Parameters:
context - The (application) context object.
Returns:
The created Tiles container.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

createTilesContainer

public TilesContainer createTilesContainer(TilesApplicationContext context)
Creates an immutable Tiles container.

Parameters:
context - The Tiles application context object.
Returns:
The created Tiles container.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.
Since:
2.1.1

createMutableTilesContainer

@Deprecated
public TilesContainer createMutableTilesContainer(Object context)
Deprecated. Use createMutableTilesContainer(TilesApplicationContext).

Creates an immutable Tiles container.

Parameters:
context - The (application) context object.
Returns:
The created Tiles container.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

createMutableTilesContainer

public MutableTilesContainer createMutableTilesContainer(TilesApplicationContext context)
Creates a mutable Tiles container.

Parameters:
context - The Tiles application context object.
Returns:
The created Tiles container.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

initializeContainer

@Deprecated
protected void initializeContainer(Object context,
                                              BasicTilesContainer container)
Deprecated. Use initializeContainer(TilesApplicationContext, BasicTilesContainer).

Initializes a container.

Parameters:
context - The (application) context object to use.
container - The container to be initialized.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

initializeContainer

protected void initializeContainer(TilesApplicationContext context,
                                   BasicTilesContainer container)
Initializes a container.

Parameters:
context - The Tiles application context object to use.
container - The container to be initialized.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

storeContainerDependencies

protected void storeContainerDependencies(Object context,
                                          Map<String,String> initParameters,
                                          Map<String,String> configuration,
                                          BasicTilesContainer container)
Deprecated. Use storeContainerDependencies(TilesApplicationContext, Map, Map, BasicTilesContainer) .

Stores container dependencies, that is called before TilesContainer.init(Map).

Parameters:
context - The (application) context object to use.
initParameters - The initialization parameters.
configuration - The merged configuration parameters (both defaults and context ones).
container - The container to use.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

storeContainerDependencies

protected void storeContainerDependencies(TilesApplicationContext context,
                                          Map<String,String> initParameters,
                                          Map<String,String> configuration,
                                          BasicTilesContainer container)
Stores container dependencies, that is called before TilesContainer.init(Map).

Parameters:
context - The (application) context object to use.
initParameters - The initialization parameters.
configuration - The merged configuration parameters (both defaults and context ones).
container - The container to use.
Throws:
TilesContainerFactoryException - If something goes wrong during initialization.

postCreationOperations

protected void postCreationOperations(TilesRequestContextFactory contextFactory,
                                      TilesApplicationContext tilesContext,
                                      RendererFactory rendererFactory,
                                      AttributeEvaluator evaluator,
                                      Map<String,String> initParameters,
                                      Map<String,String> configuration,
                                      BasicTilesContainer container)
After the creation of the elements, it is possible to do other operations that will be done after the creation and before the assignment to the container.

Parameters:
contextFactory - The Tiles context factory.
tilesContext - The Tiles application context.
rendererFactory - The renderer factory.
evaluator - The attribute evaluator.
initParameters - The initialization parameters.
configuration - The merged configuration parameters (both defaults and context ones).
container - The container to use.
Since:
2.1.1

createFactory

protected static Object createFactory(Map<String,String> configuration,
                                      String initParameterName)
Creates a factory instance.

Parameters:
configuration - The merged configuration parameters (both defaults and context ones).
initParameterName - The initialization parameter name from which the class name is got.
Returns:
The created factory.
Throws:
TilesContainerFactoryException - If something goes wrong during creation.

resolveFactoryName

protected static String resolveFactoryName(Map<String,String> configuration,
                                           String parameterName)
Resolves a factory class name.

Parameters:
configuration - The merged configuration parameters (both defaults and context ones).
parameterName - The name of the initialization parameter to use.
Returns:
The factory class name.
Throws:
TilesContainerFactoryException - If something goes wrong during resolution.

getInitParameter

@Deprecated
protected static String getInitParameter(Object context,
                                                    String parameterName)
Deprecated. Do not use.

Returns the value of an initialization parameter.

Parameters:
context - The (application) context object to use.
parameterName - The parameter name to retrieve.
Returns:
The parameter value.
Throws:
TilesContainerFactoryException - If the context has not been recognized.

getInitParameterMap

@Deprecated
protected static Map<String,String> getInitParameterMap(Object context)
Deprecated. Do not use.

Returns a map containing parameters name-value entries.

Parameters:
context - The (application) context object to use.
Returns:
The initialization parameters map.
Throws:
TilesContainerFactoryException - If the context object has not been recognized.


Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.