diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-21 07:55:20 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-21 07:55:20 +0000 |
commit | 36436b71b9977d6b5940cb6285d5335708ef9bfa (patch) | |
tree | b218a104f180c67690a6ae2ad097cd9306a8f203 /tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java | |
parent | d5be76c0b31df9b5d203295b146b13d2205243de (diff) |
Moving 1.x tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882851 13f79535-47bb-0310-9956-ffa450edef68
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(); - - } - -} |