KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > store > LockStore


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/LockStore.java,v 1.9 2004/07/28 09:34:42 ib Exp $
3  * $Revision: 1.9 $
4  * $Date: 2004/07/28 09:34:42 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.store;
25
26 import java.util.Enumeration JavaDoc;
27
28 import org.apache.slide.common.Service;
29 import org.apache.slide.common.ServiceAccessException;
30 import org.apache.slide.common.Uri;
31 import org.apache.slide.lock.LockTokenNotFoundException;
32 import org.apache.slide.lock.NodeLock;
33
34 /**
35  * Store for Lock objects.
36  *
37  * @version $Revision: 1.9 $
38  */

39 public interface LockStore extends Service {
40     
41     
42     // ------------------------------------------------------ Interface Methods
43

44     
45     /**
46      * Create a new lock.
47      *
48      * @param lock Lock token
49      * @exception ServiceAccessException Service access error
50      */

51     void putLock(Uri uri, NodeLock lock)
52         throws ServiceAccessException;
53     
54     
55     /**
56      * Renew a lock.
57      *
58      * @param lock Token to renew
59      * @exception ServiceAccessException Service access error
60      * @exception LockTokenNotFoundException Lock token was not found
61      */

62     void renewLock(Uri uri, NodeLock lock)
63         throws ServiceAccessException, LockTokenNotFoundException;
64     
65     
66     /**
67      * Unlock.
68      *
69      * @param lock Token to remove
70      * @exception ServiceAccessException Service access error
71      * @exception LockTokenNotFoundException Lock token was not found
72      */

73     void removeLock(Uri uri, NodeLock lock)
74         throws ServiceAccessException, LockTokenNotFoundException;
75     
76     
77     /**
78      * Kill a lock.
79      *
80      * @param lock Token to remove
81      * @exception ServiceAccessException Service access error
82      * @exception LockTokenNotFoundException Lock token was not found
83      */

84     void killLock(Uri uri, NodeLock lock)
85         throws ServiceAccessException, LockTokenNotFoundException;
86     
87     
88     /**
89      * Enumerate locks on an object.
90      *
91      * @param uri Uri of the subject
92      * @return Enumeration List of {@link org.apache.slide.lock.NodeLock locks}
93      * which have been put on the subject
94      * @exception ServiceAccessException Service access error
95      */

96     Enumeration JavaDoc enumerateLocks(Uri uri)
97         throws ServiceAccessException;
98     
99     
100 }
101
Popular Tags