public abstract class NamingException extends NestedRuntimeException
Constructor and Description |
---|
NamingException(String msg)
Constructor that takes a message.
|
NamingException(String msg,
Throwable cause)
Constructor that allows a message and a root cause.
|
NamingException(Throwable cause)
Constructor that allows a plain root cause, intended for subclasses
mirroring corresponding
javax.naming exceptions. |
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Overrides
Throwable.getCause() since serialization
always tries to serialize the base class before the subclass. |
String |
getExplanation()
Convenience method to get the explanation associated with this exception,
if the root cause was an instance of
NamingException . |
Name |
getRemainingName()
Convenience method to get the unresolved part of the name associated with
this exception, if the root cause was an instance of
NamingException . |
Name |
getResolvedName()
Convenience method to get the leading portion of the resolved name
associated with this exception, if the root cause was an instance of
NamingException . |
Object |
getResolvedObj()
Convenience method to get the resolved object associated with this
exception, if the root cause was an instance of
NamingException . |
contains, getMessage, getMostSpecificCause, getRootCause
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public NamingException(String msg)
msg
- the detail messagepublic NamingException(String msg, Throwable cause)
msg
- the detail messagecause
- the cause of the exception. This argument is generally
expected to be a proper subclass of
NamingException
.public NamingException(Throwable cause)
javax.naming
exceptions.cause
- the cause of the exception. This argument is generally
expected to be a proper subclass of
NamingException
.public Throwable getCause()
Throwable.getCause()
since serialization
always tries to serialize the base class before the subclass. Our
cause may have a resolvedObj that is not
serializable. By storing the cause in this class, we get a chance at
temporarily nulling the cause before serialization, thus in effect making
the current instance serializable.public String getExplanation()
NamingException
.null
if there is no detail message for this
exceptionpublic Name getRemainingName()
NamingException
.null
if the
remaining name field has not been setpublic Name getResolvedName()
NamingException
.null
if the
resolved name field has not been setpublic Object getResolvedObj()
NamingException
.null
if the resolved object field has not been set