Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.struts.tiles.definition
Class ReloadableDefinitionsFactory  view ReloadableDefinitionsFactory download ReloadableDefinitionsFactory.java

java.lang.Object
  extended byorg.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) $

Nested Class Summary
(package private)  class ReloadableDefinitionsFactory.ServletPropertiesMap
          Inner class.
 
Field Summary
static java.lang.String DEFINITIONS_FACTORY_CLASSNAME
          Name of init property carrying factory class name.
protected  org.apache.struts.tiles.ComponentDefinitionsFactory factory
          The real factory instance.
protected  java.util.Map properties
          Initialization parameters.
 
Constructor Summary
ReloadableDefinitionsFactory(javax.servlet.ServletContext servletContext, java.util.Map properties)
          Constructor.
ReloadableDefinitionsFactory(javax.servlet.ServletContext servletContext, javax.servlet.ServletConfig servletConfig)
          Constructor.
 
Method Summary
 org.apache.struts.tiles.ComponentDefinitionsFactory createDefaultFactory(javax.servlet.ServletContext servletContext, java.util.Map properties)
          Create default Definition factory.
 org.apache.struts.tiles.ComponentDefinitionsFactory createFactory(javax.servlet.ServletContext servletContext, java.util.Map properties)
          Create Definition factory.
 org.apache.struts.tiles.ComponentDefinitionsFactory createFactoryFromClassname(javax.servlet.ServletContext servletContext, java.util.Map properties, java.lang.String classname)
          Create Definition factory from provided classname.
 org.apache.struts.tiles.ComponentDefinition getDefinition(java.lang.String definitionName, javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext)
          Get a definition by its name.
 org.apache.struts.tiles.ComponentDefinitionsFactory getFactory()
          Get underlying factory instance.
 void initFactory(javax.servlet.ServletContext servletContext, java.util.Map properties)
          Init factory.
 void reload(javax.servlet.ServletContext servletContext)
          Reload underlying factory.
 java.lang.String toString()
          Return String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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.

Method Detail

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.