KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > storage > TrimmingCache


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// Copyright (C) 2003-@year@, Leo Mekenkamp. All rights reserved.
5
//
6
// $Id: TrimmingCache.java,v 1.1.2.1 2004/03/28 16:40:04 per_nyfelt Exp $
7

8 package org.ozoneDB.core.storage;
9
10
11 /**
12  * A trimming cache is a cache that calls a TrimHandler when it 'knows' that
13  * it has thrown an element out of the cache.
14  *
15  * @author <a HREF="mailto:leoATmekenkampD0Tcom">Leo Mekenkamp (mind the anti sp@m)</a>
16  * @version $Id: TrimmingCache.java,v 1.1.2.1 2004/03/28 16:40:04 per_nyfelt Exp $
17  */

18 public interface TrimmingCache extends Cache {
19     
20     /**
21      * Used by a <code>Cache</code> to provide for a meganism to handle elements
22      * that are going to be thrown out of that cache.
23      */

24     public interface TrimHandler {
25         
26         /**
27          * Called by a <code>TrimmingCache</code> just before an element will be
28          * removed from that cache.
29          * This method may be called asynchronously (by different threads)
30          * depending on the implementation.
31          */

32         public void trimming(Object JavaDoc key, Object JavaDoc value);
33         
34     }
35     
36     public void setTrimHandler(TrimHandler trimHandler);
37     
38     public TrimHandler getTrimHandler();
39  
40     public void setSynchronizer(Object JavaDoc synchronizer);
41
42     public Object JavaDoc getSynchronizer();
43 }
44
45
Popular Tags