01: package org.apache.ojb.broker.cache;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * 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;
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 > 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: public ObjectCacheEmptyImpl(PersistenceBroker broker,
57: Properties prop) {
58:
59: }
60:
61: /**
62: * @see org.apache.ojb.broker.cache.ObjectCache#cache(Identity, Object)
63: */
64: public void cache(Identity oid, Object obj) {
65: //do nothing
66: }
67:
68: /**
69: * @see org.apache.ojb.broker.cache.ObjectCache#lookup(Identity)
70: */
71: public Object lookup(Identity oid) {
72: return null;
73: }
74:
75: /**
76: * @see org.apache.ojb.broker.cache.ObjectCache#remove(Identity)
77: */
78: public void remove(Identity oid) {
79: //do nothing
80: }
81:
82: /**
83: * @see org.apache.ojb.broker.cache.ObjectCache#clear()
84: */
85: public void clear() {
86: //do nothing
87: }
88:
89: public String toString() {
90: ToStringBuilder buf = new ToStringBuilder(this,
91: ToStringStyle.DEFAULT_STYLE);
92: return buf.toString();
93: }
94: }
|