org.apache.cocoon.components.modules.input
Class AbstractMetaModule

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.modules.input.AbstractInputModule
          extended byorg.apache.cocoon.components.modules.input.AbstractMetaModule
All Implemented Interfaces:
Configurable, Disposable, org.apache.cocoon.components.modules.input.InputModule, Serviceable

public abstract class AbstractMetaModule
extends AbstractInputModule
implements Serviceable

AbstractMetaModule gives you the infrastructure for easily deploying more "meta" InputModules i.e. InputModules that are composed of other InputModules. In order to get at the Logger, use getLogger().

Version:
$Id: AbstractMetaModule.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  String defaultInput
          The default InputModule name / shorthand.
protected  boolean initialized
          Is this instance initialized?
protected  org.apache.cocoon.components.modules.input.InputModule input
          The cached default InputModule
protected static String INPUT_MODULE_SELECTOR
           
protected  Configuration inputConf
          The default InputModule configuration
protected  ServiceSelector inputSelector
          The cached InputModule-Selector
protected  ServiceManager manager
          The service manager instance
 
Fields inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
settings
 
Fields inherited from interface org.apache.cocoon.components.modules.input.InputModule
ROLE
 
Constructor Summary
AbstractMetaModule()
           
 
Method Summary
 void dispose()
          Dispose exactly one cached InputModule.
protected  Iterator getNames(Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf)
          Get names of available attributes in the specified (usually statically assigned) Input Module.
protected  Iterator getNames(Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf, org.apache.cocoon.components.modules.input.InputModule dynamicMod, String dynamicModName, Configuration dynamicModConf)
          Get names of available attributes in one of the specified Input Modules (static or dynamic, dynamic preferred).
protected  Object getValue(String attr, Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf)
          Get an attribute's value from a (usually statically assigned) Input Module.
protected  Object getValue(String attr, Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf, org.apache.cocoon.components.modules.input.InputModule dynamicMod, String dynamicModName, Configuration dynamicModConf)
          Get attribute's value in one of the specified Input Modules (static or dynamic, dynamic preferred).
protected  Object getValue(String attr, Map objectModel, ModuleHolder holder)
           
protected  Object getValue(String attr, Map objectModel, ModuleHolder staticHolder, ModuleHolder dynamicHolder)
           
protected  Object[] getValues(String attr, Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf)
          Get an attribute's values from a (usually statically assigned) Input Module.
protected  Object[] getValues(String attr, Map objectModel, org.apache.cocoon.components.modules.input.InputModule staticMod, String staticModName, Configuration staticModConf, org.apache.cocoon.components.modules.input.InputModule dynamicMod, String dynamicModName, Configuration dynamicModConf)
          Get attribute's values in one of the specified Input Modules (static or dynamic, dynamic preferred).
protected  Object[] getValues(String attr, Map objectModel, ModuleHolder holder)
           
protected  Object[] getValues(String attr, Map objectModel, ModuleHolder staticHolder, ModuleHolder dynamicHolder)
           
 void lazy_initialize()
          Initialize the meta module with exactly one other input module.
protected  org.apache.cocoon.components.modules.input.InputModule obtainModule(String type)
          Obtain a permanent reference to an InputModule.
protected  void releaseModule(org.apache.cocoon.components.modules.input.InputModule module)
          release a permanent reference to an InputModule.
 void service(ServiceManager manager)
           
 
Methods inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
configure, getAttribute, getAttributeNames, getAttributeValues
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected ServiceManager manager
The service manager instance


inputSelector

protected ServiceSelector inputSelector
The cached InputModule-Selector


input

protected org.apache.cocoon.components.modules.input.InputModule input
The cached default InputModule


defaultInput

protected String defaultInput
The default InputModule name / shorthand. Defaults to 'request-param'


inputConf

protected Configuration inputConf
The default InputModule configuration


initialized

protected boolean initialized
Is this instance initialized?


INPUT_MODULE_SELECTOR

protected static final String INPUT_MODULE_SELECTOR
Constructor Detail

AbstractMetaModule

public AbstractMetaModule()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

lazy_initialize

public void lazy_initialize()
Initialize the meta module with exactly one other input module. Since "meta" modules require references to components of the same role, initialization cannot be done in initialize() when also implementing ThreadSafe since at that point the component selector is not yet initialized it would trigger the creation of a new one resulting in an endless loop of initializations. Therefore, every module needs to call this method when it first requires access to another module if the module itself has not been initialized. Override this method and dispose() to keep references to more than one module.


