diff options
Diffstat (limited to 'tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java')
-rw-r--r-- | tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java deleted file mode 100644 index 922705f7b5..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.apache.tuscany.common; - -import java.util.ArrayList; -import java.util.List; - -/** - * The root unchecked exception for the Tuscany runtime - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ - -public abstract class TuscanyRuntimeException extends RuntimeException { - - protected List<String> contextStack; - - protected String moduleComponentName; - - protected String componentName; - - public TuscanyRuntimeException() { - super(); - } - - public TuscanyRuntimeException(String message) { - super(message); - } - - public TuscanyRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public TuscanyRuntimeException(Throwable cause) { - super(cause); - } - - /** - * Returns a collection of names representing the context call stack where the error occured. The top of the stack - * is the first element in the collection. - */ - public List<String> returnContextNames(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - return contextStack; - } - - /** - * Pushes a context name where an error occured onto the call stack - */ - public void addContextName(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - contextStack.add(name); - } - - private String identifier; - - /** - * Returns a string representing additional error information referred to in the error message - */ - public String getIdentifier() { - return identifier; - } - - /** - * Sets an additional error information referred to in the error message - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getMessage() { - if (identifier == null && contextStack == null) { - return super.getMessage(); - } - StringBuffer b = new StringBuffer(); - if (identifier != null) { - b.append(" [" + identifier + "]"); - } - if (contextStack != null) { - b.append("\nContext stack trace: "); - for (int i = contextStack.size() - 1; i >= 0; i--) { - b.append("[" + contextStack.get(i) + "]"); - } - } - return super.getMessage() + b.toString(); - - } - -} |