KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > perseus > cache > api > UnbindManager


1 /**
2  * Copyright (C) 2001-2002
3  * - France Telecom R&D
4  * - Laboratoire Logiciels, Systemes, Reseaux - UMR 5526, CNRS-INPG-UJF
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Release: 1.0
21  *
22  * Authors:
23  *
24  */

25
26 package org.objectweb.perseus.cache.api;
27
28 import java.util.Collection JavaDoc;
29
30 /**
31  * This interface is used by the replacement manager to evict
32  * an instance from the cache. The primitive CacheManager component and the
33  * replacement manager implement this interface.
34  * In some implementation the instance is not evicted on the call of the unbind
35  * method weither the java Garbage Collector and the strengh link to entry.
36  *
37  * @author Luciano Garcia-Banuelos (Luciano.Garcia@imag.fr)
38  */

39 public interface UnbindManager {
40
41     /**
42      * Evicts an instance from the cache.
43      * @param oid is the identifier associated to the cache entry to evict
44      * @param force is a boolean value indicating if the cache must remove the
45      * entry or let the GC does its job.
46      * @throws CacheException is raised when the entry is already unbound from
47      * the cache.
48      */

49     boolean unbind(Object JavaDoc oid, boolean force) throws CacheException;
50
51     /**
52      * Evicts instances from the cache.
53      * @param oids is a collection of the identifier associated to cache entries
54      * to evict
55      * @param force is a boolean value indicating if the cache must remove the
56      * entries or let the GC does its job.
57      * @return the oid of the really evicted entries
58      * @throws CacheException is raised when entries are already unbound from
59      * the cache.
60      */

61     Collection JavaDoc unbindAll(Collection JavaDoc oids, boolean force) throws CacheException;
62
63     /**
64      * Try to evict unfixed instances.
65      * @param force is a boolean value indicating if the cache must remove the
66      * entries or let the GC does its job.
67      * @return the number of entry really evicted
68      * @throws CacheException
69      */

70     Collection JavaDoc unbindUnfixed(boolean force) throws CacheException;
71 }
72
Popular Tags