KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > cache > ObjectCacheEmptyImpl


1 package org.apache.ojb.broker.cache;
2
3 /* Copyright 2002-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 import org.apache.commons.lang.builder.ToStringBuilder;
19 import org.apache.commons.lang.builder.ToStringStyle;
20 import org.apache.ojb.broker.Identity;
21 import org.apache.ojb.broker.PersistenceBroker;
22
23 import java.util.Properties JavaDoc;
24
25 /**
26  * This is an 'empty' ObjectCache implementation.
27  * Useful when caching was not desired.
28  * <br/>
29  * NOTE: This implementation does not prevent infinite loops caused by
30  * 'circular references' of loaded object graphs.
31  * (this will change in versions &gt; 1.0).
32  *
33  * <p>
34  * Implementation configuration properties:
35  * </p>
36  *
37  * <table cellspacing="2" cellpadding="2" border="3" frame="box">
38  * <tr>
39  * <td><strong>Property Key</strong></td>
40  * <td><strong>Property Values</strong></td>
41  * </tr>
42  * <tr>
43  * <td> - </td>
44  * <td>
45  * -
46  * </td>
47  * </tr>
48  * </table>
49  *
50  * @author Thomas Mahler
51  * @version $Id: ObjectCacheEmptyImpl.java,v 1.13.2.3 2005/12/21 22:24:15 tomdz Exp $
52  *
53  */

54 public class ObjectCacheEmptyImpl implements ObjectCache
55 {
56
57     public ObjectCacheEmptyImpl(PersistenceBroker broker, Properties JavaDoc prop)
58     {
59
60     }
61
62     /**
63      * @see org.apache.ojb.broker.cache.ObjectCache#cache(Identity, Object)
64      */

65     public void cache(Identity oid, Object JavaDoc obj)
66     {
67         //do nothing
68
}
69
70     /**
71      * @see org.apache.ojb.broker.cache.ObjectCache#lookup(Identity)
72      */

73     public Object JavaDoc lookup(Identity oid)
74     {
75         return null;
76     }
77
78     /**
79      * @see org.apache.ojb.broker.cache.ObjectCache#remove(Identity)
80      */

81     public void remove(Identity oid)
82     {
83         //do nothing
84
}
85
86     /**
87      * @see org.apache.ojb.broker.cache.ObjectCache#clear()
88      */

89     public void clear()
90     {
91         //do nothing
92
}
93
94     public String JavaDoc toString()
95     {
96         ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
97         return buf.toString();
98     }
99 }
100
101
Popular Tags