You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/08/23 16:08:01 UTC
svn commit: r688327 [2/2] - in /activemq/activemq-cpp/trunk/src:
main/activemq/connector/ main/activemq/connector/openwire/
main/activemq/connector/stomp/ main/activemq/connector/stomp/marshal/
main/activemq/exceptions/ main/activemq/transport/ main/cm...
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/URISyntaxException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/URISyntaxException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/URISyntaxException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/URISyntaxException.h Sat Aug 23 07:07:59 2008
@@ -71,6 +71,37 @@
* optional list of arguments to parse into the message
* @param file name where exception occurs
* @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ URISyntaxException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... )
+ throw() : lang::Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ URISyntaxException( const std::exception* cause )
+ throw() : lang::Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
* @param message to report
* @param list of primitives that are formatted into the message
*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownHostException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownHostException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownHostException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownHostException.h Sat Aug 23 07:07:59 2008
@@ -57,6 +57,37 @@
* optional list of arguments to parse into the message
* @param file name where exception occurs
* @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ UnknownHostException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... )
+ throw() : io::IOException( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ UnknownHostException( const std::exception* cause )
+ throw() : io::IOException( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
* @param message to report
* @param list of primitives that are formatted into the message
*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownServiceException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownServiceException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownServiceException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/UnknownServiceException.h Sat Aug 23 07:07:59 2008
@@ -53,15 +53,46 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
* @param file name where exception occurs
* @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
* @param message to report
* @param list of primitives that are formatted into the message
*/
UnknownServiceException( const char* file, const int lineNumber,
- const char* msg, ... ) throw ()
+ const std::exception* cause,
+ const char* msg, ... )
+ throw() : io::IOException( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ UnknownServiceException( const std::exception* cause )
+ throw() : io::IOException( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ UnknownServiceException( const char* file, const int lineNumber,
+ const char* msg, ... ) throw ()
: io::IOException()
{
va_list vargs ;
Modified: activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferOverflowException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferOverflowException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferOverflowException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferOverflowException.h Sat Aug 23 07:07:59 2008
@@ -51,7 +51,37 @@
}
/**
- * Consturctor
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ BufferOverflowException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : lang::Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ BufferOverflowException( const std::exception* cause )
+ throw() : lang::Exception( cause ) {}
+
+ /**
+ * Constructor
* @param file name of the file were the exception occured.
* @param lineNumber line where the exception occured
* @param msg the message that was generated
Modified: activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferUnderflowException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferUnderflowException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferUnderflowException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/nio/BufferUnderflowException.h Sat Aug 23 07:07:59 2008
@@ -51,7 +51,37 @@
}
/**
- * Consturctor
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ BufferUnderflowException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : lang::Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ BufferUnderflowException( const std::exception* cause )
+ throw() : lang::Exception( cause ) {}
+
+ /**
+ * Constructor
* @param file name of the file were the exception occured.
* @param lineNumber line where the exception occured
* @param msg the message that was generated
Modified: activemq/activemq-cpp/trunk/src/main/decaf/nio/InvalidMarkException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/nio/InvalidMarkException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/nio/InvalidMarkException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/nio/InvalidMarkException.h Sat Aug 23 07:07:59 2008
@@ -51,7 +51,38 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ InvalidMarkException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... )
+ throw() : lang::exceptions::IllegalStateException( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ InvalidMarkException( const std::exception* cause )
+ throw() : lang::exceptions::IllegalStateException( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
* @param file name where exception occurs
* @param line number where the exception occurred.
Modified: activemq/activemq-cpp/trunk/src/main/decaf/nio/ReadOnlyBufferException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/nio/ReadOnlyBufferException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/nio/ReadOnlyBufferException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/nio/ReadOnlyBufferException.h Sat Aug 23 07:07:59 2008
@@ -52,7 +52,38 @@
}
/**
- * Consturctor
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ ReadOnlyBufferException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... )
+ throw() : lang::exceptions::UnsupportedOperationException( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ ReadOnlyBufferException( const std::exception* cause )
+ throw() : lang::exceptions::UnsupportedOperationException( cause ) {}
+
+ /**
+ * Constructor
* @param file name of the file were the exception occured.
* @param lineNumber line where the exception occured
* @param msg the message that was generated
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/GeneralSecurityException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/GeneralSecurityException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/GeneralSecurityException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/GeneralSecurityException.h Sat Aug 23 07:07:59 2008
@@ -24,8 +24,8 @@
namespace security{
/*
- * The GeneralSecurityException class is a generic security exception class
- * that provides type safety for all the security-related exception classes
+ * The GeneralSecurityException class is a generic security exception class
+ * that provides type safety for all the security-related exception classes
* that extend from it.
*/
class DECAF_API GeneralSecurityException : public GeneralSecurityException
@@ -61,10 +61,39 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ GeneralSecurityException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ GeneralSecurityException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -90,7 +119,7 @@
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual GeneralSecurityException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/InvalidKeyException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/InvalidKeyException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/InvalidKeyException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/InvalidKeyException.h Sat Aug 23 07:07:59 2008
@@ -24,7 +24,7 @@
namespace security{
/*
- * This is the exception for invalid Keys (invalid encoding, wrong length,
+ * This is the exception for invalid Keys (invalid encoding, wrong length,
* uninitialized, etc).
*/
class DECAF_API InvalidKeyException : public KeyException
@@ -60,10 +60,39 @@
/**
* Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ InvalidKeyException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ InvalidKeyException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
* this message occured. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -73,8 +102,8 @@
* list of primitives that are formatted into the message
*/
InvalidKeyException( const char* file,
- const int lineNumber,
- const char* msg, ...) throw()
+ const int lineNumber,
+ const char* msg, ...) throw()
: Exception()
{
va_list vargs;
@@ -89,7 +118,7 @@
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual InvalidKeyException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/KeyException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/KeyException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/KeyException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/KeyException.h Sat Aug 23 07:07:59 2008
@@ -59,10 +59,39 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ KeyException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ KeyException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -72,8 +101,8 @@
* list of primitives that are formatted into the message
*/
KeyException( const char* file,
- const int lineNumber,
- const char* msg, ...) throw()
+ const int lineNumber,
+ const char* msg, ...) throw()
: Exception()
{
va_list vargs;
@@ -88,7 +117,7 @@
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual KeyException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchAlgorithmException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchAlgorithmException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchAlgorithmException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchAlgorithmException.h Sat Aug 23 07:07:59 2008
@@ -24,7 +24,7 @@
namespace security{
/*
- * This exception is thrown when a particular cryptographic algorithm is
+ * This exception is thrown when a particular cryptographic algorithm is
* requested but is not available in the environment.
*/
class DECAF_API NoSuchAlgorithmException : public GeneralSecurityException
@@ -60,10 +60,39 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ NoSuchAlgorithmException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ NoSuchAlgorithmException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -73,8 +102,8 @@
* list of primitives that are formatted into the message
*/
NoSuchAlgorithmException( const char* file,
- const int lineNumber,
- const char* msg, ...) throw()
+ const int lineNumber,
+ const char* msg, ...) throw()
: Exception()
{
va_list vargs;
@@ -89,7 +118,7 @@
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual NoSuchAlgorithmException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchProviderException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchProviderException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchProviderException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/NoSuchProviderException.h Sat Aug 23 07:07:59 2008
@@ -24,7 +24,7 @@
namespace security{
/*
- * This exception is thrown when a particular security provider is requested
+ * This exception is thrown when a particular security provider is requested
* but is not available in the environment.
*/
class DECAF_API NoSuchProviderException : public GeneralSecurityException
@@ -60,10 +60,39 @@
/**
* Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ NoSuchProviderException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ NoSuchProviderException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
* this message occured. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -89,7 +118,7 @@
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual NoSuchProviderException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/main/decaf/security/SignatureException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/security/SignatureException.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/security/SignatureException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/security/SignatureException.h Sat Aug 23 07:07:59 2008
@@ -59,10 +59,39 @@
/**
* Constructor - Initializes the file name and line number where
- * this message occured. Sets the message to report, using an
+ * this message occurred. Sets the message to report, using an
* optional list of arguments to parse into the message
- *
- * @param file
+ * @param file name where exception occurs
+ * @param line number where the exception occurred.
+ * @param cause The exception that was the cause for this one to be thrown.
+ * @param message to report
+ * @param list of primitives that are formatted into the message
+ */
+ SignatureException( const char* file, const int lineNumber,
+ const std::exception* cause,
+ const char* msg, ... ) throw() : Exception( cause )
+ {
+ va_list vargs;
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
+
+ // Set the first mark for this exception.
+ setMark( file, lineNumber );
+ }
+
+ /**
+ * Constructor
+ * @param cause Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ SignatureException( const std::exception* cause ) throw() : Exception( cause ) {}
+
+ /**
+ * Constructor - Initializes the file name and line number where
+ * this message occurred. Sets the message to report, using an
+ * optional list of arguments to parse into the message
+ *
+ * @param file
* name where exception occurs
* @param lineNumber
* line number where the exception occurred.
@@ -72,23 +101,23 @@
* list of primitives that are formatted into the message
*/
SignatureException( const char* file,
- const int lineNumber,
- const char* msg, ...) throw()
+ const int lineNumber,
+ const char* msg, ...) throw()
: Exception()
{
va_list vargs;
- va_start(vargs, msg);
- buildMessage(msg, vargs);
+ va_start( vargs, msg );
+ buildMessage( msg, vargs );
// Set the first mark for this exception.
- setMark(file, lineNumber);
+ setMark( file, lineNumber );
}
/**
* Clones this exception. This is useful for cases where you need
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
- *
+ *
* @return A deep copy of this exception.
*/
virtual SignatureException* clone() const{
Modified: activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp Sat Aug 23 07:07:59 2008
@@ -16,9 +16,40 @@
*/
#include "ActiveMQExceptionTest.h"
+#include <activemq/exceptions/ExceptionDefines.h>
+#include <decaf/lang/Exception.h>
+#include <decaf/lang/exceptions/UnsupportedOperationException.h>
using namespace activemq;
using namespace activemq::exceptions;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQExceptionTest::testMacros() {
+
+ try{
+
+ try{
+ try{
+ throw UnsupportedOperationException( __FILE__, __LINE__, "EXCEPTION" );
+ CPPUNIT_FAIL( "Should not get this far." );
+ }
+ AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+ }
+ AMQ_CATCH_RETHROW( ActiveMQException )
+
+ } catch( ActiveMQException& ex ) {
+
+ CPPUNIT_ASSERT( ex.getCause() != NULL );
+
+ const UnsupportedOperationException* cause =
+ dynamic_cast<const UnsupportedOperationException*>( ex.getCause() );
+
+ CPPUNIT_ASSERT( cause != NULL );
+ }
+}
////////////////////////////////////////////////////////////////////////////////
void ActiveMQExceptionTest::testMessage0(){
Modified: activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/exceptions/ActiveMQExceptionTest.h Sat Aug 23 07:07:59 2008
@@ -32,6 +32,7 @@
CPPUNIT_TEST_SUITE( ActiveMQExceptionTest );
CPPUNIT_TEST( testMessage0 );
CPPUNIT_TEST( testMessage3 );
+ CPPUNIT_TEST( testMacros );
CPPUNIT_TEST_SUITE_END();
public:
@@ -41,6 +42,7 @@
virtual void setUp(){}
virtual void tearDown(){}
+ void testMacros();
void testMessage0();
void testMessage3();
Modified: activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.cpp?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.cpp Sat Aug 23 07:07:59 2008
@@ -16,12 +16,105 @@
*/
#include "ExceptionTest.h"
+#include <stdexcept>
using namespace std;
using namespace decaf;
using namespace decaf::lang;
////////////////////////////////////////////////////////////////////////////////
+void ExceptionTest::testCtors() {
+
+ Exception exception1;
+
+ CPPUNIT_ASSERT( exception1.getCause() == NULL );
+ CPPUNIT_ASSERT( exception1.getMessage() == "" );
+
+ exception1.setMessage( "EXCEPTION_1" );
+ CPPUNIT_ASSERT( exception1.getMessage() == "EXCEPTION_1" );
+
+ Exception exception2( __FILE__, __LINE__, "EXCEPTION_2" );
+
+ CPPUNIT_ASSERT( exception2.getCause() == NULL );
+ CPPUNIT_ASSERT( exception2.getMessage() == "EXCEPTION_2" );
+
+ Exception exception3( __FILE__, __LINE__, &exception1, "EXCEPTION_3" );
+
+ CPPUNIT_ASSERT( exception3.getCause() != NULL );
+ CPPUNIT_ASSERT( std::string( exception3.getCause()->what() ) == "EXCEPTION_1" );
+ CPPUNIT_ASSERT( exception3.getMessage() == "EXCEPTION_3" );
+
+ Exception exception4( exception1 );
+ CPPUNIT_ASSERT( exception4.getCause() == NULL );
+ CPPUNIT_ASSERT( exception4.getMessage() == "EXCEPTION_1" );
+
+ std::runtime_error runtime( "RUNTIME" );
+ Exception exception5( &runtime );
+ CPPUNIT_ASSERT( exception5.getCause() != NULL );
+ CPPUNIT_ASSERT( exception5.getMessage() == "RUNTIME" );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ExceptionTest::testAssign() {
+
+ Exception exception1;
+
+ CPPUNIT_ASSERT( exception1.getCause() == NULL );
+ CPPUNIT_ASSERT( exception1.getMessage() == "" );
+
+ exception1.setMessage( "EXCEPTION_1" );
+ CPPUNIT_ASSERT( exception1.getMessage() == "EXCEPTION_1" );
+
+ Exception exception2( __FILE__, __LINE__, "EXCEPTION_2" );
+
+ CPPUNIT_ASSERT( exception2.getCause() == NULL );
+ CPPUNIT_ASSERT( exception2.getMessage() == "EXCEPTION_2" );
+
+ exception1 = exception2;
+ CPPUNIT_ASSERT( exception1.getCause() == NULL );
+ CPPUNIT_ASSERT( exception1.getMessage() == "EXCEPTION_2" );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ExceptionTest::testClone() {
+
+ const char* text = "This is a test";
+ Exception ex( __FILE__, __LINE__, text );
+ CPPUNIT_ASSERT( strcmp( ex.getMessage().c_str(), text ) == 0 );
+ CPPUNIT_ASSERT( ex.getCause() == NULL );
+
+ Exception* cloned = ex.clone();
+
+ CPPUNIT_ASSERT( strcmp( cloned->getMessage().c_str(), text ) == 0 );
+ CPPUNIT_ASSERT( cloned->getCause() == NULL );
+
+ delete cloned;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ExceptionTest::testInitCause() {
+
+ const char* text = "This is a test";
+ Exception ex( __FILE__, __LINE__, text );
+ CPPUNIT_ASSERT( strcmp( ex.getMessage().c_str(), text ) == 0 );
+ CPPUNIT_ASSERT( ex.getCause() == NULL );
+
+ std::runtime_error exception1("RUNTIME");
+ Exception exception2( __FILE__, __LINE__, "EXCEPTION" );
+
+ ex.initCause( &exception1 );
+ CPPUNIT_ASSERT( ex.getCause() != NULL );
+ CPPUNIT_ASSERT( std::string( ex.getCause()->what() ) == "RUNTIME" );
+
+ ex.initCause( &exception2 );
+ CPPUNIT_ASSERT( ex.getCause() != NULL );
+ CPPUNIT_ASSERT( std::string( ex.getCause()->what() ) == "EXCEPTION" );
+
+ const Exception* test = dynamic_cast<const Exception*>( ex.getCause() );
+ CPPUNIT_ASSERT( test != NULL );
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ExceptionTest::testMessage0(){
const char* text = "This is a test";
Exception ex( __FILE__, __LINE__, text );
Modified: activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.h?rev=688327&r1=688326&r2=688327&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/lang/ExceptionTest.h Sat Aug 23 07:07:59 2008
@@ -32,6 +32,10 @@
CPPUNIT_TEST_SUITE( ExceptionTest );
CPPUNIT_TEST( testMessage0 );
CPPUNIT_TEST( testMessage3 );
+ CPPUNIT_TEST( testClone );
+ CPPUNIT_TEST( testInitCause );
+ CPPUNIT_TEST( testCtors );
+ CPPUNIT_TEST( testAssign );
CPPUNIT_TEST_SUITE_END();
public:
@@ -41,6 +45,10 @@
virtual void setUp(){}
virtual void tearDown(){}
+ void testCtors();
+ void testAssign();
+ void testClone();
+ void testInitCause();
void testMessage0();
void testMessage3();