1 /* 2 * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/ObjectCache.java,v 1.10 2004/07/28 09:34:28 ib Exp $ 3 * $Revision: 1.10 $ 4 * $Date: 2004/07/28 09:34:28 $ 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.util; 25 26 /** 27 * Object cache interface. 28 * <p> 29 * Interface to an object cache to the objects manipulated by Slide. This 30 * includes : 31 * <ul> 32 * <li>Uri objects</li> 33 * <li>Object nodes</li> 34 * <li>Revision descriptors</li> 35 * <li>Permissions</li> 36 * <li>Locks</li> 37 * </ul> 38 * <br> 39 * The implementation of this interface is free to provide any kind of 40 * algorithm to limit cache size, like dropping LRU elements. 41 * 42 * @version $Revision: 1.10 $ $Date: 2004/07/28 09:34:28 $ 43 */ 44 public interface ObjectCache { 45 46 47 // ------------------------------------------------------ Interface methods 48 49 50 /** 51 * Get the object associated with the key. 52 * 53 * @param key Object's key 54 * @return Object null if there is no object associated with that key in 55 * the cache, or the object value otherwise 56 */ 57 Object get(Object key); 58 59 60 /** 61 * Add an object to the cache, or overwrite its value. 62 * 63 * @param key Object's key 64 * @param value Object's value 65 */ 66 void put(Object key, Object value); 67 68 69 /** 70 * Remove object associated with the given key. Doesn't do anything if the 71 * key wasn't associated with any object. 72 * 73 * @param key Object's key 74 */ 75 void remove(Object key); 76 77 78 /** 79 * Clear object cache. 80 */ 81 void clear(); 82 83 84 } 85