activemq-cpp-3.6.0
activemq::commands::BrokerError Class Reference

This class represents an Exception sent from the Broker. More...

#include <src/main/activemq/commands/BrokerError.h>

Inheritance diagram for activemq::commands::BrokerError:

Data Structures

struct  StackTraceElement

Public Member Functions

 BrokerError ()
 BrokerError (decaf::lang::Pointer< decaf::lang::Exception > exCause)
virtual ~BrokerError ()
virtual unsigned char getDataStructureType () const
 Get the DataStructure Type as defined in CommandTypes.h.
virtual BrokerErrorcloneDataStructure () const
 Clone this object and return a new instance that the caller now owns, this will be an exact copy of this one.
virtual void copyDataStructure (const DataStructure *src)
 Copy the contents of the passed object into this objects members, overwriting any existing data.
virtual decaf::lang::Pointer
< commands::Command
visit (activemq::state::CommandVisitor *visitor)
 Allows a Visitor to visit this command and return a response to the command based on the command type being visited.
virtual const std::string & getMessage () const
 Gets the string holding the error message.
virtual void setMessage (const std::string &message)
 Sets the string that contains the error Message.
virtual const std::string & getExceptionClass () const
 Gets the string holding the Exception Class name.
virtual void setExceptionClass (const std::string &exceptionClass)
 Sets the string that contains the Exception Class name.
virtual const
decaf::lang::Pointer
< BrokerError > & 
getCause () const
 Gets the Broker Error that caused this exception.
virtual void setCause (const decaf::lang::Pointer< BrokerError > &cause)
 Sets the Broker Error that caused this exception.
virtual const std::vector
< decaf::lang::Pointer
< StackTraceElement > > & 
getStackTraceElements () const
 Gets the Stack Trace Elements for the Exception.
virtual void setStackTraceElements (const std::vector< decaf::lang::Pointer< StackTraceElement > > &stackTraceElements)
 Sets the Stack Trace Elements for this Exception.
decaf::lang::Pointer
< decaf::lang::Exception
getLocalException () const
void setLocalException (decaf::lang::Pointer< decaf::lang::Exception > exCause)
 Sets the Pointer to the local exception that is the source of this Error.
exceptions::ActiveMQException createExceptionObject ()
 Creates and returns a ActiveMQException object that contains the error data from the Broker.
- Public Member Functions inherited from activemq::commands::BaseCommand
 BaseCommand ()
virtual ~BaseCommand ()
virtual void setCommandId (int id)
 Sets the Command Id of this Message.
virtual int getCommandId () const
 Gets the Command Id of this Message.
virtual void setResponseRequired (const bool required)
 Set if this Message requires a Response.
virtual bool isResponseRequired () const
 Is a Response required for this Command.
virtual std::string toString () const
 Returns a string containing the information for this DataStructure such as its type and value of its elements.
virtual bool equals (const DataStructure *value) const
 Compares the DataStructure passed in to this one, and returns if they are equivalent.
virtual bool isBrokerInfo () const
virtual bool isControlCommand () const
virtual bool isConnectionControl () const
virtual bool isConnectionError () const
virtual bool isConnectionInfo () const
virtual bool isConsumerInfo () const
virtual bool isConsumerControl () const
virtual bool isDestinationInfo () const
virtual bool isFlushCommand () const
virtual bool isMessage () const
virtual bool isMessageAck () const
virtual bool isMessagePull () const
virtual bool isKeepAliveInfo () const
virtual bool isMessageDispatch () const
virtual bool isMessageDispatchNotification () const
virtual bool isProducerAck () const
virtual bool isProducerInfo () const
virtual bool isResponse () const
virtual bool isRemoveInfo () const
virtual bool isRemoveSubscriptionInfo () const
virtual bool isReplayCommand () const
virtual bool isSessionInfo () const
virtual bool isShutdownInfo () const
virtual bool isTransactionInfo () const
virtual bool isWireFormatInfo () const
- Public Member Functions inherited from activemq::commands::Command
virtual ~Command ()
- Public Member Functions inherited from activemq::commands::BaseDataStructure
virtual ~BaseDataStructure ()
virtual bool isMarshalAware () const
 Determine if the class implementing this interface is really wanting to be told about marshaling.
