com.ibm.ws.exception

Class WsRuntimeException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • com.ibm.ws.exception.WsRuntimeException
  • All Implemented Interfaces:
    WsNestedException, java.io.Serializable


    public class WsRuntimeException
    extends java.lang.RuntimeException
    implements WsNestedException
    The WsRuntimeException class is a subclass of java.lang.RuntimeException that provides support for exception chaining semantics that will be available in the 1.4 timeframe. Exceptions that desire to inherit these semantics while running on pre 1.4 JDKs should extend this class.

    It should be noted that this class will provide only the exception chaining semantics available in 1.4. This is a subset of all the new functionality. introduced in 1.4. Most of that functionality requires support from the JVM that is not available on earlier editions.

    Exceptions that subclass this exception only need to add the various constructors and inherit everything else from this class.

    See the javadoc for the JDK 1.4 java.lang.Throwable for a full description of the exception chaining functionality.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      WsRuntimeException()
      Constructs a new WsRuntimeException with null as its detail message.
      WsRuntimeException(java.lang.String message)
      Constructs a new WsRuntimeException with the specified detail message.
      WsRuntimeException(java.lang.String message, java.lang.Throwable cause)
      Constructs a new WsRuntimeException with the specified detail message and cause.
      WsRuntimeException(java.lang.Throwable cause)
      Constructs a new WsRuntimeException with the specified cause and a detail message of (cause==null ?
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Throwable getCause()
      Return the Throwable that is considered the root cause of this WsException.
      java.lang.Throwable initCause(java.lang.Throwable cause)
      Initialize the cause field for this WsException to the specified value.
      • Methods inherited from class java.lang.Throwable

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

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

      • WsRuntimeException

        public WsRuntimeException()
        Constructs a new WsRuntimeException with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause(java.lang.Throwable).
      • WsRuntimeException

        public WsRuntimeException(java.lang.String message)
        Constructs a new WsRuntimeException with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to initCause(java.lang.Throwable).
        Parameters:
        message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
      • WsRuntimeException

        public WsRuntimeException(java.lang.Throwable cause)
        Constructs a new WsRuntimeException with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for WsRuntimeExceptions that are little more than wrappers for other throwables.
        Parameters:
        cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      • WsRuntimeException

        public WsRuntimeException(java.lang.String message,
                          java.lang.Throwable cause)
        Constructs a new WsRuntimeException with the specified detail message and cause.

        Note that the detail message associated with cause is not automatically incorporated in this WsRuntimeException's detail message.

        Parameters:
        message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method).
        cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • Method Detail

      • getCause

        public java.lang.Throwable getCause()
        Return the Throwable that is considered the root cause of this WsException. Null is returned if the root cause is nonexistent or unknown. The root cause is the throwable that caused this WsException to get thrown.

        The Throwable that is returned is either the Throwable supplied via one of the appropriate constructors, or that set via the 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, such as a legacy exception chaining infrastructure.

        Specified by:
        getCause in interface WsNestedException
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        the Throwable that is the cause of this WsException, or null if the cause is nonexistent or unknown.
      • initCause

        public java.lang.Throwable initCause(java.lang.Throwable cause)
                                      throws java.lang.IllegalStateException,
                                             java.lang.IllegalArgumentException
        Initialize the cause field for this WsException to the specified value. The cause is the Throwable that caused this WsException to get thrown.

        This method can be called at most once. It is generally called from within a constructor that takes a Throwable, or immediately after constructing this object with a constructor that does not accept a \ Throwable. Thus, if a constructor that takes Throwable as a parameter is used to construct this object, it cannot be called at all.

        Specified by:
        initCause in interface WsNestedException
        Overrides:
        initCause in class java.lang.Throwable
        Parameters:
        cause - the Throwable which caused this WsException to be thrown. Null is tolerated.
        Returns:
        a reference to this Throwable instance.
        Throws:
        java.lang.IllegalArgumentException - if the specified cause is this WsException. An exception cannot be its own cause.
        java.lang.IllegalStateException - if this WsException was created with a constructor that specified a cause, or this method has already been called on this object.
IBM WebSphere Application ServerTM
Release 9.0