1 28 29 package com.caucho.security; 30 31 import com.caucho.util.ExceptionWrapper; 32 33 import java.io.Serializable ; 34 35 38 public class SecurityContextException extends Exception 39 implements ExceptionWrapper, Serializable { 40 private Throwable rootCause; 41 42 45 public SecurityContextException() 46 { 47 } 48 53 public SecurityContextException(String msg) 54 { 55 super(msg); 56 } 57 58 63 public SecurityContextException(Throwable rootCause) 64 { 65 super(rootCause.getMessage()); 66 67 this.rootCause = rootCause; 68 } 69 70 76 public SecurityContextException(String message, Throwable rootCause) 77 { 78 super(message); 79 80 this.rootCause = rootCause; 81 } 82 83 88 public Throwable getRootCause() 89 { 90 return rootCause; 91 } 92 93 96 public String getMessage() 97 { 98 if (rootCause != null) 99 return rootCause.getMessage(); 100 else 101 return super.getMessage(); 102 } 103 104 107 public String toString() 108 { 109 if (rootCause == null) 110 return super.toString(); 111 else 112 return getClass().getName() + ": " + rootCause; 113 } 114 } 115 116 | Popular Tags |