1 22 package org.jboss.metadata.spi.retrieval.basic; 23 24 import java.util.concurrent.atomic.AtomicBoolean ; 25 26 import org.jboss.metadata.spi.loader.MetaDataLoader; 27 import org.jboss.metadata.spi.retrieval.Item; 28 29 36 public abstract class BasicItem<T> implements Item<T> 37 { 38 39 private MetaDataLoader loader; 40 41 42 private AtomicBoolean valid = new AtomicBoolean (true); 43 44 49 public BasicItem(MetaDataLoader loader) 50 { 51 this.loader = loader; 52 } 53 54 public boolean isCachable() 55 { 56 return loader.isCachable(this); 57 } 58 59 public boolean isValid() 60 { 61 return valid.get(); 62 } 63 64 public void invalidate() 65 { 66 this.valid.set(false); 67 } 68 } 69 | Popular Tags |