org.apache.struts.tiles.definition
Class ReloadableDefinitionsFactory
java.lang.Object
org.apache.struts.tiles.definition.ReloadableDefinitionsFactory
- ComponentDefinitionsFactory, Serializable
public class ReloadableDefinitionsFactory
extends java.lang.Object
A reloadable factory.
This factory is the main entrance to any factory implementation. It takes in
charge real implementation instance, and allows reloading by creating a new
instance.
$Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
DEFINITIONS_FACTORY_CLASSNAME
public static final String DEFINITIONS_FACTORY_CLASSNAME
Name of init property carrying factory class name.
properties
protected Map properties
Initialization parameters.
ReloadableDefinitionsFactory
public ReloadableDefinitionsFactory(ServletContext servletContext,
Map properties)
throws DefinitionsFactoryException
Constructor.
Create a factory according to servlet settings.
servletContext
- Our servlet context.properties
- Map containing all properties.
ReloadableDefinitionsFactory
public ReloadableDefinitionsFactory(ServletContext servletContext,
ServletConfig servletConfig)
throws DefinitionsFactoryException
Constructor.
Create a factory according to servlet settings.
servletContext
- Our servlet context.servletConfig
- Our servlet config.
createDefaultFactory
public ComponentDefinitionsFactory createDefaultFactory(ServletContext servletContext,
Map properties)
throws DefinitionsFactoryException
Create default Definition factory.
Factory must have a constructor taking ServletContext and Map as parameter.
In this implementation, default factory is of class I18nFactorySet
servletContext
- Servlet Context passed to newly created factory.properties
- Map of name/property passed to newly created factory.
createFactory
public ComponentDefinitionsFactory createFactory(ServletContext servletContext,
Map properties)
throws DefinitionsFactoryException
Create Definition factory.
Convenience method. ServletConfig is wrapped into a Map allowing retrieval
of init parameters. Factory classname is also retrieved, as well as debug level.
Finally, approriate createDefinitionsFactory() is called.
servletContext
- Servlet Context passed to newly created factory.properties
- Map containing all properties.
createFactoryFromClassname
public ComponentDefinitionsFactory createFactoryFromClassname(ServletContext servletContext,
Map properties,
String classname)
throws DefinitionsFactoryException
Create Definition factory from provided classname.
If a factory class name is provided, a factory of this class is created. Otherwise,
a default factory is created.
Factory must have a constructor taking ServletContext and Map as parameter.
servletContext
- Servlet Context passed to newly created factory.properties
- Map of name/property passed to newly created factory.classname
- Class name of the factory to create.
initFactory
public void initFactory(ServletContext servletContext,
Map properties)
throws DefinitionsFactoryException
Init factory.
This method is required by interface ComponentDefinitionsFactory. It is
not used in this implementation, as it manages itself the underlying creation
and initialization.
- initFactory in interface ComponentDefinitionsFactory
servletContext
- Servlet Context passed to newly created factory.properties
- Map of name/property passed to newly created factory.
Map can contain more properties than requested.
reload
public void reload(ServletContext servletContext)
throws DefinitionsFactoryException
Reload underlying factory.
Reload is done by creating a new factory instance, and replacing the old instance
with the new one.
servletContext
- Current servlet context.
toString
public String toString()
Return String representation.
Copyright B) 2000-2007 - The Apache Software Foundation