001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ChartingException.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package org.openesb.tools.charting.exception;
030:
031: /**
032: *
033: * @author rdwivedi
034: */
035:
036: public class ChartingException extends Exception {
037:
038: private Throwable mRootCause;
039:
040: /**
041: * Constructor to create a new instance for this class. This method is
042: * included here for the purpose of loading only.
043: */
044: public ChartingException() {
045: }
046:
047: /**
048: * Constructor creates a new instance of EBAMServerException
049: *
050: * @param message is the message of this exception
051: */
052: public ChartingException(String message) {
053: super (message);
054: }
055:
056: /**
057: * Constructs a new instance of EBAMServerException
058: * @param logCategory signifies exceptions originating class of generation
059: * @param message contains the message of the exception
060: */
061: public ChartingException(String logCategory, String message) {
062: super (logCategory + "-" + message);
063: }
064:
065: /**
066: * Constructs a new instance of EBAMServerException
067: * @param message is the message of this exception.
068: * @param cause is the cause of this exception.
069: *
070: */
071: public ChartingException(String message, Throwable cause) {
072: super (message);
073: mRootCause = cause;
074: }
075:
076: /**
077: * Constructor creates a new instance of this class
078: *
079: * @param cause represents the cause of this exception.
080: */
081: public ChartingException(Throwable cause) {
082: super (cause.toString());
083: mRootCause = cause;
084: }
085:
086: /**
087: * Method toString returns the description of this exception.
088: *
089: * @return String description of the exception
090: */
091: public String toString() {
092:
093: String string = this .getMessage();
094:
095: if (null != mRootCause) {
096: string += " - Root Cause: " + mRootCause.toString();
097: }
098: return string;
099: }
100:
101: }
|