1 package org.sapia.regis.cache; 2 3 import org.sapia.regis.Node; 4 import org.sapia.regis.Path; 5 import org.sapia.regis.RegisSession; 6 import org.sapia.regis.Registry; 7 8 19 public class CacheRegistry implements Registry{ 20 21 private Registry _internal; 22 private CacheNode _root; 23 24 public RegisSession open() { 25 CacheRegisSession session = new CacheRegisSession(_internal.open()); 26 CacheSessions.join(session); 27 return session; 28 } 29 30 34 public CacheRegistry(Registry reg, long refreshIntervalMillis){ 35 _root = new CacheNode(Path.parse(Node.ROOT_NAME), reg, refreshIntervalMillis); 36 _internal = reg; 37 } 38 39 public Node getRoot() { 40 return _root; 41 } 42 43 46 public Registry internal(){ 47 return _internal; 48 } 49 50 public void close() { 51 _internal.close(); 52 } 53 } 54 | Popular Tags |