1 22 package org.jboss.test.util.ejb; 23 24 import java.io.PrintStream ; 25 import java.io.PrintWriter ; 26 import java.io.StringWriter ; 27 28 41 public class RemoteTestException extends Exception 42 { 43 private Throwable remoteThrowable; 44 private String remoteStackTrace; 45 46 51 public RemoteTestException(Throwable e) 52 { 53 remoteThrowable = e; 54 55 StringWriter stringWriter = new StringWriter (); 56 PrintWriter writer = new PrintWriter (stringWriter); 57 e.printStackTrace(writer); 58 StringBuffer buffer = stringWriter.getBuffer(); 59 remoteStackTrace = buffer.toString(); 60 } 61 62 66 public String getMessage() 67 { 68 return remoteThrowable.getMessage(); 69 } 70 71 75 public void printStackTrace(java.io.PrintStream ps) 76 { 77 ps.print(remoteStackTrace); 78 } 79 80 83 public void printStackTrace() 84 { 85 printStackTrace(System.err); 86 } 87 88 92 public void printStackTrace(java.io.PrintWriter pw) 93 { 94 pw.print(remoteStackTrace); 95 } 96 97 105 public Throwable getRemoteThrowable() 106 { 107 return remoteThrowable; 108 } 109 110 114 public String getRemoteStackTrace() 115 { 116 return remoteStackTrace; 117 } 118 } 119 | Popular Tags |