|
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 _ACTIVEMQ_COMMANDS_BROKERERROR_H_ 00019 #define _ACTIVEMQ_COMMANDS_BROKERERROR_H_ 00020 00021 #include <activemq/util/Config.h> 00022 #include <activemq/commands/BaseCommand.h> 00023 #include <decaf/lang/exceptions/NullPointerException.h> 00024 #include <decaf/lang/Pointer.h> 00025 00026 #include <string> 00027 #include <vector> 00028 00029 namespace activemq{ 00030 namespace commands{ 00031 00036 class AMQCPP_API BrokerError : public BaseCommand { 00037 public: 00038 00039 struct StackTraceElement 00040 { 00041 std::string ClassName; 00042 std::string FileName; 00043 std::string MethodName; 00044 int LineNumber; 00045 00046 StackTraceElement() : ClassName(), FileName(), MethodName(), LineNumber() {} 00047 }; 00048 00049 private: 00050 00051 std::string message; 00052 std::string exceptionClass; 00053 std::vector< decaf::lang::Pointer<StackTraceElement> > stackTraceElements; 00054 decaf::lang::Pointer<BrokerError> cause; 00055 00056 public: 00057 00058 BrokerError(); 00059 00060 virtual ~BrokerError(); 00061 00066 virtual unsigned char getDataStructureType() const { 00067 return 0; 00068 } 00069 00075 virtual BrokerError* cloneDataStructure() const { 00076 00077 BrokerError* error = new BrokerError(); 00078 error->copyDataStructure( this ); 00079 return error; 00080 } 00081 00087 virtual void copyDataStructure( const DataStructure* src ); 00088 00096 virtual decaf::lang::Pointer<commands::Command> visit( 00097 activemq::state::CommandVisitor* visitor ); 00098 00103 virtual const std::string& getMessage() const { 00104 return message; 00105 } 00106 00111 virtual void setMessage( const std::string& message ) { 00112 this->message = message; 00113 } 00114 00119 virtual const std::string& getExceptionClass() const { 00120 return exceptionClass; 00121 } 00122 00127 virtual void setExceptionClass( const std::string& exceptionClass ) { 00128 this->exceptionClass = exceptionClass; 00129 } 00130 00135 virtual const decaf::lang::Pointer<BrokerError>& getCause() const { 00136 return cause; 00137 } 00138 00143 virtual void setCause( const decaf::lang::Pointer<BrokerError>& cause ) { 00144 this->cause = cause; 00145 } 00146 00151 virtual const std::vector< decaf::lang::Pointer<StackTraceElement> >& getStackTraceElements() const { 00152 return stackTraceElements; 00153 } 00154 00159 virtual void setStackTraceElements( const std::vector< decaf::lang::Pointer<StackTraceElement> >& stackTraceElements ) { 00160 this->stackTraceElements = stackTraceElements; 00161 } 00162 00163 }; 00164 00165 }} 00166 00167 #endif /*_ACTIVEMQ_COMMANDS_BROKERERROR_H_*/