jdk/src/java.naming/share/classes/javax/naming/LinkException.java
author sundar
Mon, 31 Aug 2015 17:51:02 +0530
changeset 32434 769b3d81ae69
parent 32029 a5538163e144
permissions -rw-r--r--
8134731: Function.prototype.apply interacts incorrectly with arguments Reviewed-by: attila, hannesw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.naming;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
    29
 * This exception is used to describe problems encountered while resolving links.
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
    30
 * Additional information is added to the base NamingException for pinpointing
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * the problem with the link.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *<p>
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
    33
 * Analogously to how NamingException captures name resolution information,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * LinkException captures "link"-name resolution information pinpointing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * the problem encountered while resolving a link. All these fields may
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <li> Link Resolved Name. Portion of link name that has been resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <li> Link Resolved Object. Object to which resolution of link name proceeded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <li> Link Remaining Name. Portion of link name that has not been resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <li> Link Explanation. Detail explaining why link resolution failed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  * A LinkException instance is not synchronized against concurrent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  * multithreaded access. Multiple threads trying to access and modify
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  * a single LinkException instance should lock the object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
  * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
  * @author Scott Seligman
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
  * @see Context#lookupLink
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  * @see LinkRef
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
  /*<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
  * The serialized form of a LinkException object consists of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  * serialized fields of its NamingException superclass, the link resolved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
  * name (a Name object), the link resolved object, link remaining name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
  * (a Name object), and the link explanation String.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
public class LinkException extends NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * Contains the part of the link that has been successfully resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * It is a composite name and can be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * This field is initialized by the constructors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * You should access and manipulate this field
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * through its get and set methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @see #getLinkResolvedName
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @see #setLinkResolvedName
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    protected Name linkResolvedName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
      * Contains the object to which resolution of the part of the link was successful.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
      * Can be null. This field is initialized by the constructors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
      * You should access and manipulate this field
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
      * through its get and set methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
      * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
      * @see #getLinkResolvedObj
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
      * @see #setLinkResolvedObj
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    protected Object linkResolvedObj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Contains the remaining link name that has not been resolved yet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * It is a composite name and can be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * This field is initialized by the constructors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * You should access and manipulate this field
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * through its get and set methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @see #getLinkRemainingName
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @see #setLinkRemainingName
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    protected Name linkRemainingName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Contains the exception of why resolution of the link failed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Can be null. This field is initialized by the constructors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * You should access and manipulate this field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * through its get and set methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @see #getLinkExplanation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @see #setLinkExplanation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    protected String linkExplanation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
   114
      * Constructs a new instance of LinkException with an explanation.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
      * All the other fields are initialized to null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
      * @param  explanation     A possibly null string containing additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
      *                         detail about this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
      * @see java.lang.Throwable#getMessage
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    public LinkException(String explanation) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        super(explanation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        linkResolvedName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        linkResolvedObj = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        linkRemainingName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        linkExplanation = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      * Constructs a new instance of LinkException.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
      * All the non-link-related and link-related fields are initialized to null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public LinkException() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        linkResolvedName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        linkResolvedObj = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        linkRemainingName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        linkExplanation = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Retrieves the leading portion of the link name that was resolved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * successfully.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @return The part of the link name that was resolved successfully.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *          It is a composite name. It can be null, which means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *          the link resolved name field has not been set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @see #getLinkResolvedObj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @see #setLinkResolvedName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public Name getLinkResolvedName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        return this.linkResolvedName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * Retrieves the remaining unresolved portion of the link name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @return The part of the link name that has not been resolved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *          It is a composite name. It can be null, which means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     *          the link remaining name field has not been set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @see #setLinkRemainingName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    public Name getLinkRemainingName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        return this.linkRemainingName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * Retrieves the object to which resolution was successful.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * This is the object to which the resolved link name is bound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @return The possibly null object that was resolved so far.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * If null, it means the link resolved object field has not been set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @see #getLinkResolvedName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @see #setLinkResolvedObj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    public Object getLinkResolvedObj() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        return this.linkResolvedObj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
   179
      * Retrieves the explanation associated with the problem encountered
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
      * when resolving a link.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
      * @return The possibly null detail string explaining more about the problem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
      * with resolving a link.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
      *         If null, it means there is no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
      *         link detail message for this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
      * @see #setLinkExplanation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    public String getLinkExplanation() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        return this.linkExplanation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    /**
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
   193
      * Sets the explanation associated with the problem encountered
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
      * when resolving a link.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
      * @param msg The possibly null detail string explaining more about the problem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
      * with resolving a link. If null, it means no detail will be recorded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
      * @see #getLinkExplanation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public void setLinkExplanation(String msg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        this.linkExplanation = msg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * Sets the resolved link name field of this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *<p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   207
     * {@code name} is a composite name. If the intent is to set
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * this field using a compound name or string, you must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * "stringify" the compound name, and create a composite
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * name with a single component using the string. You can then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * invoke this method using the resulting composite name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * A copy of <code>name</code> is made and stored.
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
   214
     * Subsequent changes to <code>name</code> do not
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * affect the copy in this NamingException and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @param name The name to set resolved link name to. This can be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *          If null, it sets the link resolved name field to null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @see #getLinkResolvedName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    public void setLinkResolvedName(Name name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        if (name != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            this.linkResolvedName = (Name)(name.clone());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            this.linkResolvedName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Sets the remaining link name field of this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     *<p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   233
     * {@code name} is a composite name. If the intent is to set
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * this field using a compound name or string, you must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * "stringify" the compound name, and create a composite
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * name with a single component using the string. You can then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * invoke this method using the resulting composite name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * A copy of <code>name</code> is made and stored.
22974
4bf6c0d73bb8 4682009: Typo in javadocs in javax/naming
igerasim
parents: 5506
diff changeset
   240
     * Subsequent changes to <code>name</code> do not
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * affect the copy in this NamingException and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @param name The name to set remaining link name to. This can be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     *  If null, it sets the remaining name field to null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * @see #getLinkRemainingName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    public void setLinkRemainingName(Name name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        if (name != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            this.linkRemainingName = (Name)(name.clone());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
            this.linkRemainingName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * Sets the link resolved object field of this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * This indicates the last successfully resolved object of link name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * @param obj The object to set link resolved object to. This can be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     *            If null, the link resolved object field is set to null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @see #getLinkResolvedObj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    public void setLinkResolvedObj(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        this.linkResolvedObj = obj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * Generates the string representation of this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * This string consists of the NamingException information plus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * the link's remaining name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * This string is used for debugging and not meant to be interpreted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * programmatically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @return The non-null string representation of this link exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        return super.toString() + "; Link Remaining Name: '" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
            this.linkRemainingName + "'";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * Generates the string representation of this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * This string consists of the NamingException information plus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * the additional information of resolving the link.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * If 'detail' is true, the string also contains information on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * the link resolved object. If false, this method is the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * as the form of toString() that accepts no parameters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * This string is used for debugging and not meant to be interpreted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * programmatically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * @param   detail  If true, add information about the link resolved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *                  object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @return The non-null string representation of this link exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public String toString(boolean detail) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        if (!detail || this.linkResolvedObj == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
            return this.toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        return this.toString() + "; Link Resolved Object: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
            this.linkResolvedObj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * Use serialVersionUID from JNDI 1.1.1 for interoperability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    private static final long serialVersionUID = -7967662604076777712L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
};