diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2012-07-16 17:40:50 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2012-07-16 17:40:50 +0000 |
| commit | a1cd362e33db2ff358470aa1b6fc52a06fb1d278 (patch) | |
| tree | 06fe956081747b63b39320193b5d5dfd903bb7fa /java/common | |
| parent | 96221fd672a912a37b13f3d7ac18c66ef5609364 (diff) | |
| download | qpid-python-a1cd362e33db2ff358470aa1b6fc52a06fb1d278.tar.gz | |
QPID-3575 SessionExceptions (0-10 code path) are now marked as soft
errors. When a Session receives an exception it is closed and the
exception is notified via the ConnectionListener as well. However the
exception is marked as a soft-error, therefore the connection will not
be closed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1362161 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common')
| -rw-r--r-- | java/common/src/main/java/org/apache/qpid/AMQException.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/AMQException.java b/java/common/src/main/java/org/apache/qpid/AMQException.java index 86d439d269..2d54e35191 100644 --- a/java/common/src/main/java/org/apache/qpid/AMQException.java +++ b/java/common/src/main/java/org/apache/qpid/AMQException.java @@ -40,6 +40,8 @@ public class AMQException extends Exception /** Holds the AMQ error code constant associated with this exception. */ private AMQConstant _errorCode; + private boolean _isHardError; + /** * Creates an exception with an optional error code, optional message and optional underlying cause. * @@ -49,8 +51,24 @@ public class AMQException extends Exception */ public AMQException(AMQConstant errorCode, String msg, Throwable cause) { + // isHardError is defaulted to true to avoid unnessacery modification to + // existing code. + this(errorCode,true,msg,cause); + } + + /** + * Creates an exception with an optional error code, optional message and optional underlying cause. + * + * @param errorCode The error code. May be null if not to be set. + * @param isHardError Denotes if the underlying error is considered a hard error. + * @param msg The exception message. May be null if not to be set. + * @param cause The underlying cause of the exception. May be null if not to be set. + */ + public AMQException(AMQConstant errorCode, boolean isHardError, String msg, Throwable cause) + { super(((msg == null) ? "" : msg), cause); _errorCode = errorCode; + _isHardError = isHardError; } /* @@ -92,7 +110,7 @@ public class AMQException extends Exception public boolean isHardError() { - return true; + return _isHardError; } /** |
