A read-only Context in the java: namespace.
This version assumes it and all its subcontext are read-only and any attempt to modify (e.g. through bind) will result in an OperationNotSupportedException. Each Context in the tree builds a cache of the entries in all sub-contexts to optimise the performance of lookup.
This implementation is intended to optimise the performance of lookup(String) to about the level of a HashMap get. It has been observed that the scheme resolution phase performed by the JVM takes considerably longer, so for optimum performance lookups should be coded like:
Context componentContext = (Context)new InitialContext().lookup("java:comp"); String envEntry = (String) componentContext.lookup("env/myEntry"); String envEntry2 = (String) componentContext.lookup("env/myEntry2");
@version $Rev: 355877 $ $Date: 2005-12-11 03:48:27 +0100 (Sun, 11 Dec 2005) $