org.apache.cocoon.components.modules.output
Class AbstractOutputModule

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.modules.output.AbstractOutputModule
All Implemented Interfaces:
Disposable, Component, Configurable, LogEnabled, OutputModule
Direct Known Subclasses:
RequestAttributeMap, RequestAttributeOutputModule, SessionAttributeOutputModule

public abstract class AbstractOutputModule
extends AbstractLogEnabled
implements OutputModule, Configurable, Disposable

AbstractOutputModule gives you the infrastructure for easily deploying more output modules.

In order to get at the logger, use getLogger().

Version:
CVS $Id: AbstractOutputModule.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Christian Haul

Field Summary
protected  HashMap settings
          Stores (global) configuration parameters as key / value pairs.
 
Fields inherited from interface org.apache.cocoon.components.modules.output.OutputModule
ROLE
 
Constructor Summary
AbstractOutputModule()
           
 
Method Summary
protected  boolean attributeExists(Map objectModel, String trans_place, String name)
          Returns a whether an transient attribute already exists.
 void configure(Configuration conf)
          Configures the module.
 void dispose()
          Dispose
protected  Map prepareCommit(Map objectModel, String trans_place)
          Returns a map containing all transient attributes and remove them i.e. attributes set with transientSetAttribute(Map, String, String, Object) since the last call to rollback(Map, String) or prepareCommit(Map, String)
protected  void rollback(Map objectModel, String trans_place)
          Clears all uncommitted transient attributes.
protected  void transientSetAttribute(Map objectModel, String trans_place, String name, Object value)
          Utility method to store parameters in a map as request attribute until either rollback(Map, String) or prepareCommit(Map, String) is called.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.components.modules.output.OutputModule
commit, rollback, setAttribute
 

Field Detail

settings

protected HashMap settings
Stores (global) configuration parameters as key / value pairs.

Constructor Detail

AbstractOutputModule

public AbstractOutputModule()
Method Detail

configure

public void configure(Configuration conf)
               throws ConfigurationException
Configures the module.

Takes all elements nested in component declaration and stores them as key-value pairs in settings. Nested configuration option are not catered for. This way global configuration options can be used.

For nested configurations override this function.

Specified by:
configure in interface Configurable
Throws:
ConfigurationException

dispose

public void dispose()
Dispose

Specified by:
dispose in interface Disposable

transientSetAttribute

protected void transientSetAttribute(Map objectModel,
                                     String trans_place,
                                     String name,
                                     Object value)
Utility method to store parameters in a map as request attribute until either rollback(Map, String) or prepareCommit(Map, String) is called.

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data
name - - name of the attribute to set
value - - attribute value

rollback

protected void rollback(Map objectModel,
                        String trans_place)
Clears all uncommitted transient attributes.

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data

attributeExists

protected boolean attributeExists(Map objectModel,
                                  String trans_place,
                                  String name)
Returns a whether an transient attribute already exists. transientSetAttribute(Map, String, String, Object) since the last call to rollback(Map, String) or prepareCommit(Map, String)

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data

prepareCommit

protected Map prepareCommit(Map objectModel,
                            String trans_place)
Returns a map containing all transient attributes and remove them i.e. attributes set with transientSetAttribute(Map, String, String, Object) since the last call to rollback(Map, String) or prepareCommit(Map, String)

Parameters:
objectModel - - the objectModel
trans_place - - request attribute name used for the transient data


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