org.apache.struts.tiles

Interface DefinitionsFactory

public interface DefinitionsFactory extends Serializable

Tiles Definition factory. This interface replace old ComponentDefinitionsFactory. Main method getDefinition() is exactly the same. Initialization method change. This interface allows to retrieve a definition by its name, independently of the factory implementation. Object life cycle is as follow: Implementation must be Serializable, in order to be compliant with web Container having this constraint (Weblogic 6.x).
Method Summary
voiddestroy()

Receive notification that the factory is being shut down.

DefinitionsFactoryConfiggetConfig()
Get factory configuration.
ComponentDefinitiongetDefinition(String name, ServletRequest request, ServletContext servletContext)
Get a definition by its name.
voidinit(DefinitionsFactoryConfig config, ServletContext servletContext)
Init definition factory.
voidsetConfig(DefinitionsFactoryConfig config, ServletContext servletContext)
Set factory configuration.

Method Detail

destroy

public void destroy()

Receive notification that the factory is being shut down.

getConfig

public DefinitionsFactoryConfig getConfig()
Get factory configuration.

Returns: TilesConfig

getDefinition

public ComponentDefinition getDefinition(String name, ServletRequest request, ServletContext servletContext)
Get a definition by its name.

Parameters: name Name of requested definition. request Current servelet request servletContext current servlet context

Throws: DefinitionsFactoryException An error occur while getting definition. NoSuchDefinitionException No definition found for specified name Implementation can throw more accurate exception as a subclass of this exception

init

public void init(DefinitionsFactoryConfig config, ServletContext servletContext)
Init definition factory. This method is called immediately after factory creation, and prior any call to setConfig().

Parameters: config Configuration object used to set factory configuration. servletContext Servlet Context passed to factory.

Throws: DefinitionsFactoryException An error occur during initialization.

setConfig

public void setConfig(DefinitionsFactoryConfig config, ServletContext servletContext)
Set factory configuration. This method is used to change factory configuration. This method is optional, and can send an exception if implementation doesn't allow change in configuration.

Parameters: config Configuration object used to set factory configuration. servletContext Servlet Context passed to factory.

Throws: DefinitionsFactoryException An error occur during initialization.

Copyright © 2000-2008 - The Apache Software Foundation