01: /*
02: * Copyright 2004 Clinton Begin
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package com.ibatis.sqlmap.engine.cache;
17:
18: import java.util.Properties;
19:
20: /**
21: * Cache controller (implementation) interface
22: */
23: public interface CacheController {
24:
25: /**
26: * Flush a cache model
27: *
28: * @param cacheModel - the model to flush
29: */
30: public void flush(CacheModel cacheModel);
31:
32: /**
33: * Get an object from a cache model
34: *
35: * @param cacheModel - the model
36: * @param key - the key to the object
37: * @return the object if in the cache, or null(?)
38: */
39: public Object getObject(CacheModel cacheModel, Object key);
40:
41: /**
42: * Remove an object from a cache model
43: *
44: * @param cacheModel - the model to remove the object from
45: * @param key - the key to the object
46: * @return the removed object(?)
47: */
48: public Object removeObject(CacheModel cacheModel, Object key);
49:
50: /**
51: * Put an object into a cache model
52: *
53: * @param cacheModel - the model to add the object to
54: * @param key - the key to the object
55: * @param object - the object to add
56: */
57: public void putObject(CacheModel cacheModel, Object key,
58: Object object);
59:
60: /**
61: * Configure a cache controller
62: *
63: * @param props - the properties object continaing configuration information
64: */
65: public void configure(Properties props);
66:
67: }
|