View Javadoc
1   /*
2    * Copyright 2004-2022 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    https://www.apache.org/licenses/LICENSE-2.0
9    *
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
29     *          - the model to flush
30     */
31    public void flush(CacheModel cacheModel);
32  
33    /**
34     * Get an object from a cache model.
35     *
36     * @param cacheModel
37     *          - the model
38     * @param key
39     *          - the key to the object
40     *
41     * @return the object if in the cache, or null(?)
42     */
43    public Object getObject(CacheModel cacheModel, Object key);
44  
45    /**
46     * Remove an object from a cache model.
47     *
48     * @param cacheModel
49     *          - the model to remove the object from
50     * @param key
51     *          - the key to the object
52     *
53     * @return the removed object(?)
54     */
55    public Object removeObject(CacheModel cacheModel, Object key);
56  
57    /**
58     * Put an object into a cache model.
59     *
60     * @param cacheModel
61     *          - the model to add the object to
62     * @param key
63     *          - the key to the object
64     * @param object
65     *          - the object to add
66     */
67    public void putObject(CacheModel cacheModel, Object key, Object object);
68  
69    /**
70     * Configure a cache controller.
71     *
72     * @param props
73     *          - the properties object continaing configuration information
74     */
75    public void setProperties(Properties props);
76  
77  }