activemq-cpp-3.8.2
BrokerError.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 _ACTIVEMQ_COMMANDS_BROKERERROR_H_
19 #define _ACTIVEMQ_COMMANDS_BROKERERROR_H_
20 
21 #include <activemq/util/Config.h>
24 #include <decaf/lang/Pointer.h>
25 
26 #include <string>
27 #include <vector>
28 
29 namespace activemq {
30 namespace commands {
31 
38  public:
39 
41  {
42  std::string ClassName;
43  std::string FileName;
44  std::string MethodName;
46 
47  StackTraceElement() : ClassName(), FileName(), MethodName(), LineNumber() {}
48  };
49 
50  private:
51 
52  std::string message;
53  std::string exceptionClass;
54  std::vector< decaf::lang::Pointer<StackTraceElement> > stackTraceElements;
57 
58  public:
59 
60  BrokerError();
61 
63 
64  virtual ~BrokerError();
65 
70  virtual unsigned char getDataStructureType() const {
71  return 0;
72  }
73 
79  virtual BrokerError* cloneDataStructure() const {
80  BrokerError* error = new BrokerError();
81  error->copyDataStructure( this );
82  return error;
83  }
84 
90  virtual void copyDataStructure(const DataStructure* src);
91 
100 
105  virtual const std::string& getMessage() const {
106  return message;
107  }
108 
113  virtual void setMessage(const std::string& message) {
114  this->message = message;
115  }
116 
121  virtual const std::string& getExceptionClass() const {
122  return exceptionClass;
123  }
124 
129  virtual void setExceptionClass(const std::string& exceptionClass) {
130  this->exceptionClass = exceptionClass;
131  }
132 
138  return cause;
139  }
140 
145  virtual void setCause(const decaf::lang::Pointer<BrokerError>& cause) {
146  this->cause = cause;
147  }
148 
153  virtual const std::vector<decaf::lang::Pointer<StackTraceElement> >& getStackTraceElements() const {
154  return stackTraceElements;
155  }
156 
161  virtual void setStackTraceElements(const std::vector<decaf::lang::Pointer<StackTraceElement> >& stackTraceElements) {
162  this->stackTraceElements = stackTraceElements;
163  }
164 
169  return this->exCause;
170  }
171 
179  this->exCause = exCause;
180  }
181 
190  exceptions::ActiveMQException createExceptionObject();
191 
192  };
193 
194 }}
195 
196 #endif /*_ACTIVEMQ_COMMANDS_BROKERERROR_H_*/
#define AMQCPP_API
Definition: Config.h:30
virtual void setStackTraceElements(const std::vector< decaf::lang::Pointer< StackTraceElement > > &stackTraceElements)
Sets the Stack Trace Elements for this Exception.
Definition: BrokerError.h:161
virtual const std::vector< decaf::lang::Pointer< StackTraceElement > > & getStackTraceElements() const
Gets the Stack Trace Elements for the Exception.
Definition: BrokerError.h:153
virtual BrokerError * cloneDataStructure() const
Clone this object and return a new instance that the caller now owns, this will be an exact copy of t...
Definition: BrokerError.h:79
Definition: DataStructure.h:27
This class represents an Exception sent from the Broker.
Definition: BrokerError.h:37
virtual void setExceptionClass(const std::string &exceptionClass)
Sets the string that contains the Exception Class name.
Definition: BrokerError.h:129
Interface for an Object that can visit the various Command Objects that are sent from and to this cli...
Definition: CommandVisitor.h:69
virtual const std::string & getExceptionClass() const
Gets the string holding the Exception Class name.
Definition: BrokerError.h:121
Definition: BaseCommand.h:27
StackTraceElement()
Definition: BrokerError.h:47
decaf::lang::Pointer< decaf::lang::Exception > getLocalException() const
Definition: BrokerError.h:168
int LineNumber
Definition: BrokerError.h:45
Definition: ActiveMQException.h:35
std::string ClassName
Definition: BrokerError.h:42
virtual unsigned char getDataStructureType() const
Get the DataStructure Type as defined in CommandTypes.h.
Definition: BrokerError.h:70
std::string FileName
Definition: BrokerError.h:43
void setLocalException(decaf::lang::Pointer< decaf::lang::Exception > exCause)
Sets the Pointer to the local exception that is the source of this Error.
Definition: BrokerError.h:178
virtual void copyDataStructure(const DataStructure *src)
Copy the contents of the passed object into this objects members, overwriting any existing data...
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
std::string MethodName
Definition: BrokerError.h:44
virtual const std::string & getMessage() const
Gets the string holding the error message.
Definition: BrokerError.h:105
virtual void setMessage(const std::string &message)
Sets the string that contains the error Message.
Definition: BrokerError.h:113
virtual void setCause(const decaf::lang::Pointer< BrokerError > &cause)
Sets the Broker Error that caused this exception.
Definition: BrokerError.h:145
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
virtual const decaf::lang::Pointer< BrokerError > & getCause() const
Gets the Broker Error that caused this exception.
Definition: BrokerError.h:137