1 package org.sapia.regis; 2 3 /** 4 * This interface models a "configuration registry", in which configuration is 5 * hierarchically kept. 6 * <p> 7 * All accesses to a registry, in the context of a given thread, must be done using 8 * a session that was acquired from that registry, according to the following programming 9 * model: 10 * <pre> 11 * RegisSession session = registry.open(); 12 * try{ 13 * Node root = registry.getRoot(); 14 * ... 15 * }finally{ 16 * session.close(); 17 * } 18 * </pre> 19 * 20 * @author yduchesne 21 * 22 */ 23 public interface Registry{ 24 25 /** 26 * @return the root <code>Node</code> of this instance. 27 */ 28 public Node getRoot(); 29 30 /** 31 * Opens a session linked to this instance and returns it. 32 * 33 * @return a <code>RegisSession</code>. 34 */ 35 public RegisSession open(); 36 37 /** 38 * Closes this instance. 39 */ 40 public void close(); 41 } 42