dispose

public void dispose()
Dispose exactly one cached InputModule. To work on more than one, override this method and initialize().

Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractInputModule
See Also:
Disposable.dispose()

obtainModule

protected org.apache.cocoon.components.modules.input.InputModule obtainModule(String type)
Obtain a permanent reference to an InputModule.


releaseModule

protected void releaseModule(org.apache.cocoon.components.modules.input.InputModule module)
release a permanent reference to an InputModule.


getNames

protected Iterator getNames(Map objectModel,
                            org.apache.cocoon.components.modules.input.InputModule staticMod,
                            String staticModName,
                            Configuration staticModConf)
                     throws ConfigurationException
Get names of available attributes in the specified (usually statically assigned) Input Module.

Throws:
ConfigurationException
See Also:
InputModule#getAttributeNames(Configuration, Map)

getNames

protected Iterator getNames(Map objectModel,
                            org.apache.cocoon.components.modules.input.InputModule staticMod,
                            String staticModName,
                            Configuration staticModConf,
                            org.apache.cocoon.components.modules.input.InputModule dynamicMod,
                            String dynamicModName,
                            Configuration dynamicModConf)
                     throws ConfigurationException
Get names of available attributes in one of the specified Input Modules (static or dynamic, dynamic preferred). Dynamic IM may be null.

Throws:
ConfigurationException
See Also:
InputModule#getAttributeNames(Configuration, Map)

getValue

protected Object getValue(String attr,
                          Map objectModel,
                          ModuleHolder holder)
                   throws ConfigurationException
Throws:
ConfigurationException

getValue

protected Object getValue(String attr,
                          Map objectModel,
                          ModuleHolder staticHolder,
                          ModuleHolder dynamicHolder)
                   throws ConfigurationException
Throws:
ConfigurationException

getValues

protected Object[] getValues(String attr,
                             Map objectModel,
                             ModuleHolder holder)
                      throws ConfigurationException
Throws:
ConfigurationException

getValues

protected Object[] getValues(String attr,
                             Map objectModel,
                             ModuleHolder staticHolder,
                             ModuleHolder dynamicHolder)
                      throws ConfigurationException
Throws:
ConfigurationException

getValue

protected Object getValue(String attr,
                          Map objectModel,
                          org.apache.cocoon.components.modules.input.InputModule staticMod,
                          String staticModName,
                          Configuration staticModConf)
                   throws ConfigurationException
Get an attribute's value from a (usually statically assigned) Input Module.

Throws:
ConfigurationException
See Also:
InputModule#getAttribute(String, Configuration, Map)

getValue

protected Object getValue(String attr,
                          Map objectModel,
                          org.apache.cocoon.components.modules.input.InputModule staticMod,
                          String staticModName,
                          Configuration staticModConf,
                          org.apache.cocoon.components.modules.input.InputModule dynamicMod,
                          String dynamicModName,
                          Configuration dynamicModConf)
                   throws ConfigurationException
Get attribute's value in one of the specified Input Modules (static or dynamic, dynamic preferred). Dynamic IM may be null.

Throws:
ConfigurationException
See Also:
InputModule#getAttribute(String, Configuration, Map)

getValues

protected Object[] getValues(String attr,
                             Map objectModel,
                             org.apache.cocoon.components.modules.input.InputModule staticMod,
                             String staticModName,
                             Configuration staticModConf)
                      throws ConfigurationException
Get an attribute's values from a (usually statically assigned) Input Module.

Throws:
ConfigurationException
See Also:
InputModule#getAttributeValues(String, Configuration, Map)

getValues

protected Object[] getValues(String attr,
                             Map objectModel,
                             org.apache.cocoon.components.modules.input.InputModule staticMod,
                             String staticModName,
                             Configuration staticModConf,
                             org.apache.cocoon.components.modules.input.InputModule dynamicMod,
                             String dynamicModName,
                             Configuration dynamicModConf)
                      throws ConfigurationException
Get attribute's values in one of the specified Input Modules (static or dynamic, dynamic preferred). Dynamic IM may be null.

Throws:
ConfigurationException
See Also:
InputModule#getAttributeValues(String, Configuration, Map)


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.