18 #ifndef _ACTIVEMQ_UTIL_CMSEXCEPTIONSUPPORT_H_ 19 #define _ACTIVEMQ_UTIL_CMSEXCEPTIONSUPPORT_H_ 73 #define AMQ_CATCH_ALL_THROW_CMSEXCEPTION() \ 74 catch (cms::CMSSecurityException& ex) { \ 75 ex.setMark(__FILE__, __LINE__); \ 77 } catch (cms::IllegalStateException& ex) { \ 78 ex.setMark(__FILE__, __LINE__); \ 80 } catch (cms::InvalidClientIdException& ex) { \ 81 ex.setMark(__FILE__, __LINE__); \ 83 } catch (cms::InvalidDestinationException& ex) { \ 84 ex.setMark(__FILE__, __LINE__); \ 86 } catch (cms::InvalidSelectorException& ex) { \ 87 ex.setMark(__FILE__, __LINE__); \ 89 } catch (cms::MessageEOFException& ex) { \ 90 ex.setMark(__FILE__, __LINE__); \ 92 } catch (cms::MessageFormatException& ex) { \ 93 ex.setMark(__FILE__, __LINE__); \ 95 } catch (cms::MessageNotReadableException& ex) { \ 96 ex.setMark(__FILE__, __LINE__); \ 98 } catch (cms::MessageNotWriteableException& ex) { \ 99 ex.setMark(__FILE__, __LINE__); \ 101 } catch (cms::ResourceAllocationException& ex) { \ 102 ex.setMark(__FILE__, __LINE__); \ 104 } catch (cms::TransactionInProgressException& ex) { \ 105 ex.setMark(__FILE__, __LINE__); \ 107 } catch (cms::TransactionRolledBackException& ex) { \ 108 ex.setMark(__FILE__, __LINE__); \ 110 } catch (cms::UnsupportedOperationException& ex) { \ 111 ex.setMark(__FILE__, __LINE__); \ 113 } catch (cms::XAException& ex) { \ 114 ex.setMark(__FILE__, __LINE__); \ 116 } catch (cms::CMSException& ex) { \ 117 ex.setMark(__FILE__, __LINE__); \ 119 } catch (activemq::exceptions::ActiveMQException& ex) { \ 120 if (ex.getCause() != NULL) { \ 121 const std::exception* cause = ex.getCause(); \ 123 const cms::CMSSecurityException* exception = \ 124 dynamic_cast<const cms::CMSSecurityException*>(cause); \ 125 if (exception != NULL) { \ 126 throw cms::CMSSecurityException(*exception); \ 130 const cms::IllegalStateException* exception = \ 131 dynamic_cast<const cms::IllegalStateException*>(cause); \ 132 if (exception != NULL) { \ 133 throw cms::IllegalStateException(*exception); \ 137 const cms::InvalidClientIdException* exception = \ 138 dynamic_cast<const cms::InvalidClientIdException*>(cause); \ 139 if (exception != NULL) { \ 140 throw cms::InvalidClientIdException(*exception); \ 144 const cms::InvalidDestinationException* exception = \ 145 dynamic_cast<const cms::InvalidDestinationException*>(cause); \ 146 if (exception != NULL) { \ 147 throw cms::InvalidDestinationException(*exception); \ 151 const cms::InvalidSelectorException* exception = \ 152 dynamic_cast<const cms::InvalidSelectorException*>(cause); \ 153 if (exception != NULL) { \ 154 throw cms::InvalidSelectorException(*exception); \ 158 const cms::MessageEOFException* exception = \ 159 dynamic_cast<const cms::MessageEOFException*>(cause); \ 160 if (exception != NULL) { \ 161 throw cms::MessageEOFException(*exception); \ 165 const cms::MessageFormatException* exception = \ 166 dynamic_cast<const cms::MessageFormatException*>(cause); \ 167 if (exception != NULL) { \ 168 throw cms::MessageFormatException(*exception); \ 172 const cms::MessageNotReadableException* exception = \ 173 dynamic_cast<const cms::MessageNotReadableException*>(cause); \ 174 if (exception != NULL) { \ 175 throw cms::MessageNotReadableException(*exception); \ 179 const cms::MessageNotWriteableException* exception = \ 180 dynamic_cast<const cms::MessageNotWriteableException*>(cause); \ 181 if (exception != NULL) { \ 182 throw cms::MessageNotWriteableException(*exception); \ 186 const cms::ResourceAllocationException* exception = \ 187 dynamic_cast<const cms::ResourceAllocationException*>(cause); \ 188 if (exception != NULL) { \ 189 throw cms::ResourceAllocationException(*exception); \ 193 const cms::TransactionInProgressException* exception = \ 194 dynamic_cast<const cms::TransactionInProgressException*>(cause); \ 195 if (exception != NULL) { \ 196 throw cms::TransactionInProgressException(*exception); \ 200 const cms::TransactionRolledBackException* exception = \ 201 dynamic_cast<const cms::TransactionRolledBackException*>(cause); \ 202 if (exception != NULL) { \ 203 throw cms::TransactionRolledBackException(*exception); \ 207 const cms::UnsupportedOperationException* exception = \ 208 dynamic_cast<const cms::UnsupportedOperationException*>(cause); \ 209 if (exception != NULL) { \ 210 throw cms::UnsupportedOperationException(*exception); \ 214 const cms::XAException* exception = \ 215 dynamic_cast<const cms::XAException*>(cause); \ 216 if (exception != NULL) { \ 217 throw cms::XAException(*exception); \ 221 const cms::CMSException* exception = \ 222 dynamic_cast<const cms::CMSException*>(cause); \ 223 if (exception != NULL) { \ 224 throw cms::CMSException(*exception); \ 228 ex.setMark(__FILE__, __LINE__); \ 229 throw ex.convertToCMSException(); \ 230 } catch(decaf::lang::Exception& ex){ \ 231 ex.setMark(__FILE__, __LINE__); \ 232 activemq::exceptions::ActiveMQException amqEx(ex); \ 233 throw amqEx.convertToCMSException(); \ 234 } catch(std::exception& ex){ \ 235 throw cms::CMSException(ex.what(), NULL); \ 237 throw cms::CMSException("Caught Unknown Exception", NULL); \
#define AMQCPP_API
Definition: Config.h:30
CMS API Exception that is the base for all exceptions thrown from CMS classes.
Definition: CMSException.h:50
This exception must be thrown when an unexpected end of stream has been reached when a StreamMessage ...
Definition: MessageEOFException.h:32
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Definition: Exception.h:38
Definition: CMSExceptionSupport.h:46