1 45 package org.exolab.jms.net.proxy; 46 47 import java.io.PrintStream ; 48 import java.io.PrintWriter ; 49 50 51 59 public class RemoteInvocationException extends RuntimeException { 60 61 64 private Throwable _target; 65 66 69 private static final long serialVersionUID = 1L; 70 71 72 75 public RemoteInvocationException() { 76 } 77 78 84 public RemoteInvocationException(String detail) { 85 super(detail); 86 } 87 88 94 public RemoteInvocationException(Throwable target) { 95 _target = target; 96 } 97 98 105 public RemoteInvocationException(String detail, Throwable target) { 106 super(detail); 107 _target = target; 108 } 109 110 115 public Throwable getTargetException() { 116 return _target; 117 } 118 119 125 public void printStackTrace(PrintStream stream) { 126 synchronized (stream) { 127 if (_target != null) { 128 stream.print(getClass().getName() + ": "); 129 _target.printStackTrace(stream); 130 } else { 131 super.printStackTrace(stream); 132 } 133 } 134 } 135 136 142 public void printStackTrace(PrintWriter writer) { 143 synchronized (writer) { 144 if (_target != null) { 145 writer.print(getClass().getName() + ": "); 146 _target.printStackTrace(writer); 147 } else { 148 super.printStackTrace(writer); 149 } 150 } 151 } 152 153 } 154 | Popular Tags |