java.lang.Object
org.apache.struts.tiles.definition.ReloadableDefinitionsFactory
- All Implemented Interfaces:
- org.apache.struts.tiles.ComponentDefinitionsFactory, java.io.Serializable
- public class ReloadableDefinitionsFactory
- extends java.lang.Object
- implements org.apache.struts.tiles.ComponentDefinitionsFactory
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.
- Since:
- Struts 1.1
- Version:
- $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
factory
protected org.apache.struts.tiles.ComponentDefinitionsFactory factory
- The real factory instance.
properties
protected java.util.Map properties
- Initialization parameters.
DEFINITIONS_FACTORY_CLASSNAME
public static final java.lang.String DEFINITIONS_FACTORY_CLASSNAME
- Name of init property carrying factory class name.
- See Also:
- Constant Field Values
ReloadableDefinitionsFactory
public ReloadableDefinitionsFactory(javax.servlet.ServletContext servletContext,
javax.servlet.ServletConfig servletConfig)
throws org.apache.struts.tiles.DefinitionsFactoryException
- Constructor.
Create a factory according to servlet settings.
ReloadableDefinitionsFactory
public ReloadableDefinitionsFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws org.apache.struts.tiles.DefinitionsFactoryException
- Constructor.
Create a factory according to servlet settings.
createFactoryFromClassname
public org.apache.struts.tiles.ComponentDefinitionsFactory createFactoryFromClassname(javax.servlet.ServletContext servletContext,
java.util.Map properties,
java.lang.String classname)
throws org.apache.struts.tiles.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.
createDefaultFactory
public org.apache.struts.tiles.ComponentDefinitionsFactory createDefaultFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws org.apache.struts.tiles.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
createFactory
public org.apache.struts.tiles.ComponentDefinitionsFactory createFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws org.apache.struts.tiles.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.
getDefinition
public org.apache.struts.tiles.ComponentDefinition getDefinition(java.lang.String definitionName,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
throws org.apache.struts.tiles.FactoryNotFoundException,
org.apache.struts.tiles.DefinitionsFactoryException
- Get a definition by its name.
Call appropriate method on underlying factory instance.
Throw appropriate exception if definition or definition factory is not found.
- Specified by:
getDefinition in interface org.apache.struts.tiles.ComponentDefinitionsFactory
reload
public void reload(javax.servlet.ServletContext servletContext)
throws org.apache.struts.tiles.DefinitionsFactoryException
- Reload underlying factory.
Reload is done by creating a new factory instance, and replacing the old instance
with the new one.
getFactory
public org.apache.struts.tiles.ComponentDefinitionsFactory getFactory()
- Get underlying factory instance.
initFactory
public void initFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws org.apache.struts.tiles.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.
- Specified by:
initFactory in interface org.apache.struts.tiles.ComponentDefinitionsFactory
toString
public java.lang.String toString()
- Return String representation.