virtual void beforeMarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
virtual void afterMarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
virtual void beforeUnmarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
virtual void afterUnmarshal (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
virtual void setMarshaledForm (wireformat::WireFormat *wireFormat AMQCPP_UNUSED, const std::vector< char > &data AMQCPP_UNUSED)
virtual std::vector< unsigned
char > 
getMarshaledForm (wireformat::WireFormat *wireFormat AMQCPP_UNUSED)
virtual void copyDataStructure (const DataStructure *src AMQCPP_UNUSED)
virtual bool equals (const DataStructure *value AMQCPP_UNUSED) const
- Public Member Functions inherited from activemq::commands::DataStructure
virtual ~DataStructure ()
- Public Member Functions inherited from activemq::wireformat::MarshalAware
virtual ~MarshalAware ()
virtual void beforeMarshal (WireFormat *wireFormat)=0
 Called before marshaling is started to prepare the object to be marshaled.
virtual void afterMarshal (WireFormat *wireFormat)=0
 Called after marshaling is started to cleanup the object being marshaled.
virtual void beforeUnmarshal (WireFormat *wireFormat)=0
 Called before unmarshaling is started to prepare the object to be unmarshaled.
virtual void afterUnmarshal (WireFormat *wireFormat)=0
 Called after unmarshaling is started to cleanup the object being unmarshaled.
virtual void setMarshaledForm (WireFormat *wireFormat, const std::vector< char > &data)=0
 Called to set the data to this object that will contain the objects marshaled form.
virtual std::vector< unsigned
char > 
getMarshaledForm (WireFormat *wireFormat)=0
 Called to get the data to this object that will contain the objects marshaled form.

Detailed Description

This class represents an Exception sent from the Broker.

The Broker sends a java Throwable structure, so we must mimic its structure here. We provide a means in this class to create a Decaf Exception that represents the error from the broker.

Constructor & Destructor Documentation

activemq::commands::BrokerError::BrokerError ( )
activemq::commands::BrokerError::BrokerError ( decaf::lang::Pointer< decaf::lang::Exception exCause)
virtual activemq::commands::BrokerError::~BrokerError ( )
virtual

Member Function Documentation

virtual BrokerError* activemq::commands::BrokerError::cloneDataStructure ( ) const
inlinevirtual

Clone this object and return a new instance that the caller now owns, this will be an exact copy of this one.

Returns
new copy of this object.

Implements activemq::commands::DataStructure.

References copyDataStructure().

virtual void activemq::commands::BrokerError::copyDataStructure ( const DataStructure src)
virtual

Copy the contents of the passed object into this objects members, overwriting any existing data.

Returns
src - Source Object

Reimplemented from activemq::commands::BaseCommand.

Referenced by cloneDataStructure().

exceptions::ActiveMQException activemq::commands::BrokerError::createExceptionObject ( )

Creates and returns a ActiveMQException object that contains the error data from the Broker.

The returned exception will if possible contain a cms::CMSException pointer that represents the actual JMS exception that was forwarded from the broker.

Returns
a new instance of an ActiveMQException
virtual const decaf::lang::Pointer<BrokerError>& activemq::commands::BrokerError::getCause ( ) const
inlinevirtual

Gets the Broker Error that caused this exception.

Returns
Broker Error Pointer
virtual unsigned char activemq::commands::BrokerError::getDataStructureType ( ) const
inlinevirtual

Get the DataStructure Type as defined in CommandTypes.h.

Returns
The type of the data structure

Implements activemq::commands::DataStructure.

virtual const std::string& activemq::commands::BrokerError::getExceptionClass ( ) const
inlinevirtual

Gets the string holding the Exception Class name.

Returns
Exception Class name
decaf::lang::Pointer<decaf::lang::Exception> activemq::commands::BrokerError::getLocalException ( ) const
inline
Returns
the local Exception that was the source of this BrokerError instance
virtual const std::string& activemq::commands::BrokerError::getMessage ( ) const
inlinevirtual

Gets the string holding the error message.

Returns
String Message
virtual const std::vector<decaf::lang::Pointer<StackTraceElement> >& activemq::commands::BrokerError::getStackTraceElements ( ) const
inlinevirtual

Gets the Stack Trace Elements for the Exception.

Returns
Stack Trace Elements
virtual void activemq::commands::BrokerError::setCause ( const decaf::lang::Pointer< BrokerError > &  cause)
inlinevirtual

Sets the Broker Error that caused this exception.

Parameters
cause- Broker Error
virtual void activemq::commands::BrokerError::setExceptionClass ( const std::string &  exceptionClass)
inlinevirtual

Sets the string that contains the Exception Class name.

Parameters
exceptionClass- String Exception Class name
void activemq::commands::BrokerError::setLocalException ( decaf::lang::Pointer< decaf::lang::Exception exCause)
inline

Sets the Pointer to the local exception that is the source of this Error.

Parameters
exCauseThe Exception that originated this BrokerError.
virtual void activemq::commands::BrokerError::setMessage ( const std::string &  message)
inlinevirtual

Sets the string that contains the error Message.

Parameters
message- String Error Message
virtual void activemq::commands::BrokerError::setStackTraceElements ( const std::vector< decaf::lang::Pointer< StackTraceElement > > &  stackTraceElements)
inlinevirtual

Sets the Stack Trace Elements for this Exception.

Parameters
stackTraceElements- Stack Trace Elements
virtual decaf::lang::Pointer<commands::Command> activemq::commands::BrokerError::visit ( activemq::state::CommandVisitor visitor)
virtual

Allows a Visitor to visit this command and return a response to the command based on the command type being visited.

The command will call the proper processXXX method in the visitor.

Returns
a Response to the visitor being called or NULL if no response.

Implements activemq::commands::Command.


The documentation for this class was generated from the following file: