1 37 38 package com.sun.j2ee.blueprints.processmanager.transitions; 39 40 41 45 public class TransitionException extends Exception { 46 private Exception exception; 47 48 53 public TransitionException(String message, Exception exception) { 54 super(message); 55 this.exception = exception; 56 return; 57 } 58 59 63 public TransitionException(String message) { 64 this(message, null); 65 return; 66 } 67 68 72 public TransitionException(Exception exception) { 73 this(null, exception); 74 return; 75 } 76 77 82 public Exception getException() { 83 return exception; 84 } 85 86 91 public Exception getRootCause() { 92 if (exception instanceof TransitionException) { 93 return ((TransitionException) exception).getRootCause(); 94 } 95 return exception == null ? this : exception; 96 } 97 98 public String toString() { 99 if (exception instanceof TransitionException) { 100 return ((TransitionException) exception).toString(); 101 } 102 return exception == null ? super.toString() : exception.toString(); 103 } 104 } 105 | Popular Tags |