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 <activemq/exceptions/ActiveMQException.h> 00024 #include <decaf/lang/Pointer.h> 00025 00026 #include <string> 00027 #include <vector> 00028 00029 namespace activemq { 00030 namespace commands { 00031 00037 class AMQCPP_API BrokerError : public BaseCommand { 00038 public: 00039 00040 struct StackTraceElement 00041 { 00042 std::string ClassName; 00043 std::string FileName; 00044 std::string MethodName; 00045 int LineNumber; 00046 00047 StackTraceElement() : ClassName(), FileName(), MethodName(), LineNumber() {} 00048 }; 00049 00050 private: 00051 00052 std::string message; 00053 std::string exceptionClass; 00054 std::vector< decaf::lang::Pointer<StackTraceElement> > stackTraceElements; 00055 decaf::lang::Pointer<BrokerError> cause; 00056 decaf::lang::Pointer<decaf::lang::Exception> exCause; 00057 00058 public: 00059 00060 BrokerError(); 00061 00062 BrokerError(decaf::lang::Pointer<decaf::lang::Exception> exCause); 00063 00064 virtual ~BrokerError(); 00065 00070 virtual unsigned char getDataStructureType() const { 00071 return 0; 00072 } 00073 00079 virtual BrokerError* cloneDataStructure() const { 00080 BrokerError* error = new BrokerError(); 00081 error->copyDataStructure( this ); 00082 return error; 00083 } 00084 00090 virtual void copyDataStructure(const DataStructure* src); 00091 00099 virtual decaf::lang::Pointer<commands::Command> visit(activemq::state::CommandVisitor* visitor); 00100 00105 virtual const std::string& getMessage() const { 00106 return message; 00107 } 00108 00113 virtual void setMessage(const std::string& message) { 00114 this->message = message; 00115 } 00116 00121 virtual const std::string& getExceptionClass() const { 00122 return exceptionClass; 00123 } 00124 00129 virtual void setExceptionClass(const std::string& exceptionClass) { 00130 this->exceptionClass = exceptionClass; 00131 } 00132 00137 virtual const decaf::lang::Pointer<BrokerError>& getCause() const { 00138 return cause; 00139 } 00140 00145 virtual void setCause(const decaf::lang::Pointer<BrokerError>& cause) { 00146 this->cause = cause; 00147 } 00148 00153 virtual const std::vector<decaf::lang::Pointer<StackTraceElement> >& getStackTraceElements() const { 00154 return stackTraceElements; 00155 } 00156 00161 virtual void setStackTraceElements(const std::vector<decaf::lang::Pointer<StackTraceElement> >& stackTraceElements) { 00162 this->stackTraceElements = stackTraceElements; 00163 } 00164 00168 decaf::lang::Pointer<decaf::lang::Exception> getLocalException() const { 00169 return this->exCause; 00170 } 00171 00178 void setLocalException(decaf::lang::Pointer<decaf::lang::Exception> exCause) { 00179 this->exCause = exCause; 00180 } 00181 00190 exceptions::ActiveMQException createExceptionObject(); 00191 00192 }; 00193 00194 }} 00195 00196 #endif /*_ACTIVEMQ_COMMANDS_BROKERERROR_H_*/
1.6.1