001: package com.completex.objective.components.ocache.impl;
002:
003: import com.completex.objective.components.ocache.SafeWrapper;
004: import com.completex.objective.components.ocache.OdalCacheListener;
005: import com.completex.objective.components.ocache.OdalKeyFactory;
006: import com.completex.objective.components.ocache.OdalKeyedCache;
007: import com.completex.objective.components.ocache.OdalMultiIndexCache;
008: import com.completex.objective.components.ocache.OdalCache;
009:
010: /**
011: * Thread safe OdalCache decorator for LinkedCacheImpl
012: *
013: * @author Gennady Krizhevsky
014: */
015: public class SafeMultiIndexCacheImpl implements OdalMultiIndexCache,
016: SafeWrapper {
017:
018: private OdalMultiIndexCache delegate;
019:
020: /**
021: * @param coreCache underlying cache
022: */
023: public SafeMultiIndexCacheImpl(OdalMultiIndexCache coreCache) {
024: delegate = coreCache;
025: }
026:
027: /**
028: * @see com.completex.objective.components.ocache.OdalLinkedCache#put(Object)
029: */
030: public synchronized void put(Object value) {
031: delegate.put(value);
032: }
033:
034: /**
035: * @see com.completex.objective.components.ocache.OdalLinkedCache#get(Object)
036: */
037: public synchronized Object get(Object key) {
038: return delegate.get(key);
039: }
040:
041: /**
042: * @see com.completex.objective.components.ocache.OdalLinkedCache#remove(Object)
043: */
044: public synchronized Object remove(Object key) {
045: return delegate.remove(key);
046: }
047:
048: /**
049: * @see com.completex.objective.components.ocache.OdalLinkedCache#clear()
050: */
051: public synchronized void clear() {
052: delegate.clear();
053: }
054:
055: /**
056: * @see com.completex.objective.components.ocache.OdalLinkedCache#getNotNotify(Object)
057: */
058: public Object getNotNotify(Object key) {
059: return delegate.getNotNotify(key);
060: }
061:
062: /**
063: * @see com.completex.objective.components.ocache.OdalLinkedCache#putNotNotify(Object, Object)
064: */
065: public Object putNotNotify(Object key, Object value) {
066: return delegate.putNotNotify(key, value);
067: }
068:
069: /**
070: * @see com.completex.objective.components.ocache.OdalLinkedCache#addListener(com.completex.objective.components.ocache.OdalCacheListener)
071: */
072: public void addListener(OdalCacheListener listener) {
073: delegate.addListener(listener);
074: }
075:
076: /**
077: * @see com.completex.objective.components.ocache.OdalLinkedCache#removeListener(com.completex.objective.components.ocache.OdalCacheListener)
078: */
079: public void removeListener(OdalCacheListener listener) {
080: delegate.removeListener(listener);
081: }
082:
083: /**
084: * @see com.completex.objective.components.ocache.OdalLinkedCache#removeAllListeners()
085: */
086: public void removeAllListeners() {
087: delegate.removeAllListeners();
088: }
089:
090: /**
091: * @see com.completex.objective.components.ocache.OdalLinkedCache#put(Object, Object)
092: */
093: public Object put(Object key, Object object) {
094: return delegate.put(key, object);
095: }
096:
097: /**
098: * @see com.completex.objective.components.ocache.OdalLinkedCache#getName()
099: */
100: public String getName() {
101: return delegate.getName();
102: }
103:
104: /**
105: * @see com.completex.objective.components.ocache.OdalCacheListener#beforeGet(Object)
106: */
107: public void beforeGet(Object key) {
108: delegate.beforeGet(key);
109: }
110:
111: /**
112: * @see com.completex.objective.components.ocache.OdalCacheListener#afterGet(Object, Object)
113: */
114: public void afterGet(Object key, Object value) {
115: delegate.afterGet(key, value);
116: }
117:
118: /**
119: * @see com.completex.objective.components.ocache.OdalCacheListener#beforePut(Object, Object)
120: */
121: public void beforePut(Object key, Object value) {
122: delegate.beforePut(key, value);
123: }
124:
125: /**
126: * @see com.completex.objective.components.ocache.OdalCacheListener#afterPut(Object, Object)
127: */
128: public void afterPut(Object key, Object value) {
129: delegate.afterPut(key, value);
130: }
131:
132: /**
133: * @see com.completex.objective.components.ocache.OdalCacheListener#beforeRemove(Object)
134: */
135: public void beforeRemove(Object key) {
136: delegate.beforeRemove(key);
137: }
138:
139: /**
140: * @see com.completex.objective.components.ocache.OdalCacheListener#afterRemove(Object, Object)
141: */
142: public void afterRemove(Object key, Object value) {
143: delegate.afterRemove(key, value);
144: }
145:
146: /**
147: * @see com.completex.objective.components.ocache.OdalCacheListener#beforeClear()
148: */
149: public void beforeClear() {
150: delegate.beforeClear();
151: }
152:
153: /**
154: * @see com.completex.objective.components.ocache.OdalCacheListener#afterClear()
155: */
156: public void afterClear() {
157: delegate.afterClear();
158: }
159:
160: /**
161: * @see com.completex.objective.components.ocache.OdalKeyedCache#getKeyFactory()
162: */
163: public OdalKeyFactory getKeyFactory() {
164: return delegate.getKeyFactory();
165: }
166:
167: /**
168: * @see com.completex.objective.components.ocache.OdalKeyedCache#isMarkCacheCollectionElements()
169: */
170: public boolean isMarkCacheCollectionElements() {
171: return delegate.isMarkCacheCollectionElements();
172: }
173:
174: /**
175: * @see com.completex.objective.components.ocache.SafeWrapper#getDelegate()
176: */
177: public OdalKeyedCache getDelegate() {
178: return delegate;
179: }
180:
181: public OdalKeyedCache getMasterCache() {
182: return delegate.getMasterCache();
183: }
184:
185: public void setMasterCache(OdalMultiIndexCache masterOdalKeyedCache) {
186: delegate.setMasterCache(masterOdalKeyedCache);
187: }
188:
189: public boolean isMaster() {
190: return delegate.isMaster();
191: }
192:
193: public OdalCache getCoreCache() {
194: return delegate;
195: }
196:
197: }
|