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

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

public class RequestAttributeMap
extends AbstractOutputModule

Abstraction layer to encapsulate different output destinations. This module outputs to a request attribute java.util.Map object that contains all the attributes that were set. Configuration option <key-prefix> defaults to "org.apache.cocoon.components.modules.output.OutputModule"

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

Field Summary
 String PREFIX
           
 String TRANS_PREFIX
           
 
Fields inherited from class org.apache.cocoon.components.modules.output.AbstractOutputModule
settings
 
Fields inherited from interface org.apache.cocoon.components.modules.output.OutputModule
ROLE
 
Constructor Summary
RequestAttributeMap()
           
 
Method Summary
 void commit(Configuration modeConf, Map objectModel)
          Signal that the database transaction completed successfully.
 void rollback(Configuration modeConf, Map objectModel, Exception e)
          If a database transaction needs to rollback, this is called to inform the further processing logic about this fact.
 void setAttribute(Configuration modeConf, Map objectModel, String name, Object value)
          communicate an attribute value to further processing logic.
 
Methods inherited from class org.apache.cocoon.components.modules.output.AbstractOutputModule
attributeExists, configure, dispose, prepareCommit, rollback, transientSetAttribute
 
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
 

Field Detail

PREFIX

public final String PREFIX
See Also:
Constant Field Values

TRANS_PREFIX

public final String TRANS_PREFIX
See Also:
Constant Field Values
Constructor Detail

RequestAttributeMap

public RequestAttributeMap()
Method Detail

setAttribute

public void setAttribute(Configuration modeConf,
                         Map objectModel,
                         String name,
                         Object value)
communicate an attribute value to further processing logic.

Parameters:
modeConf - column's mode configuration from resource description. This argument is optional.
objectModel - The objectModel
name - The attribute's label, consisting of "table.column" or "table.column[index]" in case of multiple attributes of the same spec.
value - The attriute's value.

rollback

public void rollback(Configuration modeConf,
                     Map objectModel,
                     Exception e)
If a database transaction needs to rollback, this is called to inform the further processing logic about this fact. All already set attribute values are invalidated. This is difficult because only the request object can be used to synchronize this and build some kind of transaction object. Beaware that sending your data straight to some beans or other entities could result in data corruption!


commit

public void commit(Configuration modeConf,
                   Map objectModel)
Signal that the database transaction completed successfully. See notes on @link{rollback}.



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