01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * 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)
66: throws CacheObjectException;
67:
68: /**
69: * Refreshes cache.
70: */
71: public abstract void refresh();
72:
73: /**
74: * Disables cache.
75: */
76: public abstract void disable();
77:
78: /**
79: * Enables cache.
80: */
81: public abstract void enable();
82: }
|