1 8 package org.codehaus.aspectwerkz.aspect.management; 9 10 import java.io.PrintStream ; 11 import java.io.PrintWriter ; 12 13 16 public class NoAspectBoundException extends RuntimeException { 17 18 private String m_message; 19 private Throwable m_throwable; 20 21 public NoAspectBoundException(String message, String aspectName) { 22 m_message = message + " - " + aspectName; 23 } 24 25 public NoAspectBoundException(Throwable t, String aspectName) { 26 m_throwable = t; 27 m_message = t.getMessage(); 28 } 29 30 public String getMessage() { 31 StringBuffer sb = new StringBuffer ("NoAspectBound: "); 32 sb.append(m_message); 33 return sb.toString(); 34 } 35 36 41 public Throwable getCause() { 42 if (m_throwable != null) { 43 return m_throwable; 44 } else { 45 return super.getCause(); 46 } 47 } 48 49 52 public void printStackTrace() { 53 if (m_throwable != null) { 54 m_throwable.printStackTrace(); 55 } else { 56 super.printStackTrace(); 57 } 58 } 59 60 65 public void printStackTrace(final PrintStream s) { 66 if (m_throwable != null) { 67 m_throwable.printStackTrace(s); 68 } else { 69 super.printStackTrace(s); 70 } 71 } 72 73 78 public void printStackTrace(final PrintWriter s) { 79 if (m_throwable != null) { 80 m_throwable.printStackTrace(s); 81 } else { 82 super.printStackTrace(s); 83 } 84 } 85 86 } 87 | Popular Tags |