org.apache.geronimo.common
public class: DeploymentException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.geronimo.common.DeploymentException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UnresolvedReferenceException, AmbiguousEJBRefException, CleanseException, UnresolvedEJBRefException, UnknownEJBRefException, DeploymentSyntaxException
- version:
$
- Rev: 556119 $ $Date: 2007-07-13 12:34:02 -0700 (Fri, 13 Jul 2007) $
Methods from java.lang.Throwable: |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.geronimo.common.DeploymentException Detail: |
public DeploymentException cleanse() {
if(null != getCause()) {
return cleanse(this);
}
if (causes != null) {
List< CleanseException > cleansedCauses = new ArrayList< CleanseException >(causes.size());
for (Throwable cause: causes) {
CleanseException cleansed = cleanse(cause);
cleansedCauses.add(cleansed);
}
return new DeploymentException(getMessage(), cleansedCauses);
}
return this;
}
|
protected static CleanseException cleanse(Throwable root) {
CleanseException previousEx = null;
CleanseException rootEx = null;
while (null != root) {
Throwable e = root.getCause();
CleanseException exception = new CleanseException(root.getMessage(), root.toString());
if (null == rootEx) {
rootEx = exception;
}
exception.setStackTrace(root.getStackTrace());
if (null != previousEx) {
previousEx.initCause(exception);
}
previousEx = exception;
root = e;
}
return rootEx;
}
|
public void printStackTrace(PrintStream ps) {
super.printStackTrace(ps);
if (causes != null) {
for (Throwable cause: causes) {
//TODO trim duplicate stack trace elements
cause.printStackTrace(ps);
}
}
}
|
public void printStackTrace(PrintWriter pw) {
super.printStackTrace(pw);
if (causes != null) {
for (Throwable cause: causes) {
//TODO trim duplicate stack trace elements
cause.printStackTrace(pw);
}
}
}
|