|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception javax.naming.NamingException
This is the superclass of all exceptions thrown by operations in the Context and DirContext interfaces. The nature of the failure is described by the name of the subclass. This exception captures the information pinpointing where the operation failed, such as where resolution last proceeded to.
A NamingException instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single NamingException instance should lock the object.
Field Summary | |
protected Name |
remainingName
Contains the remaining name that has not been resolved yet. |
protected Name |
resolvedName
Contains the part of the name that has been successfully resolved. |
protected Object |
resolvedObj
Contains the object to which resolution of the part of the name was successful. |
protected Throwable |
rootException
Contains the original exception that caused this NamingException to be thrown. |
Constructor Summary | |
NamingException()
Constructs a new NamingException. |
|
NamingException(String explanation)
Constructs a new NamingException with an explanation. |
Method Summary | |
void |
appendRemainingComponent(String name)
Add name as the last component in remaining name. |
void |
appendRemainingName(Name name)
Add components from 'name' as the last components in remaining name. |
Throwable |
getCause()
Returns the cause of this throwable or null if the
cause is nonexistent or unknown. |
String |
getExplanation()
Retrieves the explanation associated with this exception. |
Name |
getRemainingName()
Retrieves the remaining unresolved portion of the name. |
Name |
getResolvedName()
Retrieves the leading portion of the name that was resolved successfully. |
Object |
getResolvedObj()
Retrieves the object to which resolution was successful. |
Throwable |
getRootCause()
Retrieves the root cause of this NamingException, if any. |
Throwable |
initCause(Throwable cause)
Initializes the cause of this throwable to the specified value. |
void |
setRemainingName(Name name)
Sets the remaining name field of this exception. |
void |
setResolvedName(Name name)
Sets the resolved name field of this exception. |
void |
setResolvedObj(Object obj)
Sets the resolved object field of this exception. |
void |
setRootCause(Throwable e)
Records the root cause of this NamingException. |
String |
toString()
Generates the string representation of this exception. |
String |
toString(boolean detail)
Generates the string representation in more detail. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Name resolvedName
getResolvedName()
,
setResolvedName(javax.naming.Name)
protected Object resolvedObj
getResolvedObj()
,
setResolvedObj(java.lang.Object)
protected Name remainingName
getRemainingName()
,
setRemainingName(javax.naming.Name)
,
appendRemainingName(javax.naming.Name)
,
appendRemainingComponent(java.lang.String)
protected Throwable rootException
getRootCause()
,
setRootCause(java.lang.Throwable)
Constructor Detail |
public NamingException(String explanation)
explanation
- A possibly null string containing
additional detail about this exception.Throwable.getMessage()
public NamingException()
Method Detail |
public Name getResolvedName()
getResolvedObj()
,
setResolvedName(javax.naming.Name)
public Name getRemainingName()
setRemainingName(javax.naming.Name)
,
appendRemainingName(javax.naming.Name)
,
appendRemainingComponent(java.lang.String)
public Object getResolvedObj()
getResolvedName()
,
setResolvedObj(java.lang.Object)
public String getExplanation()
Throwable.getMessage()
public void setResolvedName(Name name)
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.
name
- The possibly null name to set resolved name to.
If null, it sets the resolved name field to null.getResolvedName()
public void setRemainingName(Name name)
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.
name
- The possibly null name to set remaining name to.
If null, it sets the remaining name field to null.getRemainingName()
,
appendRemainingName(javax.naming.Name)
,
appendRemainingComponent(java.lang.String)
public void setResolvedObj(Object obj)
obj
- The possibly null object to set resolved object to.
If null, the resolved object field is set to null.getResolvedObj()
public void appendRemainingComponent(String name)
name
- The component to add.
If name is null, this method does not do anything.setRemainingName(javax.naming.Name)
,
getRemainingName()
,
appendRemainingName(javax.naming.Name)
public void appendRemainingName(Name 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.
name
- The possibly null name containing ordered components to add.
If name is null, this method does not do anything.setRemainingName(javax.naming.Name)
,
getRemainingName()
,
appendRemainingComponent(java.lang.String)
public Throwable getRootCause()
setRootCause(java.lang.Throwable)
,
rootException
,
getCause()
public void setRootCause(Throwable e)
e
- The possibly null exception that caused the naming
operation to fail. If null, it means this naming
exception has no root cause.getRootCause()
,
rootException
,
initCause(java.lang.Throwable)
public Throwable getCause()
Throwable
null
if the
cause is nonexistent or unknown. (The cause is the throwable that
caused this throwable to get thrown.)
This implementation returns the cause that was supplied via one of
the constructors requiring a Throwable, or that was set after
creation with the Throwable.initCause(Throwable)
method. While it is
typically unnecessary to override this method, a subclass can override
it to return a cause set by some other means. This is appropriate for
a "legacy chained throwable" that predates the addition of chained
exceptions to Throwable. Note that it is not
necessary to override any of the PrintStackTrace methods,
all of which invoke the getCause method to determine the
cause of a throwable.
getCause
in class Throwable
null
if the
cause is nonexistent or unknown.public Throwable initCause(Throwable cause)
Throwable
This method can be called at most once. It is generally called from
within the constructor, or immediately after creating the
throwable. If this throwable was created
with Throwable.Throwable(Throwable)
or
Throwable.Throwable(String,Throwable)
, this method cannot be called
even once.
initCause
in class Throwable
cause
- the cause (which is saved for later retrieval by the
Throwable.getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)
Throwable
instance.public String toString()
toString
in class Throwable
public String toString(boolean detail)
detail
- If true, include details about the resolved object
in addition to the other information.
|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2003, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.