1 4 package com.tc.aspectwerkz.aspect.management; 5 6 import java.io.PrintStream ; 7 import java.io.PrintWriter ; 8 9 12 public class NoAspectBoundException extends RuntimeException { 13 14 private String m_message; 15 private Throwable m_throwable; 16 17 public NoAspectBoundException(String message, String aspectName) { 18 m_message = message + " - " + aspectName; 19 } 20 21 public NoAspectBoundException(Throwable t, String aspectName) { 22 m_throwable = t; 23 m_message = t.getMessage(); 24 } 25 26 public String getMessage() { 27 StringBuffer sb = new StringBuffer ("NoAspectBound: "); 28 sb.append(m_message); 29 return sb.toString(); 30 } 31 32 37 public Throwable getCause() { 38 if (m_throwable != null) { 39 return m_throwable; 40 } else { 41 return super.getCause(); 42 } 43 } 44 45 48 public void printStackTrace() { 49 if (m_throwable != null) { 50 m_throwable.printStackTrace(); 51 } else { 52 super.printStackTrace(); 53 } 54 } 55 56 61 public void printStackTrace(final PrintStream s) { 62 if (m_throwable != null) { 63 m_throwable.printStackTrace(s); 64 } else { 65 super.printStackTrace(s); 66 } 67 } 68 69 74 public void printStackTrace(final PrintWriter s) { 75 if (m_throwable != null) { 76 m_throwable.printStackTrace(s); 77 } else { 78 super.printStackTrace(s); 79 } 80 } 81 82 } 83 | Popular Tags |