KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > repository > helpers > RepositoryTransactionHelper


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.repository.helpers;
17
18 import org.apache.cocoon.ProcessingException;
19
20 /**
21  * A locking helper interface intended to be used by flowscripts or corresponding wrapper components.
22  */

23 public interface RepositoryTransactionHelper {
24     
25     /**
26      * beginning a transaction on the repository
27      *
28      * @return a boolean indicating success.
29      * @throws ProcessingException
30      */

31     boolean beginTran() throws ProcessingException;
32
33     /**
34      * committing a transaction on the repository
35      *
36      * @return a boolean indicating success.
37      * @throws ProcessingException
38      */

39     boolean commitTran() throws ProcessingException;
40
41     /**
42      * rolling back a transaction on the repository
43      *
44      * @return a boolean indicating success.
45      * @throws ProcessingException
46      */

47     boolean rollbackTran() throws ProcessingException;
48
49     /**
50      * lock the resource
51      *
52      * @param uri the uri of the resource.
53      * @return a boolean indicating success.
54      * @throws ProcessingException
55      */

56     boolean lock(String JavaDoc uri) throws ProcessingException;
57
58     /**
59      * lock the resource with explicit timeout in seconds
60      *
61      * @param uri the uri of the resource.
62      * @param timeout the lock timeout in seconds.
63      * @return a boolean indicating success.
64      * @throws ProcessingException
65      */

66     boolean lock(String JavaDoc uri, int timeout) throws ProcessingException;
67
68     /**
69      * unlock resource
70      *
71      * @param uri the uri of the resource.
72      * @return a boolean indicating success.
73      * @throws ProcessingException
74      */

75     boolean unlock(String JavaDoc uri) throws ProcessingException;
76
77     /**
78      * checking wether the repository supports transactions
79      *
80      * @return true if the repository supports transactions.
81      */

82     boolean supportsTransactions();
83
84     /**
85      * checking wether the repository supports locking
86      *
87      * @return true if the repository supports locking.
88      */

89     boolean supportsLocking();
90
91 }
Popular Tags