1 17 18 package org.sape.carbon.core.exception; 19 20 21 import org.sape.carbon.core.util.classify.SeverityEnum; 22 23 41 public abstract class BaseRuntimeException 42 extends RuntimeException 43 implements Exceptionable { 44 45 49 protected ExceptionDelegate delegatedException; 50 51 57 public BaseRuntimeException(Class sourceClass, String message) { 58 59 super(message); 60 this.delegatedException = 61 ExceptionDelegateFactory.getInstance().createDelegate( 62 sourceClass, this.getSeverity(), this, message, null); 63 this.delegatedException.handleException(); 64 } 65 66 75 public BaseRuntimeException( 76 Class sourceClass, 77 String message, 78 Throwable cause) { 79 80 super(message); 81 82 this.delegatedException = 83 ExceptionDelegateFactory.getInstance().createDelegate( 84 sourceClass, this.getSeverity(), this, message, cause); 85 this.delegatedException.handleException(); 86 } 87 88 93 public abstract SeverityEnum getSeverity(); 94 95 101 public Class getExceptionSource() { 102 return this.delegatedException.getExceptionSource(); 103 } 104 105 109 public Throwable getCause() { 110 return this.delegatedException.getCause(); 111 } 112 113 117 public String toString() { 118 return this.delegatedException.toString(); 119 } 120 121 125 public String getMessage() { 126 return this.delegatedException.getMessage(); 127 } 128 129 134 135 } | Popular Tags |