directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r123167 - /incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java
Date Thu, 23 Dec 2004 05:12:13 GMT
Author: psteitz
Date: Wed Dec 22 21:12:11 2004
New Revision: 123167

URL: http://svn.apache.org/viewcvs?view=rev&rev=123167
Log:
Javadoc.
Modified:
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java
Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java?view=diff&rev=123167&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java&r1=123166&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java&r2=123167
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java
(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/SelectorContext.java
Wed Dec 22 21:12:11 2004
@@ -25,8 +25,17 @@
 import javax.naming.NamingException;
 
 /**
- * Catalina JNDI Context implementation.
- *
+ * Context implementation that delegates JNDI operations to 
+ * {@link NamingContext} instances bound to currently running threads or
+ * classloaders.  The {@link #getBoundContext} method, used to locate the 
+ * appropriate Context instance, looks first for the current thread, then 
+ * classloader in the bindings maintained in {@link ContextBindings}.
+ * <p>
+ * This implementation is limited to the "java:" namespace.  Operations on 
+ * names or name strings that do not start with the "java:" URL header result
+ * in NamingExceptions.  The URL header (or initial component) is stripped
+ * before delegating operations on names / name strings.
+ * 
  * @author Remy Maucherat
  * @version $Revision: 1.3 $ $Date: 2003/11/30 05:22:15 $
  */
@@ -59,7 +68,7 @@
 
 
     /**
-     * Builds a Catalina selector context using the given environment.
+     * Builds a selector context using the given environment.
      */
     public SelectorContext(Hashtable env) {
         this.env = env;
@@ -67,7 +76,7 @@
 
 
     /**
-     * Builds a Catalina selector context using the given environment.
+     * Builds a selector context using the given environment.
      */
     public SelectorContext(Hashtable env, boolean initialContext) {
         this(env);
@@ -611,6 +620,15 @@
 
     /**
      * Get the bound context.
+     * <p>
+     * Tries to find a context bound to the current thread, then classloader.
+     * If this is an initial context and there is no context bound to the 
+     * current thread or classloader, a new <code>NamingContext</code> is 
+     * created and returned.  The newly created context will be a 
+     * {@link SynchronizedContext} if  
+     * <code>SynchronizedContext.isSynchronized(env))</code>
+     * 
+     * @return The bound context
      */
     protected Context getBoundContext()
         throws NamingException {
@@ -646,10 +664,16 @@
 
     /**
      * Strips the URL header.
+     * <p>
+     * If this is an initial context, <code>name</code> is returned; otherwise
+     * the expected "java:" URL header is stripped and the remainder of the
+     * name is returned.  If this is not an initial context and there is no 
+     * "java:" URL header, a <code>NamingException</code> is thrown.
      * 
+     * @param name The name to parse
      * @return the parsed name
-     * @exception NamingException if there is no "java:" header or if no 
-     * naming context has been bound to this thread
+     * @exception NamingException if this is not an initial context and there
+     * is no "java:" URL header
      */
     protected String parseName(String name) 
         throws NamingException {
@@ -669,11 +693,17 @@
 
 
     /**
-     * Strips the URL header.
-     * 
-     * @return the parsed name
-     * @exception NamingException if there is no "java:" header or if no 
-     * naming context has been bound to this thread
+     * Strips the URL header component of the name.
+     * <p>
+     * If this is an initial context, <code>name</code> is returned; otherwise
+     * the expected "java:" URL header is removed and the remainder of the
+     * name is returned.  If this is not an initial context and there is no 
+     * "java:" URL header, a <code>NamingException</code> is thrown.
+     * 
+     * @param name The name to parse
+     * @return The parsed name
+     * @exception NamingException if this is not an initial context and there
+     * is no "java:" URL header
      */
     protected Name parseName(Name name) 
         throws NamingException {

Mime
View raw message