home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / rmi / activation / ActivationException.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.7 KB  |  68 lines

  1. /*
  2.  * @(#)ActivationException.java    1.10 98/03/18
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.rmi.activation;
  16.  
  17. /**
  18.  * General exception used by the activation interfaces.
  19.  *
  20.  * @author     Ann Wollrath
  21.  * @version    1.10, 03/18/98
  22.  * @since     JDK1.2
  23.  */
  24. public
  25. class ActivationException extends Exception {
  26.  
  27.     public Throwable detail;
  28.  
  29.     /** indicate compatibility with JDK 1.2 version of class */
  30.     private static final long serialVersionUID = -4320118837291406071L;
  31.  
  32.     /** Constructs an activation exception */
  33.     public ActivationException() {
  34.     super();
  35.     }
  36.  
  37.     /** Constructs an activation exception with text, <code>s</code>
  38.      * @param s detail message
  39.      */
  40.     public ActivationException(String s) {
  41.     super(s);
  42.     }
  43.  
  44.     /** Constructs an activation exception with detail message,
  45.      * <code>s</code>, and detail exception <code>ex</code>.
  46.      *
  47.      * @param s detail message
  48.      * @param ex detail exception
  49.      */
  50.     public ActivationException(String s, Throwable ex) {
  51.     super(s);
  52.     detail = ex;
  53.     }
  54.  
  55.     /**
  56.      * Produce the message, include the message from the nested
  57.      * exception if there is one.
  58.      */
  59.     public String getMessage() {
  60.     if (detail == null) 
  61.         return super.getMessage();
  62.     else
  63.         return super.getMessage() + 
  64.         "; nested exception is: \n\t" +
  65.         detail.toString();
  66.     }
  67. }
  68.