activemq-cpp-3.8.2
XAException.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _CMS_XAEXCEPTION_H_
19 #define _CMS_XAEXCEPTION_H_
20 
21 #include <cms/Config.h>
22 #include <cms/CMSException.h>
23 
24 namespace cms {
25 
32  class CMS_API XAException : public CMSException {
33  private:
34 
35  int errorCode;
36 
37  public:
38 
42  static const int XA_RBBASE;
43 
47  static const int XA_RBROLLBACK;
48 
52  static const int XA_RBCOMMFAIL;
53 
57  static const int XA_RBDEADLOCK;
58 
63  static const int XA_RBINTEGRITY;
64 
69  static const int XA_RBOTHER;
70 
74  static const int XA_RBPROTO;
75 
79  static const int XA_RBTIMEOUT;
80 
84  static const int XA_RBTRANSIENT;
85 
89  static const int XA_RBEND;
90 
94  static const int XA_NOMIGRATE;
95 
100  static const int XA_HEURHAZ;
101 
106  static const int XA_HEURCOM;
107 
112  static const int XA_HEURRB;
113 
118  static const int XA_HEURMIX;
119 
124  static const int XA_RETRY;
125 
130  static const int XA_RDONLY;
131 
136  static const int XAER_ASYNC;
137 
142  static const int XAER_RMERR;
143 
147  static const int XAER_NOTA;
148 
152  static const int XAER_INVAL;
153 
157  static const int XAER_PROTO;
158 
162  static const int XAER_RMFAIL;
163 
167  static const int XAER_DUPID;
168 
173  static const int XAER_OUTSIDE;
174 
175  public:
176 
177  XAException();
178 
179  XAException(int errorCode);
180 
181  XAException(const XAException& ex);
182 
183  XAException(const std::string& message);
184 
185  XAException(const std::string& message, const std::exception* cause);
186 
187  XAException(const std::string& message, const std::exception* cause,
188  const std::vector<std::pair<std::string, int> >& stackTrace);
189 
190  virtual ~XAException() throw();
191 
192  virtual XAException* clone();
193 
194  public:
195 
202  void setErrorCode(int errorCode) {
203  this->errorCode = errorCode;
204  }
205 
211  int getErrorCode() const {
212  return this->errorCode;
213  }
214 
215  };
216 
217 }
218 
219 #endif /* _CMS_XAEXCEPTION_H_ */
static const int XA_RBDEADLOCK
Code which means that a failure occurred because a deadlock was detected.
Definition: XAException.h:57
static const int XAER_RMFAIL
Code which means that the Resource Manager is unavailable.
Definition: XAException.h:162
static const int XA_RDONLY
Code which means that the transaction branch was read only and has been committed.
Definition: XAException.h:130
static const int XA_HEURHAZ
Code which means that the transaction branch may have been heuristically completed.
Definition: XAException.h:100
static const int XAER_ASYNC
Code which means that there is already an asynchronous operation outstanding.
Definition: XAException.h:136
static const int XA_RBROLLBACK
Code which means that the rollback occurred for an unspecified reason.
Definition: XAException.h:47
#define CMS_API
Definition: Config.h:31
static const int XA_HEURRB
Code which means that the transaction branch has been heuristically rolled back.
Definition: XAException.h:112
The XAException is thrown by the Resource Manager (RM) to inform the Transaction Manager of an error ...
Definition: XAException.h:32
static const int XAER_RMERR
Code which means that a Resource Manager error has occurred for the transaction branch.
Definition: XAException.h:142
static const int XA_NOMIGRATE
Code which means that resumption must occur where the suspension occurred.
Definition: XAException.h:94
static const int XA_RBEND
Code which contains the inclusive upper bound of the rollback error codes.
Definition: XAException.h:89
static const int XAER_NOTA
Code which means that the XID is not valid.
Definition: XAException.h:147
static const int XA_RBTRANSIENT
Code which means that the caller may retry the transaction branch.
Definition: XAException.h:84
CMS API Exception that is the base for all exceptions thrown from CMS classes.
Definition: CMSException.h:50
static const int XA_RBCOMMFAIL
Code which means that rollback was caused by a communication failure.
Definition: XAException.h:52
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: DestinationResolver.h:23
static const int XAER_PROTO
Code which means that the method was invoked in an improper context.
Definition: XAException.h:157
static const int XA_RBINTEGRITY
Code which means that a condition was detected than implies a violation of the integrity of the resou...
Definition: XAException.h:63
static const int XA_HEURCOM
Code which means that the transaction branch has been heuristically committed.
Definition: XAException.h:106
static const int XA_RBTIMEOUT
Code which means that a transaction branch took too long.
Definition: XAException.h:79
static const int XA_HEURMIX
Code which means that the transaction branch has been heuristically committed and rolled back...
Definition: XAException.h:118
static const int XAER_OUTSIDE
Work is being done by the Resource Manager outside the boundaries of a global transaction.
Definition: XAException.h:173
static const int XA_RETRY
Code which means that the method returned with no effect and can be reissued.
Definition: XAException.h:124
static const int XA_RBPROTO
Code which means that a protocol error occurred in the Resource Manager.
Definition: XAException.h:74
int getErrorCode() const
Gets the error code that was assigned to this XAException.
Definition: XAException.h:211
static const int XA_RBOTHER
Code which means that the Resource Manager rolled back the transaction branch for a reason not separa...
Definition: XAException.h:69
static const int XAER_DUPID
Code which means that the XID already exists.
Definition: XAException.h:167
static const int XA_RBBASE
Code which contains the inclusive lower bound of the rollback error codes.
Definition: XAException.h:42
static const int XAER_INVAL
Code which means that invalid arguments were supplied.
Definition: XAException.h:152