KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > cache > CacheAdministration


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  */

20 package org.enhydra.dods.cache;
21
22 import org.enhydra.dods.exceptions.CacheObjectException;
23
24 /**
25  * CacheAdministration handles configuration settings about cache
26  * (data object (or DataStruct object), simple query or complex query cache).
27  *
28  * @author Tanja Jovanovic
29  * @author Nenad Vico
30  * @author Zorica Suvajdzin
31  * @version 2.0 15.06.2003.
32  */

33 public abstract class CacheAdministration {
34
35     /**
36      * Returns maximum cache size.
37      *
38      * @return Maximum cache size.
39      */

40     public abstract int getMaxCacheSize();
41
42     /**
43      * Returns maximum cache size. If the cache is unbounded (the maximum size
44      * is negative), the current cache size is returned.
45      *
46      * @param real If this parameter is true, this method returns real maximum
47      * cache size, otherwise returns appropriate value for statistics.
48      *
49      * @return Maximum cache size.
50      */

51     public abstract int getMaxCacheSize(boolean real);
52
53     /**
54      * Returns current size of the cache (number of elements in the cache).
55      *
56      * @return Size of currently used data object cache.
57      */

58     public abstract int getCacheSize();
59
60     /**
61      * Sets maximum cache size.
62      *
63      * @param maxSize Maximum cache size.
64      */

65     protected abstract void setMaxCacheSize(int maxSize) throws CacheObjectException;
66
67     /**
68      * Refreshes cache.
69      */

70     public abstract void refresh();
71
72     /**
73      * Disables cache.
74      */

75     public abstract void disable();
76
77     /**
78      * Enables cache.
79      */

80     public abstract void enable();
81 }
82
Popular Tags