00001 00057 package com.arcle.rmt.j2se.util; 00058 00065 public class ExceptionWrapper extends Exception { 00066 00067 public ExceptionWrapper(Exception wrapped) { 00068 super(); 00069 _wrappedException = wrapped; 00070 } 00071 00079 public ExceptionWrapper(Exception wrapped, String message) { 00080 super(message); 00081 _wrappedException = wrapped; 00082 } 00083 00084 public Exception getWrappedException() { 00085 return _wrappedException; 00086 } 00087 00088 00098 public String getMessage() { 00099 return getWrappedException().getMessage(); 00100 } 00101 00112 public String getLocalizedMessage() { 00113 return getWrappedException().getMessage(); 00114 } 00115 00132 public String toString() { 00133 return super.toString(); 00134 //return getWrappedException().toString(); 00135 } 00136 00173 public void printStackTrace() { 00174 synchronized (System.err) { 00175 super.printStackTrace(); 00176 System.err.println("Source: "); 00177 getWrappedException().printStackTrace(); 00178 } 00179 } 00180 00187 public void printStackTrace(java.io.PrintStream s) { 00188 synchronized (s) { 00189 super.printStackTrace(s); 00190 s.println("Source: "); 00191 getWrappedException().printStackTrace(s); 00192 } 00193 } 00194 00202 public void printStackTrace(java.io.PrintWriter s) { 00203 synchronized (s) { 00204 super.printStackTrace(s); 00205 s.println("Source: "); 00206 getWrappedException().printStackTrace(s); 00207 } 00208 } 00209 00210 private Exception _wrappedException; 00211 00212 }