001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common;
009:
010: //base classes
011: import java.io.PrintStream;
012: import java.io.PrintWriter;
013:
014: //project specific classes
015:
016: //other classes
017:
018: public class UnexpectedSystemException extends RuntimeException {
019:
020: // OLD MESSAGE
021: //
022: // JFolder, the OpenSource Workflow Server
023: //
024: // Distributable under LGPL license.
025: // See terms of license at gnu.org.
026: //
027:
028: private Exception exception;
029: private String message;
030:
031: public UnexpectedSystemException(String inMessage) {
032: //super(inMessage);
033: super (inMessage);
034: //
035: this .message = inMessage;
036: //
037: localPrintAll();
038: }
039:
040: public UnexpectedSystemException(String inMessage,
041: Exception inException) {
042: //super(inMessage, inException);
043: super (inMessage, inException);
044: //
045: this .message = inMessage;
046: this .exception = inException;
047: //
048: localPrintAll();
049: }
050:
051: public UnexpectedSystemException(Exception inException) {
052: //super(inException);
053: super (inException);
054: //
055: this .exception = inException;
056: //
057: localPrintAll();
058: }
059:
060: private void localPrintAll() {
061: //this.printStackTrace();
062: //if (this.exception != null) {
063: // this.exception.printStackTrace();
064: //}
065: }
066:
067: public final static UnexpectedSystemException unknownState() {
068: return new UnexpectedSystemException("Unknown State");
069: }
070:
071: public final static UnexpectedSystemException notImplemented() {
072: return new UnexpectedSystemException("Not Implemented");
073: }
074:
075: /*
076: public String getMessage() {
077:
078: StringBuffer outValue = new StringBuffer();
079:
080: //
081: if (this.message != null) {
082: outValue.append(this.message);
083: }
084: //
085: if (this.exception != null) {
086: outValue.append(" (");
087: outValue.append(this.exception.getMessage());
088: outValue.append(")");
089: //outValue = outValue + + + ;
090: }
091:
092: return outValue.toString();
093: }
094:
095: public void printStackTrace() {
096: super.printStackTrace();
097: if (this.exception != null) {
098: this.exception.printStackTrace();
099: }
100: }
101:
102: public void printStackTrace(PrintStream inPs) {
103: super.printStackTrace(inPs);
104: if (this.exception != null) {
105: this.exception.printStackTrace(inPs);
106: }
107: }
108:
109: public void printStackTrace(PrintWriter inPs) {
110: super.printStackTrace(inPs);
111: if (this.exception != null) {
112: this.exception.printStackTrace(inPs);
113: }
114: }
115: //
116: public StackTraceElement[] getStackTrace() {
117:
118: StackTraceElement outValue[] = super.getStackTrace();
119:
120: return outValue;
121: }
122: */
123: }
|