Fields Summary |
---|
protected Name | resolvedNameContains the part of the name that has been successfully resolved.
It is a composite name and can be null.
This field is initialized by the constructors.
You should access and manipulate this field
through its get and set methods. |
protected Object | resolvedObjContains the object to which resolution of the part of the name was
successful. Can be null.
This field is initialized by the constructors.
You should access and manipulate this field
through its get and set methods. |
protected Name | remainingNameContains the remaining name that has not been resolved yet.
It is a composite name and can be null.
This field is initialized by the constructors.
You should access and manipulate this field
through its get, set, "append" methods. |
protected Throwable | rootExceptionContains the original exception that caused this NamingException to
be thrown. This field is set if there is additional
information that could be obtained from the original
exception, or if the original exception could not be
mapped to a subclass of NamingException.
Can be null.
This field predates the general-purpose exception chaining facility.
The {@link #initCause(Throwable)} and {@link #getCause()} methods
are now the preferred means of accessing this information. |
private static final long | serialVersionUIDUse serialVersionUID from JNDI 1.1.1 for interoperability |
Methods Summary |
---|
public void | appendRemainingComponent(java.lang.String name)Add name as the last component in remaining name.
if (name != null) {
try {
if (remainingName == null) {
remainingName = new CompositeName();
}
remainingName.add(name);
} catch (NamingException e) {
throw new IllegalArgumentException(e.toString());
}
}
|
public void | appendRemainingName(javax.naming.Name name)Add components from 'name' as the last components in
remaining name.
name is a composite name. If the intent is to append
a compound name, you should "stringify" the compound name
then invoke the overloaded form that accepts a String parameter.
Subsequent changes to name does not
affect the remaining name field in this NamingException and vice versa.
if (name == null) {
return;
}
if (remainingName != null) {
try {
remainingName.addAll(name);
} catch (NamingException e) {
throw new IllegalArgumentException(e.toString());
}
} else {
remainingName = (Name)(name.clone());
}
|
public java.lang.Throwable | getCause()Returns the cause of this exception. The cause is the
throwable that caused this naming exception to be thrown.
Returns null if the cause is nonexistent or
unknown.
return getRootCause();
|
public java.lang.String | getExplanation()Retrieves the explanation associated with this exception.
return getMessage();
|
public javax.naming.Name | getRemainingName()Retrieves the remaining unresolved portion of the name.
return remainingName;
|
public javax.naming.Name | getResolvedName()Retrieves the leading portion of the name that was resolved
successfully.
return resolvedName;
|
public java.lang.Object | getResolvedObj()Retrieves the object to which resolution was successful.
This is the object to which the resolved name is bound.
return resolvedObj;
|
public java.lang.Throwable | getRootCause()Retrieves the root cause of this NamingException, if any.
The root cause of a naming exception is used when the service provider
wants to indicate to the caller a non-naming related exception
but at the same time wants to use the NamingException structure
to indicate how far the naming operation proceeded.
This method predates the general-purpose exception chaining facility.
The {@link #getCause()} method is now the preferred means of obtaining
this information.
return rootException;
|
public java.lang.Throwable | initCause(java.lang.Throwable cause)Initializes the cause of this exception to the specified value.
The cause is the throwable that caused this naming exception to be
thrown.
This method may be called at most once.
super.initCause(cause);
setRootCause(cause);
return this;
|
public void | setRemainingName(javax.naming.Name name)Sets the remaining name field of this exception.
name is a composite name. If the intent is to set
this field using a compound name or string, you must
"stringify" the compound name, and create a composite
name with a single component using the string. You can then
invoke this method using the resulting composite name.
A copy of name is made and stored.
Subsequent changes to name does not
affect the copy in this NamingException and vice versa.
if (name != null)
remainingName = (Name)(name.clone());
else
remainingName = null;
|
public void | setResolvedName(javax.naming.Name name)Sets the resolved name field of this exception.
name is a composite name. If the intent is to set
this field using a compound name or string, you must
"stringify" the compound name, and create a composite
name with a single component using the string. You can then
invoke this method using the resulting composite name.
A copy of name is made and stored.
Subsequent changes to name does not
affect the copy in this NamingException and vice versa.
if (name != null)
resolvedName = (Name)(name.clone());
else
resolvedName = null;
|
public void | setResolvedObj(java.lang.Object obj)Sets the resolved object field of this exception.
resolvedObj = obj;
|
public void | setRootCause(java.lang.Throwable e)Records the root cause of this NamingException.
If e is this, this method does not do anything.
This method predates the general-purpose exception chaining facility.
The {@link #initCause(Throwable)} method is now the preferred means
of recording this information.
if (e != this) {
rootException = e;
}
|
public java.lang.String | toString()Generates the string representation of this exception.
The string representation consists of this exception's class name,
its detailed message, and if it has a root cause, the string
representation of the root cause exception, followed by
the remaining name (if it is not null).
This string is used for debugging and not meant to be interpreted
programmatically.
String answer = super.toString();
if (rootException != null) {
answer += " [Root exception is " + rootException + "]";
}
if (remainingName != null) {
answer += "; remaining name '" + remainingName + "'";
}
return answer;
|
public java.lang.String | toString(boolean detail)Generates the string representation in more detail.
This string representation consists of the information returned
by the toString() that takes no parameters, plus the string
representation of the resolved object (if it is not null).
This string is used for debugging and not meant to be interpreted
programmatically.
if (!detail || resolvedObj == null) {
return toString();
} else {
return (toString() + "; resolved object " + resolvedObj);
}
|