KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > modules > output > OutputModule


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.modules.output;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.apache.avalon.framework.configuration.Configuration;
20
21 import java.util.Map JavaDoc;
22
23 /**
24  * Communicate results to other components. This could be done via
25  * request attributes, session attribute etc. Implementors should obey
26  * the transactional nature and e.g. queue values as request
27  * attributes and do the real communication e.g. to a bean only when
28  * the transaction completes successfully.
29  *
30  * @author <a HREF="mailto:haul@apache.org">Christian Haul</a>
31  * @version CVS $Id: OutputModule.java 126292 2005-01-24 15:13:30Z vgritsenko $
32  */

33 public interface OutputModule extends Component {
34
35     String JavaDoc ROLE = OutputModule.class.getName();
36
37     /**
38      * communicate an attribute value to further processing logic. OutputModules
39      * work in implicit transaction mode, thus setting an attribute starts an
40      * transaction and sttributes are only visible after the transaction is
41      * successfully completed with a call to commit
42      * @param modeConf column's mode configuration from resource
43      * description. This argument is optional.
44      * @param objectModel The objectModel
45      * @param name The attribute's label, consisting of "table.column"
46      * or "table.column[index]" in case of multiple attributes of the
47      * same spec.
48      * @param value The attriute's value.
49      * */

50     void setAttribute( Configuration modeConf, Map JavaDoc objectModel, String JavaDoc name, Object JavaDoc value );
51
52
53     /**
54      * If a database transaction needs to rollback, this is called to
55      * inform the further processing logic about this fact. All
56      * already set attribute values are invalidated. <em>This is difficult
57      * because only the request object can be used to synchronize this
58      * and build some kind of transaction object. Beaware that sending
59      * your data straight to some beans or other entities could result
60      * in data corruption!</em>
61      * */

62     void rollback( Configuration modeConf, Map JavaDoc objectModel, Exception JavaDoc e );
63
64
65     /**
66      * Signal that the database transaction completed
67      * successfully. See notes on {@link #rollback(Configuration, Map, Exception)}.
68      * */

69     void commit( Configuration modeConf, Map JavaDoc objectModel );
70 }
71
Popular Tags