activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r452014 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions: IllegalStateException.h IndexOutOfBoundsException.h
Date Mon, 02 Oct 2006 12:55:24 GMT
Author: tabish
Date: Mon Oct  2 05:55:24 2006
New Revision: 452014

URL: http://svn.apache.org/viewvc?view=rev&rev=452014
Log:
Adding new Exception Types for future openwire support

Added:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h
  (with props)
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h
  (with props)

Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h?view=auto&rev=452014
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h
(added)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h
Mon Oct  2 05:55:24 2006
@@ -0,0 +1,89 @@
+/*
+ * 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 ACTIVEMQ_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_
+#define ACTIVEMQ_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+namespace activemq{
+namespace exceptions{
+
+    /*
+     * Thrown when an error occurs from calling a method from syncronizable
+     * and the caller doesn't hold a lock on the object.
+     */
+    class IllegalStateException : public ActiveMQException
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        IllegalStateException(void) {};
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        IllegalStateException(const ActiveMQException& ex){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        IllegalStateException(const IllegalStateException& ex){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * 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 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
+         */
+        IllegalStateException( const char* file, 
+                                      const int lineNumber,
+                                      const char* msg, ...)
+        {
+            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.
+         */
+        virtual ActiveMQException* clone(void) const{
+            return new IllegalStateException(*this);
+        }
+
+        virtual ~IllegalStateException(void) {}
+
+   };
+
+}}
+
+#endif /*ACTIVEMQ_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_*/

Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalStateException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h?view=auto&rev=452014
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h
(added)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h
Mon Oct  2 05:55:24 2006
@@ -0,0 +1,90 @@
+/*
+ * 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 ACTIVEMQ_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_
+#define ACTIVEMQ_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+namespace activemq{
+namespace exceptions{
+
+    /*
+     * Thrown when an illegal argument was passed into a method.
+     */
+    class IndexOutOfBoundsException : public ActiveMQException
+    {
+    public:
+    
+      /**
+       * Default Constructor
+       */
+      IndexOutOfBoundsException(){};
+      
+      /**
+       * Conversion Constructor from some other ActiveMQException
+       * @param An exception that should become this type of Exception
+       */
+      IndexOutOfBoundsException( const ActiveMQException& ex ){
+         *(ActiveMQException*)this = ex;
+      }
+      
+      /**
+       * Copy Constructor
+       */
+      IndexOutOfBoundsException( const IndexOutOfBoundsException& ex ){
+         *(ActiveMQException*)this = ex;
+      }
+        
+      /**
+       * 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 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
+       */
+      IndexOutOfBoundsException(const char* file, const int lineNumber,
+         const char* msg, ...)
+      {
+         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.
+       */
+      virtual ActiveMQException* clone() const{
+         return new IndexOutOfBoundsException( *this );
+      }
+      
+      /**
+       * Destructor
+       */
+      virtual ~IndexOutOfBoundsException(){}
+        
+    };
+
+}}
+
+#endif /*ACTIVEMQ_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_*/

Propchange: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/IndexOutOfBoundsException.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message