1 20 package org.enhydra.dods.cache; 21 22 import java.util.Map ; 23 import org.enhydra.dods.cache.ConfigurationAdministration; 24 import com.lutris.appserver.server.sql.CoreDataStruct; 25 import org.enhydra.dods.exceptions.CacheObjectException; 26 27 38 public abstract class DataStructCache extends ConfigurationAdministration { 39 40 43 protected DataStructCache() { 44 Wrapper w = Wrapper.getInstance(); 45 46 w.registerCache(this); 47 } 48 49 55 public abstract DataStructCache newInstance() throws CacheObjectException; 56 57 63 public abstract Map getCacheContent(); 64 65 70 public abstract boolean isMulti(); 71 72 77 public abstract boolean toReconfigure(); 78 79 86 public abstract CoreDataStruct addDataStruct(CoreDataStruct newDS); 87 88 96 public abstract CoreDataStruct removeDataStruct(CoreDataStruct data); 97 98 108 public abstract CoreDataStruct removeDataStruct(String handle); 109 110 119 public abstract CoreDataStruct updateDataStruct(CoreDataStruct data); 120 121 129 public abstract CoreDataStruct deleteDataStruct(CoreDataStruct data); 130 131 140 public abstract CoreDataStruct getDataStructByHandle(String handle); 141 142 145 final synchronized void lock() { 146 locked = true; 147 } 148 149 152 final synchronized void unlock() { 153 locked = false; 154 } 155 156 159 protected final synchronized boolean isLocked() { 160 return locked; 161 } 162 163 166 private boolean locked = false; 167 } 168 | Popular Tags |