【Java开源代码栏目提醒】:网学会员在Java开源代码频道为大家收集整理了BaseException.java提供大家参考,希望对大家有所帮助!
/*
* Created on 2003-10-15
*/
package jaoso.framework.exception;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author xiongj
*/
public class BaseException extends Exception {
//~ Instance fields ========================================================
/** DOCUMENT ME! */
private Log log = LogFactory.getLog(getClass());
/** DOCUMENT ME! */
private Throwable rootCause;
//~ Constructors ===========================================================
/**
*
*/
public BaseException() {
super();
}
/**
* @param s
*/
public BaseException(String s) {
this(s, null);
rootCause = this;
}
/**
* Creates a new BaseException object.
*
* @param s DOCUMENT ME!
* @param e DOCUMENT ME!
*/
public BaseException(String s, Throwable e) {
super(s);
if (e instanceof BaseException) {
rootCause = ((BaseException) e).rootCause;
} else {
rootCause = e;
}
log.info(s, e);
}
/**
* Creates a new BaseException object.
*
* @param e DOCUMENT ME!
*/
public BaseException(Throwable e) {
this("", e);
}
//~ Methods ================================================================
/**
* @return
*/
public Throwable getRootCause() {
return rootCause;
}
}
上一篇:
BaseDBComponent.java
下一篇:
4种小菜缓解孕妈咪不适