|
activemq-cpp-3.4.0
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _CMS_XAEXCEPTION_H_ 00019 #define _CMS_XAEXCEPTION_H_ 00020 00021 #include <cms/Config.h> 00022 #include <cms/CMSException.h> 00023 00024 namespace cms { 00025 00032 class CMS_API XAException : CMSException { 00033 private: 00034 00035 int errorCode; 00036 00037 public: 00038 00042 static const int XA_RBBASE; 00043 00047 static const int XA_RBROLLBACK; 00048 00052 static const int XA_RBCOMMFAIL; 00053 00057 static const int XA_RBDEADLOCK; 00058 00063 static const int XA_RBINTEGRITY; 00064 00069 static const int XA_RBOTHER; 00070 00074 static const int XA_RBPROTO; 00075 00079 static const int XA_RBTIMEOUT; 00080 00084 static const int XA_RBTRANSIENT; 00085 00089 static const int XA_RBEND; 00090 00094 static const int XA_NOMIGRATE; 00095 00100 static const int XA_HEURHAZ; 00101 00106 static const int XA_HEURCOM; 00107 00112 static const int XA_HEURRB; 00113 00118 static const int XA_HEURMIX; 00119 00124 static const int XA_RETRY; 00125 00130 static const int XA_RDONLY; 00131 00136 static const int XAER_ASYNC; 00137 00142 static const int XAER_RMERR; 00143 00147 static const int XAER_NOTA; 00148 00152 static const int XAER_INVAL; 00153 00157 static const int XAER_PROTO; 00158 00162 static const int XAER_RMFAIL; 00163 00167 static const int XAER_DUPID; 00168 00173 static const int XAER_OUTSIDE; 00174 00175 public: 00176 00177 XAException(); 00178 00179 XAException( int errorCode ); 00180 00181 XAException( const XAException& ex ); 00182 00183 XAException( const std::string& message ); 00184 00185 XAException( const std::string& message, 00186 const std::exception* cause ); 00187 00188 XAException( const std::string& message, 00189 const std::exception* cause, 00190 const std::vector< std::pair< std::string, int> >& stackTrace ); 00191 00192 virtual ~XAException() throw(); 00193 00194 public: 00195 00202 void setErrorCode( int errorCode ) { 00203 this->errorCode = errorCode; 00204 } 00205 00211 int getErrorCode() const { 00212 return this->errorCode; 00213 } 00214 00215 }; 00216 00217 } 00218 00219 #endif /* _CMS_XAEXCEPTION_H_ */