1 23 24 29 30 package com.sun.ejb.containers.util.pool; 31 32 import java.io.PrintStream ; 33 import java.io.PrintWriter ; 34 35 public class PoolException 36 extends RuntimeException 37 { 38 Throwable throwable = null; 39 40 public PoolException() { 41 super(); 42 } 43 44 public PoolException(String message) { 45 super(message); 46 } 47 48 public PoolException(String message, Throwable throwable) { 49 super(message); 50 this.throwable = throwable; 51 } 52 53 public Throwable getThrowable() { 54 return this.throwable; 55 } 56 57 public void printStackTrace() { 58 printStackTrace(new PrintWriter (System.err)); 59 } 60 61 public void printStackTrace(PrintStream ps) { 62 printStackTrace(new PrintWriter (ps)); 63 } 64 65 public void printStackTrace(PrintWriter pw) { 66 if (throwable != null) { 67 pw.println("PoolException: " + getMessage()); 68 throwable.printStackTrace(pw); 69 } else { 70 super.printStackTrace(pw); 71 } 72 } 73 74 } 75 | Popular Tags |