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

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