UnexpectedSystemException.java :  » Workflow-Engines » JFolder » org » jfolder » common » Java Open Source

Java Open Source » Workflow Engines » JFolder 
JFolder » org » jfolder » common » UnexpectedSystemException.java
/*
 * JFolder, Copyright 2001-2006 Gary Steinmetz
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package org.jfolder.common;

//base classes
import java.io.PrintStream;
import java.io.PrintWriter;

//project specific classes

//other classes

public class UnexpectedSystemException extends RuntimeException {
    
    //  OLD MESSAGE
    //
    //  JFolder, the OpenSource Workflow Server
    // 
    //  Distributable under LGPL license.
    //  See terms of license at gnu.org.
    // 
    
    private Exception exception;
    private String message;
    
    public UnexpectedSystemException(String inMessage) {
        //super(inMessage);
        super(inMessage);
        //
        this.message = inMessage;
        //
        localPrintAll();
    }
    
    public UnexpectedSystemException(String inMessage, Exception inException) {
        //super(inMessage, inException);
        super(inMessage, inException);
        //
        this.message = inMessage;
        this.exception = inException;
        //
        localPrintAll();
    }
    
    public UnexpectedSystemException(Exception inException) {
        //super(inException);
        super(inException);
        //
        this.exception = inException;
        //
        localPrintAll();
    }
    
    private void localPrintAll() {
        //this.printStackTrace();
        //if (this.exception != null) {
        //    this.exception.printStackTrace();
        //}
    }
    
    public final static UnexpectedSystemException unknownState() {
        return new UnexpectedSystemException("Unknown State");
    }
    
    public final static UnexpectedSystemException notImplemented() {
        return new UnexpectedSystemException("Not Implemented");
    }
    
    /*
    public String getMessage() {
        
        StringBuffer outValue = new StringBuffer();
        
        //
        if (this.message != null) {
            outValue.append(this.message);
        }
        //
        if (this.exception != null) {
            outValue.append(" (");
            outValue.append(this.exception.getMessage());
            outValue.append(")");
            //outValue = outValue +  +  + ;
        }
        
        return outValue.toString();
    }
    
    public void printStackTrace() {
        super.printStackTrace();
        if (this.exception != null) {
            this.exception.printStackTrace();
        }
    }
    
    public void printStackTrace(PrintStream inPs) {
        super.printStackTrace(inPs);
        if (this.exception != null) {
            this.exception.printStackTrace(inPs);
        }
    }
    
    public void printStackTrace(PrintWriter inPs) {
        super.printStackTrace(inPs);
        if (this.exception != null) {
            this.exception.printStackTrace(inPs);
        }
    }
    //
    public StackTraceElement[] getStackTrace() {
        
        StackTraceElement outValue[] = super.getStackTrace();
        
        return outValue;
    }
    */
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.