KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > store > Store


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.store;
17
18 import org.apache.avalon.framework.component.Component;
19
20 import java.io.IOException JavaDoc;
21 import java.util.Enumeration JavaDoc;
22
23 /**
24  *
25  * @deprecated Use the Avalon Excalibur Store instead.
26  *
27  * @author <a HREF="mailto:scoobie@betaversion.org">Federico Barbieri</a>
28  * (Betaversion Productions)
29  * @author <a HREF="mailto:stefano@apache.org">Stefano Mazzocchi</a>
30  * (Apache Software Foundation)
31  * @author <a HREF="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
32  * (Apache Software Foundation)
33  * @version CVS $Id: Store.java 30932 2004-07-29 17:35:38Z vgritsenko $
34  */

35 public interface Store extends Component {
36
37     String JavaDoc ROLE = "org.apache.cocoon.components.store.Store/Repository";
38
39     String JavaDoc TRANSIENT_CACHE = "org.apache.cocoon.components.store.Store/TransientCache";
40     String JavaDoc PERSISTENT_CACHE = "org.apache.cocoon.components.store.Store/PersistentCache";
41
42     /**
43      * Get the object associated to the given unique key.
44      */

45     Object JavaDoc get(Object JavaDoc key);
46
47     /**
48      * Store the given object in a persistent state. It is up to the
49      * caller to ensure that the key has a persistent state across
50      * different JVM executions.
51      */

52     void store(Object JavaDoc key, Object JavaDoc value) throws IOException JavaDoc;
53
54     /**
55      * Holds the given object in a volatile state. This means
56      * the object store will discard held objects if the
57      * virtual machine is restarted or some error happens.
58      */

59     void hold(Object JavaDoc key, Object JavaDoc value) throws IOException JavaDoc;
60
61     void free();
62
63     /**
64      * Remove the object associated to the given key.
65      */

66     void remove(Object JavaDoc key);
67
68     /**
69      * Indicates if the given key is associated to a contained object.
70      */

71     boolean containsKey(Object JavaDoc key);
72
73     /**
74      * Returns the list of used keys as an Enumeration of Objects.
75      */

76     Enumeration JavaDoc keys();
77
78     /**
79      * Returns count of the objects in the store, or -1 if could not be
80      * obtained.
81      */

82     int size();
83 }
84
Popular Tags