01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.cache;
05:
06: import com.tc.text.PrettyPrinter;
07:
08: import java.util.Collection;
09: import java.util.Collections;
10:
11: /**
12: * @author steve
13: */
14: public class NullCache implements EvictionPolicy {
15:
16: public synchronized boolean add(Cacheable obj) {
17: return false;
18: }
19:
20: public Collection getRemovalCandidates(int maxCount) {
21: return Collections.EMPTY_LIST;
22: }
23:
24: public synchronized void remove(Cacheable obj) {
25: //nothing to remove. The cache is null
26: }
27:
28: public synchronized void markReferenced(Cacheable obj) {
29: //move the referenced object up in the lru
30: }
31:
32: public PrettyPrinter prettyPrint(PrettyPrinter out) {
33: return out.println("NULL CACHE");
34: }
35:
36: public int getCacheCapacity() {
37: return Integer.MAX_VALUE;
38: }
39: }
|