ManagementException.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: ManagementException.java,v 1.2 2003/05/23 13:10:02 danesa Exp $: ManagementException.java,v 1.11 2001/05/09 10:09:20 michelb Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.jmx;
00027 
00032 public class ManagementException extends RuntimeException {
00033 
00034     protected Throwable cause;
00035 
00036     public ManagementException(String message) {
00037         this(message, null);
00038     }
00039 
00040     public ManagementException(String message, Throwable throwable) {
00041         super(message);
00042         this.cause = throwable;
00043     }
00044 
00045     public Throwable getCause() {
00046         return cause;
00047     }
00048 
00049     public String getMessage() {
00050         String msg = super.getMessage();
00051         if (cause != null) {
00052             if (!msg.equals(""))
00053                 msg += cause.toString();
00054             else
00055                 msg += ": " + cause.toString();               
00056         }
00057         return msg ;
00058     }
00059 
00060     public String toString(){
00061         return(this.getClass().getName() + " : " + this.getMessage());
00062     }
00063 
00064 }

Generated on Tue Feb 15 15:05:17 2005 for JOnAS by  doxygen 1.3.9.1