You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ps...@apache.org on 2004/09/13 15:14:18 UTC

svn commit: rev 45974 - in incubator/directory/naming/trunk/core/src/java/org/apache/naming: . java

Author: psteitz
Date: Mon Sep 13 06:14:16 2004
New Revision: 45974

Modified:
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/ContextAccessController.java
   incubator/directory/naming/trunk/core/src/java/org/apache/naming/java/javaURLContextFactory.java
Log:
Javadoc.

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/ContextAccessController.java
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/ContextAccessController.java	(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/ContextAccessController.java	Mon Sep 13 06:14:16 2004
@@ -48,7 +48,8 @@
 
 
     /**
-     * Set a security token for a context. Can be set only once.
+     * Set a security token for a context.  Does nothing if the token has
+     * already been set or is null.
      * 
      * @param name Name of the context
      * @param token Security token
@@ -61,7 +62,9 @@
 
 
     /**
-     * Remove a security token for a context.
+     * Remove a security token for a context.  Checks the token first and does
+     * nothing if there is no token set or the token passed in does not match
+     * the token in the repository.
      * 
      * @param name Name of the context
      * @param token Security token
@@ -78,8 +81,9 @@
      * the token present in the repository. If no token is present for the 
      * context, then returns true.
      * 
-     * @param name Name of the context
-     * @param token Submitted security token
+     * @param name name of the context
+     * @param token submitted security token
+     * @return true if the check succeeds
      */
     public static boolean checkSecurityToken
         (Object name, Object token) {
@@ -93,7 +97,8 @@
 
 
     /**
-     * Allow writing to a context.
+     * Remove read-only restriction on the given context.
+     * Checks security token first.
      * 
      * @param name Name of the context
      * @param token Security token
@@ -105,7 +110,7 @@
 
 
     /**
-     * Set whether or not a context is writable.
+     * Make the given context read only.
      * 
      * @param name Name of the context
      */
@@ -118,6 +123,7 @@
      * Returns if a context is writable.
      * 
      * @param name Name of the context
+     * @return true if the context is writable
      */
     public static boolean isWritable(Object name) {
         return !(readOnlyContexts.containsKey(name));

Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/java/javaURLContextFactory.java
==============================================================================
--- incubator/directory/naming/trunk/core/src/java/org/apache/naming/java/javaURLContextFactory.java	(original)
+++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/java/javaURLContextFactory.java	Mon Sep 13 06:14:16 2004
@@ -34,10 +34,10 @@
  * prefix, which can be done by either :
  * <ul>
  * <li>Adding a 
- * java.naming.factory.url.pkgs=org.apache.catalina.util.naming property
+ * java.naming.factory.url.pkgs=org.apache.naming property
  * to the JNDI properties file</li>
  * <li>Setting an environment variable named Context.URL_PKG_PREFIXES with 
- * its value including the org.apache.catalina.util.naming package name. 
+ * its value including the org.apache.naming package name. 
  * More detail about this can be found in the JNDI documentation : 
  * {@link javax.naming.spi.NamingManager#getURLContext(java.lang.String, java.util.Hashtable)}.</li>
  * </ul>
@@ -75,7 +75,18 @@
 
 
     /**
-     * Crete a new Context's instance.
+     * Create a new Context.  Returns null unless
+     * <code>(ContextBindings.isThreadBound()) || 
+     *      (ContextBindings.isClassLoaderBound())).</code>
+     * <p>
+     * Returns a {@link SelectorContext} instance.
+     * 
+     * @param obj Object instance (ignored)
+     * @param name Name (ignored)
+     * @param nameCtx Context (ignored)
+     * @param environment Environment
+     * @return context
+     * @exception NamingException if a naming exception is encountered
      */
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable environment)
@@ -90,7 +101,16 @@
 
 
     /**
-     * Get a new (writable) initial context.
+     * Get a new (writable) initial context.  If  
+     * <code>(ContextBindings.isThreadBound()) || 
+     *      (ContextBindings.isClassLoaderBound()))</code>, a new
+     * {@link SelectorContext} is created.  If the thread is not bound
+     * and no shared writable context has been created, a new shared,
+     * writable {@link NamingContext} is created and returned.  
+     * 
+     * @param environment  environment
+     * @return a new Context
+     * @exception NamingException if a naming exception is encountered
      */
     public Context getInitialContext(Hashtable environment)
         throws NamingException {