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

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.modules.output.AbstractOutputModule
          extended byorg.apache.cocoon.components.modules.output.SessionAttributeOutputModule
All Implemented Interfaces:
Configurable, Disposable, org.apache.cocoon.components.modules.output.OutputModule, ThreadSafe

public class SessionAttributeOutputModule
extends org.apache.cocoon.components.modules.output.AbstractOutputModule
implements ThreadSafe

Abstraction layer to encapsulate different output destinations. Configuration option <key-prefix> defaults to "org.apache.cocoon.components.modules.output.OutputModule"+":" Can be used with different isolation-level: default is "0" being no isolation at all, values are immediately visible but are removed on a rollback; "1" keeps the values at a save place until either rollback or commit is called. Then values are either discarded or copied to the final destination.

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

Field Summary
static String PREFIX
           
static String ROLLBACK_LIST
           
static 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
SessionAttributeOutputModule()
           
 
Method Summary
 void commit(Configuration modeConf, Map objectModel)
          Signal that the database transaction completed successfully.
protected  String getName(String name)
           
 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.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

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

TRANS_PREFIX

public static final String TRANS_PREFIX
See Also:
Constant Field Values

ROLLBACK_LIST

public static final String ROLLBACK_LIST
See Also:
Constant Field Values
Constructor Detail

SessionAttributeOutputModule

public SessionAttributeOutputModule()
Method Detail

setAttribute

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

Specified by:
setAttribute in interface org.apache.cocoon.components.modules.output.OutputModule
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!

Specified by:
rollback in interface org.apache.cocoon.components.modules.output.OutputModule

commit

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

Specified by:
commit in interface org.apache.cocoon.components.modules.output.OutputModule

getName

protected String getName(String name)


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