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

  1. /*
  2.  * @(#)RemoteException.java    1.7 98/03/18
  3.  *
  4.  * Copyright 1996, 1997 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;
  16.  
  17. public class RemoteException extends java.io.IOException {
  18.  
  19.     /* indicate compatibility with JDK 1.1.x version of class */
  20.     private static final long serialVersionUID = -5148567311918794206L;
  21.  
  22.     public Throwable detail;
  23.  
  24.     /**
  25.      * Create a remote exception
  26.      */
  27.     public RemoteException() {}
  28.  
  29.     /**
  30.      * Create a remote exception with the specified string
  31.      */
  32.     public RemoteException(String s) {
  33.     super(s);
  34.     }
  35.  
  36.     /**
  37.      * Create a remote exception with the specified string, and the
  38.      * exception specified.
  39.      */
  40.     public RemoteException(String s, Throwable ex) {
  41.     super(s);
  42.     detail = ex;
  43.     }
  44.  
  45.     /**
  46.      * Produce the message, include the message from the nested
  47.      * exception if there is one.
  48.      */
  49.     public String getMessage() {
  50.     if (detail == null) 
  51.         return super.getMessage();
  52.     else
  53.         return super.getMessage() + 
  54.         "; nested exception is: \n\t" +
  55.         detail.toString();
  56.     }
  57. }
  58.