src/share/classes/javax/naming/NamingException.java

Print this page




 184       * @return The possibly null detail string explaining more
 185       *         about this exception. If null, it means there is no
 186       *         detail message for this exception.
 187       *
 188       * @see java.lang.Throwable#getMessage
 189       */
 190     public String getExplanation() {
 191         return getMessage();
 192     }
 193 
 194     /**
 195      * Sets the resolved name field of this exception.
 196      *<p>
 197      * <tt>name</tt> is a composite name. If the intent is to set
 198      * this field using a compound name or string, you must
 199      * "stringify" the compound name, and create a composite
 200      * name with a single component using the string. You can then
 201      * invoke this method using the resulting composite name.
 202      *<p>
 203      * A copy of <code>name</code> is made and stored.
 204      * Subsequent changes to <code>name</code> does not
 205      * affect the copy in this NamingException and vice versa.
 206      *
 207      * @param name The possibly null name to set resolved name to.
 208      *          If null, it sets the resolved name field to null.
 209      * @see #getResolvedName
 210      */
 211     public void setResolvedName(Name name) {
 212         if (name != null)
 213             resolvedName = (Name)(name.clone());
 214         else
 215             resolvedName = null;
 216     }
 217 
 218     /**
 219      * Sets the remaining name field of this exception.
 220      *<p>
 221      * <tt>name</tt> is a composite name. If the intent is to set
 222      * this field using a compound name or string, you must
 223      * "stringify" the compound name, and create a composite
 224      * name with a single component using the string. You can then
 225      * invoke this method using the resulting composite name.
 226      *<p>
 227      * A copy of <code>name</code> is made and stored.
 228      * Subsequent changes to <code>name</code> does not
 229      * affect the copy in this NamingException and vice versa.
 230      * @param name The possibly null name to set remaining name to.
 231      *          If null, it sets the remaining name field to null.
 232      * @see #getRemainingName
 233      * @see #appendRemainingName
 234      * @see #appendRemainingComponent
 235      */
 236     public void setRemainingName(Name name) {
 237         if (name != null)
 238             remainingName = (Name)(name.clone());
 239         else
 240             remainingName = null;
 241     }
 242 
 243     /**
 244      * Sets the resolved object field of this exception.
 245      * @param obj The possibly null object to set resolved object to.
 246      *            If null, the resolved object field is set to null.
 247      * @see #getResolvedObj
 248      */


 262         if (name != null) {
 263             try {
 264                 if (remainingName == null) {
 265                     remainingName = new CompositeName();
 266                 }
 267                 remainingName.add(name);
 268             } catch (NamingException e) {
 269                 throw new IllegalArgumentException(e.toString());
 270             }
 271         }
 272     }
 273 
 274     /**
 275       * Add components from 'name' as the last components in
 276       * remaining name.
 277       *<p>
 278       * <tt>name</tt> is a composite name. If the intent is to append
 279       * a compound name, you should "stringify" the compound name
 280       * then invoke the overloaded form that accepts a String parameter.
 281       *<p>
 282       * Subsequent changes to <code>name</code> does not
 283       * affect the remaining name field in this NamingException and vice versa.
 284       * @param name The possibly null name containing ordered components to add.
 285       *                 If name is null, this method does not do anything.
 286       * @see #setRemainingName
 287       * @see #getRemainingName
 288       * @see #appendRemainingComponent
 289       */
 290     public void appendRemainingName(Name name) {
 291         if (name == null) {
 292             return;
 293         }
 294         if (remainingName != null) {
 295             try {
 296                 remainingName.addAll(name);
 297             } catch (NamingException e) {
 298                 throw new IllegalArgumentException(e.toString());
 299             }
 300         } else {
 301             remainingName = (Name)(name.clone());
 302         }




 184       * @return The possibly null detail string explaining more
 185       *         about this exception. If null, it means there is no
 186       *         detail message for this exception.
 187       *
 188       * @see java.lang.Throwable#getMessage
 189       */
 190     public String getExplanation() {
 191         return getMessage();
 192     }
 193 
 194     /**
 195      * Sets the resolved name field of this exception.
 196      *<p>
 197      * <tt>name</tt> is a composite name. If the intent is to set
 198      * this field using a compound name or string, you must
 199      * "stringify" the compound name, and create a composite
 200      * name with a single component using the string. You can then
 201      * invoke this method using the resulting composite name.
 202      *<p>
 203      * A copy of <code>name</code> is made and stored.
 204      * Subsequent changes to <code>name</code> do not
 205      * affect the copy in this NamingException and vice versa.
 206      *
 207      * @param name The possibly null name to set resolved name to.
 208      *          If null, it sets the resolved name field to null.
 209      * @see #getResolvedName
 210      */
 211     public void setResolvedName(Name name) {
 212         if (name != null)
 213             resolvedName = (Name)(name.clone());
 214         else
 215             resolvedName = null;
 216     }
 217 
 218     /**
 219      * Sets the remaining name field of this exception.
 220      *<p>
 221      * <tt>name</tt> is a composite name. If the intent is to set
 222      * this field using a compound name or string, you must
 223      * "stringify" the compound name, and create a composite
 224      * name with a single component using the string. You can then
 225      * invoke this method using the resulting composite name.
 226      *<p>
 227      * A copy of <code>name</code> is made and stored.
 228      * Subsequent changes to <code>name</code> do not
 229      * affect the copy in this NamingException and vice versa.
 230      * @param name The possibly null name to set remaining name to.
 231      *          If null, it sets the remaining name field to null.
 232      * @see #getRemainingName
 233      * @see #appendRemainingName
 234      * @see #appendRemainingComponent
 235      */
 236     public void setRemainingName(Name name) {
 237         if (name != null)
 238             remainingName = (Name)(name.clone());
 239         else
 240             remainingName = null;
 241     }
 242 
 243     /**
 244      * Sets the resolved object field of this exception.
 245      * @param obj The possibly null object to set resolved object to.
 246      *            If null, the resolved object field is set to null.
 247      * @see #getResolvedObj
 248      */


 262         if (name != null) {
 263             try {
 264                 if (remainingName == null) {
 265                     remainingName = new CompositeName();
 266                 }
 267                 remainingName.add(name);
 268             } catch (NamingException e) {
 269                 throw new IllegalArgumentException(e.toString());
 270             }
 271         }
 272     }
 273 
 274     /**
 275       * Add components from 'name' as the last components in
 276       * remaining name.
 277       *<p>
 278       * <tt>name</tt> is a composite name. If the intent is to append
 279       * a compound name, you should "stringify" the compound name
 280       * then invoke the overloaded form that accepts a String parameter.
 281       *<p>
 282       * Subsequent changes to <code>name</code> do not
 283       * affect the remaining name field in this NamingException and vice versa.
 284       * @param name The possibly null name containing ordered components to add.
 285       *                 If name is null, this method does not do anything.
 286       * @see #setRemainingName
 287       * @see #getRemainingName
 288       * @see #appendRemainingComponent
 289       */
 290     public void appendRemainingName(Name name) {
 291         if (name == null) {
 292             return;
 293         }
 294         if (remainingName != null) {
 295             try {
 296                 remainingName.addAll(name);
 297             } catch (NamingException e) {
 298                 throw new IllegalArgumentException(e.toString());
 299             }
 300         } else {
 301             remainingName = (Name)(name.clone());
 302         }