Author: psteitz Date: Mon Dec 20 08:03:04 2004 New Revision: 122857 URL: http://svn.apache.org/viewcvs?view=rev&rev=122857 Log: Improved javadoc. Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java
Modified: incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java Url: http://svn.apache.org/viewcvs/incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java?view=diff&rev=122857&p1=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java&r1=122856&p2=incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java&r2=122857 ============================================================================== --- incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java (original) +++ incubator/directory/naming/trunk/core/src/java/org/apache/naming/NamingContext.java Mon Dec 20 08:03:04 2004 @@ -35,7 +35,7 @@ import javax.naming.spi.NamingManager; /** - * Catalina JNDI Context implementation. + * JNDI Context implementation. * * @author Remy Maucherat * @version $Revision: 1.3 $ $Date: 2003/11/30 05:22:15 $ @@ -57,7 +57,11 @@ /** - * Builds a naming context using the given environment. + * Builds a naming context with the given name using the given environment. + * + * @param env environment + * @param name external name for the context + * @throws NamingException if a naming exception is encountered */ public NamingContext(Hashtable env, String name) throws NamingException { @@ -77,7 +81,13 @@ /** - * Builds a naming context using the given environment. + * Builds a naming context using the given external name, environment and + * initial bindings. + * + * @param env environment + * @param name external context name + * @bindings initial context bindings + * @throws NamingException if a naming exception is encountered */ public NamingContext(Hashtable env, String name, Hashtable bindings) throws NamingException { @@ -108,7 +118,7 @@ /** - * Name of the associated Catalina Context. + * External name for the Context. */ protected String name; @@ -157,10 +167,13 @@ * Binds a name to an object. All intermediate contexts and the target * context (that named by all but terminal atomic component of the name) * must already exist. + * <p> + * Throws <code>NameAlreadyBoundException</code> if the name is already + * bound in this context. Throws <code>InvalidAttributesException</code> if the + * object does not supply all mandatory attributes. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null - * @exception NameAlreadyBoundException if name is already bound * @exception InvalidAttributesException if object did not supply all * mandatory attributes * @exception NamingException if a naming exception is encountered @@ -173,12 +186,13 @@ /** * Binds a name to an object. + * <p> + * Throws <code>NameAlreadyBoundException</code> if the name is already + * bound in this context. Throws <code>InvalidAttributesException</code> if the + * object does not supply all mandatory attributes. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null - * @exception NameAlreadyBoundException if name is already bound - * @exception InvalidAttributesException if object did not supply all - * mandatory attributes * @exception NamingException if a naming exception is encountered */ public void bind(String name, Object obj) @@ -195,11 +209,12 @@ * If the object is a DirContext, any existing attributes associated with * the name are replaced with those of the object. Otherwise, any * existing attributes associated with the name remain unchanged. + * <p> + * Throws <code>InvalidAttributesException</code> if the object does not + * supply all mandatory attributes. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null - * @exception InvalidAttributesException if object did not supply all - * mandatory attributes * @exception NamingException if a naming exception is encountered */ public void rebind(Name name, Object obj) @@ -210,11 +225,12 @@ /** * Binds a name to an object, overwriting any existing binding. + * <p> + * Throws <code>InvalidAttributesException</code> if the object does not + * supply all mandatory attributes. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null - * @exception InvalidAttributesException if object did not supply all - * mandatory attributes * @exception NamingException if a naming exception is encountered */ public void rebind(String name, Object obj) @@ -444,6 +460,7 @@ * exist * @exception NotContextException if the name is bound but does not name * a context, or does not name a context of the appropriate type + * @exception NamingException if a naming exception is encountered */ public void destroySubcontext(Name name) throws NamingException { @@ -674,6 +691,8 @@ * @param propName the name of the environment property to add; may not * be null * @param propVal the value of the property to add; may not be null + * @return the previous value of the property, or null if the property + * was not in the environment before * @exception NamingException if a naming exception is encountered */ public Object addToEnvironment(String propName, Object propVal) @@ -687,6 +706,8 @@ * * @param propName the name of the environment property to remove; * may not be null + * @return the previous value of the property, or null if the property was + * not in the environment * @exception NamingException if a naming exception is encountered */ public Object removeFromEnvironment(String propName) @@ -828,13 +849,14 @@ * Binds a name to an object. All intermediate contexts and the target * context (that named by all but terminal atomic component of the name) * must already exist. + * <p> + * Throws <code>NameAlreadyBoundException</code> if the name is already + * bound in this context. Throws <code>InvalidAttributesException</code> if the + * object does not supply all mandatory attributes. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @param rebind if true, then perform a rebind (ie, overwrite) - * @exception NameAlreadyBoundException if name is already bound - * @exception InvalidAttributesException if object did not supply all - * mandatory attributes * @exception NamingException if a naming exception is encountered */ protected void bind(Name name, Object obj, boolean rebind) @@ -900,6 +922,8 @@ /** * Returns true if writing is allowed on this context. + * + * @return true if this context is writable */ protected boolean isWritable() { return ContextAccessController.isWritable(name); @@ -907,14 +931,15 @@ /** - * Throws a naming exception is Context is not writable. + * Throws a naming exception if this Context is not writable. + * + * @throws NamingException if a naming exception is encountered */ protected void checkWritable() throws NamingException { if (!isWritable()) throw new NamingException(sm.getString("namingContext.readOnly")); } - }
