diff options
| author | Alan Conway <aconway@apache.org> | 2008-09-09 14:06:07 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-09-09 14:06:07 +0000 |
| commit | 833cf68a5bf58e882f377d144768ceb546e5e036 (patch) | |
| tree | 8b2ca57e790956a38c33583970a5c4198b407073 /cpp/src/qpid/broker/SessionAdapter.cpp | |
| parent | 7feb5546e82e0d003f26027524ceb07e9b9b0452 (diff) | |
| download | qpid-python-833cf68a5bf58e882f377d144768ceb546e5e036.tar.gz | |
Generate c++ enum types for AMQP enums in framing/enum.h.
Modified enum scheme to avoid name clashes: namespace amqp_class { EnumName { ENUM_NAME_X=1, ENUM_NAME_X=2 ...}};
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@693465 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionAdapter.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SessionAdapter.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index 9ab2c3a75e..003e206bff 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -22,7 +22,7 @@ #include "Queue.h" #include "qpid/Exception.h" #include "qpid/framing/reply_exceptions.h" -#include "qpid/framing/constants.h" +#include "qpid/framing/enum.h" #include "qpid/log/Statement.h" #include "qpid/amqp_0_10/exceptions.h" #include "qpid/framing/SequenceSet.h" @@ -35,6 +35,7 @@ namespace broker { using namespace qpid; using namespace qpid::framing; +using namespace qpid::framing::dtx; typedef std::vector<Queue::shared_ptr> QueueVector; @@ -595,7 +596,7 @@ XaResult SessionAdapter::DtxHandlerImpl::end(const Xid& xid, if (suspend) { throw CommandInvalidException(QPID_MSG("End and suspend cannot both be set.")); } else { - return XaResult(XA_RBROLLBACK); + return XaResult(XA_STATUS_XA_RBROLLBACK); } } else { if (suspend) { @@ -603,10 +604,10 @@ XaResult SessionAdapter::DtxHandlerImpl::end(const Xid& xid, } else { state.endDtx(convert(xid), false); } - return XaResult(XA_OK); + return XaResult(XA_STATUS_XA_OK); } } catch (const DtxTimeoutException& e) { - return XaResult(XA_RBTIMEOUT); + return XaResult(XA_STATUS_XA_RBTIMEOUT); } } @@ -623,9 +624,9 @@ XaResult SessionAdapter::DtxHandlerImpl::start(const Xid& xid, } else { state.startDtx(convert(xid), getBroker().getDtxManager(), join); } - return XaResult(XA_OK); + return XaResult(XA_STATUS_XA_OK); } catch (const DtxTimeoutException& e) { - return XaResult(XA_RBTIMEOUT); + return XaResult(XA_STATUS_XA_RBTIMEOUT); } } @@ -633,9 +634,9 @@ XaResult SessionAdapter::DtxHandlerImpl::prepare(const Xid& xid) { try { bool ok = getBroker().getDtxManager().prepare(convert(xid)); - return XaResult(ok ? XA_OK : XA_RBROLLBACK); + return XaResult(ok ? XA_STATUS_XA_OK : XA_STATUS_XA_RBROLLBACK); } catch (const DtxTimeoutException& e) { - return XaResult(XA_RBTIMEOUT); + return XaResult(XA_STATUS_XA_RBTIMEOUT); } } @@ -644,9 +645,9 @@ XaResult SessionAdapter::DtxHandlerImpl::commit(const Xid& xid, { try { bool ok = getBroker().getDtxManager().commit(convert(xid), onePhase); - return XaResult(ok ? XA_OK : XA_RBROLLBACK); + return XaResult(ok ? XA_STATUS_XA_OK : XA_STATUS_XA_RBROLLBACK); } catch (const DtxTimeoutException& e) { - return XaResult(XA_RBTIMEOUT); + return XaResult(XA_STATUS_XA_RBTIMEOUT); } } @@ -655,9 +656,9 @@ XaResult SessionAdapter::DtxHandlerImpl::rollback(const Xid& xid) { try { getBroker().getDtxManager().rollback(convert(xid)); - return XaResult(XA_OK); + return XaResult(XA_STATUS_XA_OK); } catch (const DtxTimeoutException& e) { - return XaResult(XA_RBTIMEOUT); + return XaResult(XA_STATUS_XA_RBTIMEOUT); } } |
