activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r941930 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security: GeneralSecurityException.h KeyException.h KeyManagementException.h
Date Thu, 06 May 2010 21:10:43 GMT
Author: tabish
Date: Thu May  6 21:10:43 2010
New Revision: 941930

URL: http://svn.apache.org/viewvc?rev=941930&view=rev
Log:
Add the KeyManagementException and fix some errors in the base Exceptions in the Security
package.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
  (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h?rev=941930&r1=941929&r2=941930&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h
Thu May  6 21:10:43 2010
@@ -29,7 +29,7 @@ namespace security{
      * that provides type safety for all the security-related exception classes
      * that extend from it.
      */
-    class DECAF_API GeneralSecurityException : public Exception {
+    class DECAF_API GeneralSecurityException : public decaf::lang::Exception {
     public:
 
         /**
@@ -42,10 +42,10 @@ namespace security{
          * @param ex
          *      An exception that should become this type of Exception
          */
-        GeneralSecurityException(const Exception& ex) throw()
-        : Exception()
+        GeneralSecurityException( const decaf::lang::Exception& ex ) throw()
+        : decaf::lang::Exception()
         {
-            *(Exception*)this = ex;
+            *(decaf::lang::Exception*)this = ex;
         }
 
         /**
@@ -54,9 +54,9 @@ namespace security{
          *      An exception that should become this type of Exception
          */
         GeneralSecurityException(const GeneralSecurityException& ex) throw()
-        : Exception()
+        : decaf::lang::Exception()
         {
-            *(Exception*)this = ex;
+            *(decaf::lang::Exception*)this = ex;
         }
 
         /**
@@ -71,7 +71,7 @@ namespace security{
          */
         GeneralSecurityException( const char* file, const int lineNumber,
                                   const std::exception* cause,
-                                  const char* msg, ... ) throw() : Exception( cause )
+                                  const char* msg, ... ) throw() : decaf::lang::Exception(
cause )
         {
             va_list vargs;
             va_start( vargs, msg );
@@ -86,7 +86,7 @@ namespace security{
          * @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
) {}
+        GeneralSecurityException( const std::exception* cause ) throw() : decaf::lang::Exception(
cause ) {}
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -105,14 +105,14 @@ namespace security{
         GeneralSecurityException( const char* file,
                                   const int lineNumber,
                                   const char* msg, ...) throw()
-        : Exception()
+        : decaf::lang::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 );
         }
 
         /**
@@ -123,7 +123,7 @@ namespace security{
          * @return A deep copy of this exception.
          */
         virtual GeneralSecurityException* clone() const{
-            return new GeneralSecurityException(*this);
+            return new GeneralSecurityException( *this );
         }
 
         virtual ~GeneralSecurityException() throw() {}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h?rev=941930&r1=941929&r2=941930&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h Thu May
 6 21:10:43 2010
@@ -40,8 +40,8 @@ namespace security{
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyException(const Exception& ex) throw()
-        : Exception()
+        KeyException( const decaf::lang::Exception& ex ) throw()
+        : GeneralSecurityException()
         {
             *(Exception*)this = ex;
         }
@@ -51,8 +51,8 @@ namespace security{
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyException(const KeyException& ex) throw()
-        : Exception()
+        KeyException( const KeyException& ex ) throw()
+        : GeneralSecurityException()
         {
             *(Exception*)this = ex;
         }
@@ -69,7 +69,7 @@ namespace security{
          */
         KeyException( const char* file, const int lineNumber,
                       const std::exception* cause,
-                      const char* msg, ... ) throw() : Exception( cause )
+                      const char* msg, ... ) throw() : GeneralSecurityException( cause )
         {
             va_list vargs;
             va_start( vargs, msg );
@@ -84,7 +84,7 @@ namespace security{
          * @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 ) {}
+        KeyException( const std::exception* cause ) throw() : GeneralSecurityException( cause
) {}
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -100,17 +100,15 @@ namespace security{
          * @param ...
          *      list of primitives that are formatted into the message
          */
-        KeyException( const char* file,
-                      const int lineNumber,
-                      const char* msg, ...) throw()
-        : Exception()
+        KeyException( const char* file, const int lineNumber, const char* msg, ...) throw()
+        : GeneralSecurityException()
         {
             va_list vargs;
             va_start(vargs, msg);
-            buildMessage(msg, vargs);
+            buildMessage( msg, vargs );
 
             // Set the first mark for this exception.
-            setMark(file, lineNumber);
+            setMark( file, lineNumber );
         }
 
         /**

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h?rev=941930&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
Thu May  6 21:10:43 2010
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_SECURITY_KEYMANAGEMENTEXCEPTION_H_
+#define _DECAF_SECURITY_KEYMANAGEMENTEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/security/KeyException.h>
+
+namespace decaf{
+namespace security{
+
+    /*
+     * A basic key exception
+     */
+    class DECAF_API KeyManagementException : public KeyException {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        KeyManagementException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param ex
+         *      An exception that should become this type of Exception
+         */
+        KeyManagementException(const Exception& ex) throw()
+        : KeyException()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         * @param ex
+         *      An exception that should become this type of Exception
+         */
+        KeyManagementException(const KeyManagementException& ex) throw()
+        : KeyException()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * 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 The file name where exception occurs
+         * @param lineNumber The line number where the exception occurred.
+         * @param cause The exception that was the cause for this one to be thrown.
+         * @param msg The message to report
+         * @param ... list of primitives that are formatted into the message
+         */
+        KeyManagementException( const char* file, const int lineNumber,
+                                const std::exception* cause,
+                                const char* msg, ... ) throw() : KeyException( 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.
+         */
+        KeyManagementException( const std::exception* cause ) throw() : KeyException( 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.
+         * @param msg
+         *      message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        KeyManagementException( const char* file, const int lineNumber, const char* msg,
...) throw()
+        : KeyException()
+        {
+            va_list vargs;
+            va_start(vargs, msg);
+            buildMessage(msg, vargs);
+
+            // Set the first mark for this exception.
+            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 KeyManagementException* clone() const{
+            return new KeyManagementException(*this);
+        }
+
+        virtual ~KeyManagementException() throw() {}
+
+   };
+
+}}
+
+#endif /*_DECAF_SECURITY_KEYMANAGEMENTEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message