Class NamingException

    • Constructor Summary

      Constructors 
      Constructor Description
      NamingException​(java.lang.String msg)
      Constructor that takes a message.
      NamingException​(java.lang.String msg, java.lang.Throwable cause)
      Constructor that allows a message and a root cause.
      NamingException​(java.lang.Throwable cause)
      Constructor that allows a plain root cause, intended for subclasses mirroring corresponding javax.naming exceptions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()
      Overrides Throwable.getCause() since serialization always tries to serialize the base class before the subclass.
      java.lang.String getExplanation()
      Convenience method to get the explanation associated with this exception, if the root cause was an instance of NamingException.
      javax.naming.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.
      javax.naming.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.
      java.lang.Object getResolvedObj()
      Convenience method to get the resolved object associated with this exception, if the root cause was an instance of NamingException.
      • Methods inherited from class org.springframework.core.NestedRuntimeException

        contains, getMessage, getMostSpecificCause, getRootCause
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NamingException

        public NamingException​(java.lang.String msg)
        Constructor that takes a message.
        Parameters:
        msg - the detail message
      • NamingException

        public NamingException​(java.lang.String msg,
                               java.lang.Throwable cause)
        Constructor that allows a message and a root cause.
        Parameters:
        msg - the detail message
        cause - the cause of the exception. This argument is generally expected to be a proper subclass of NamingException.
      • NamingException

        public NamingException​(java.lang.Throwable cause)
        Constructor that allows a plain root cause, intended for subclasses mirroring corresponding javax.naming exceptions.
        Parameters:
        cause - the cause of the exception. This argument is generally expected to be a proper subclass of NamingException.
    • Method Detail

      • getCause

        public java.lang.Throwable getCause()
        Overrides 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.
        Overrides:
        getCause in class java.lang.Throwable
      • getExplanation

        public java.lang.String getExplanation()
        Convenience method to get the explanation associated with this exception, if the root cause was an instance of NamingException.
        Returns:
        a detail string explaining more about this exception if the root cause is an instance of javax.naming.NamingException, or null if there is no detail message for this exception
      • getRemainingName

        public javax.naming.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.
        Returns:
        a composite name describing the part of the name that has not been resolved if the root cause is an instance of javax.naming.NamingException, or null if the remaining name field has not been set
      • getResolvedName

        public javax.naming.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.
        Returns:
        a composite name describing the the leading portion of the name that was resolved successfully if the root cause is an instance of javax.naming.NamingException, or null if the resolved name field has not been set
      • getResolvedObj

        public java.lang.Object getResolvedObj()
        Convenience method to get the resolved object associated with this exception, if the root cause was an instance of NamingException.
        Returns:
        the object that was resolved so far if the root cause is an instance of javax.naming.NamingException, or null if the resolved object field has not been set