1 7 package org.jboss.cache.eviction; 8 9 import org.jboss.cache.config.ConfigurationException; 10 11 27 public class FIFOConfiguration extends EvictionPolicyConfigBase 28 { 29 30 private static final long serialVersionUID = -7229715009546277313L; 31 32 public FIFOConfiguration() 33 { 34 setEvictionPolicyClassName(); 35 setMaxNodes(-1); 37 } 38 39 43 @Override 44 public void validate() throws ConfigurationException 45 { 46 if (getMaxNodes() < 0) 47 throw new ConfigurationException("maxNodes not configured"); 48 } 49 50 public String toString() 51 { 52 StringBuffer ret = new StringBuffer (); 53 ret.append("LFUConfiguration: maxNodes = ").append(getMaxNodes()); 54 return ret.toString(); 55 } 56 57 @Override 58 public boolean equals(Object obj) 59 { 60 return (obj instanceof FIFOConfiguration && super.equals(obj)); 61 } 62 63 @Override 64 protected void setEvictionPolicyClassName() 65 { 66 setEvictionPolicyClass(FIFOPolicy.class.getName()); 67 } 68 69 @Override 70 public void reset() 71 { 72 setMaxNodes(-1); 73 } 74 } 75 | Popular Tags |