01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.webapps.session;
18:
19: import org.apache.cocoon.ProcessingException;
20: import org.apache.cocoon.webapps.session.context.SessionContext;
21:
22: /**
23: * Transaction management<p>
24: * </p>
25: * Transactions are a series of get/set calls to a session context which must
26: * be seen as atomic (single modification).
27: * We distingish between reading and writing. Usually parallel reading is
28: * allowed but if one thread wants to write, no other can read or write.
29: *
30: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
31: * @deprecated This block is deprecated and will be removed in future versions.
32: * @version CVS $Id: TransactionManager.java 433543 2006-08-22 06:22:54Z crossley $
33: */
34: public interface TransactionManager {
35:
36: /** Avalon role */
37: String ROLE = TransactionManager.class.getName();;
38:
39: /**
40: * Reset the transaction management state.
41: */
42: void resetTransactions(SessionContext context);
43:
44: /**
45: * Start a reading transaction.
46: * This call must always be matched with a stopReadingTransaction().
47: * Otherwise the session context is blocked.
48: */
49: void startReadingTransaction(SessionContext context)
50: throws ProcessingException;
51:
52: /**
53: * Stop a reading transaction.
54: * This call must always be done for each startReadingTransaction().
55: * Otherwise the session context is blocked.
56: */
57: void stopReadingTransaction(SessionContext context);
58:
59: /**
60: * Start a writing transaction.
61: * This call must always be matched with a stopWritingTransaction().
62: * Otherwise the session context is blocked.
63: */
64: void startWritingTransaction(SessionContext context)
65: throws ProcessingException;
66:
67: /**
68: * Stop a writing transaction.
69: * This call must always be done for each startWritingTransaction().
70: * Otherwise the session context is blocked.
71: */
72: void stopWritingTransaction(SessionContext context);
73:
74: }
|