activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r652104 [11/29] - in /activemq/activemq-cpp/trunk: ./ m4/ src/examples/ src/examples/consumers/ src/main/ src/main/decaf/ src/main/decaf/internal/ src/main/decaf/internal/net/ src/main/decaf/internal/nio/ src/main/decaf/internal/util/ src/m...
Date Tue, 29 Apr 2008 20:52:37 GMT
Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Number.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Number.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Number.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Number.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,82 @@
+/*
+ * 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_LANG_NUMBER_H_
+#define _DECAF_LANG_NUMBER_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf{
+namespace lang{
+
+    /**
+     * The abstract class Number is the superclass of classes Byte, Double,
+     * Float, Integer, Long, and Short.
+     *
+     * Subclasses of Number must provide methods to convert the represented
+     * numeric value to byte, double, float, int, long, and short.
+     */
+    class DECAF_API Number {
+    public:
+
+        virtual ~Number() {}
+
+        /**
+         * Answers the byte value which the receiver represents
+         * @return byte the value of the receiver.
+         */
+        virtual unsigned char byteValue() const {
+            return (unsigned char)intValue();
+        }
+
+        /**
+         * Answers the double value which the receiver represents
+         * @return double the value of the receiver.
+         */
+        virtual double doubleValue() const = 0;
+
+        /**
+         * Answers the float value which the receiver represents
+         * @return float the value of the receiver.
+         */
+        virtual float floatValue() const = 0;
+
+        /**
+         * Answers the int value which the receiver represents
+         * @return int the value of the receiver.
+         */
+        virtual int intValue() const = 0;
+
+        /**
+         * Answers the long value which the receiver represents
+         * @return long long the value of the receiver.
+         */
+        virtual long long longValue() const = 0;
+
+        /**
+         * Answers the short value which the receiver represents
+         * @return short the value of the receiver.
+         */
+        virtual short shortValue()  const {
+            return (short) intValue();
+        }
+
+    };
+
+}}
+
+#endif /*_DECAF_LANG_NUMBER_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Runnable.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Runnable.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Runnable.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Runnable.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,43 @@
+/*
+ * 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_LANG_RUNNABLE_H_
+#define _DECAF_LANG_RUNNABLE_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf{
+namespace lang{
+
+    /**
+     * Interface for a runnable object - defines a task
+     * that can be run by a thread.
+     */
+    class DECAF_API Runnable{
+    public:
+
+        virtual ~Runnable(){}
+
+        /**
+         * Run method - called by the Thread class in the context
+         * of the thread.
+         */
+        virtual void run() = 0;
+    };
+
+}}
+
+#endif /*_DECAF_LANG_RUNNABLE_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.cpp?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.cpp Tue Apr 29 13:52:30 2008
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+#include "Short.h"
+#include "Integer.h"
+
+#include <sstream>
+
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+Short::Short( short value ) {
+    this->value = value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Short::Short( const std::string& value ) throw( exceptions::NumberFormatException ) {
+    this->value = value.size(); //Short::parseShort( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int Short::compareTo( const Short& s ) const {
+    return value == s.value ? 0 : ( value > s.value ? 1 : -1 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int Short::compareTo( const short& s ) const {
+    return value == s ? 0 : ( value > s ? 1 : -1 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string Short::toString() const {
+    return Integer::toString( this->value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string Short::toString( short value ) {
+    return Integer::toString( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+short Short::parseShort( const std::string& s, int radix )
+    throw ( exceptions::NumberFormatException ) {
+
+    int intValue = Integer::parseInt( s, radix );
+    short result = (short)intValue;
+    if( result != intValue ) {
+        throw NumberFormatException(
+            __FILE__, __LINE__,
+            "Short::parseShort - Not a valid short encoded string.");
+    }
+
+    return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+short Short::parseShort( const std::string& s )
+    throw ( exceptions::NumberFormatException ) {
+    return parseShort( s, 10 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Short Short::decode( const std::string& value )
+    throw ( exceptions::NumberFormatException ) {
+
+    int intValue = Integer::decode( value ).intValue();
+    short result = (short)intValue;
+    if( result != intValue ) {
+        throw NumberFormatException(
+            __FILE__, __LINE__,
+            "Short::decode - Not a valid short encoded string.");
+    }
+
+    return Short( result );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+short Short::reverseBytes( short value ) {
+    unsigned short temp = value;
+    temp = ( ( temp & 0xFF00 ) >> 8 ) | ( ( temp & 0x00FF ) << 8 );
+    return temp;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Short Short::valueOf( short value ) {
+    return Short( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Short Short::valueOf( const std::string& value )
+    throw ( exceptions::NumberFormatException ) {
+
+    return Short( parseShort( value, 10 ) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Short Short::valueOf( const std::string& value, int radix )
+    throw ( exceptions::NumberFormatException ) {
+
+    return Short( parseShort( value, radix ) );
+}

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Short.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,301 @@
+/*
+ * 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_LANG_SHORT_H_
+#define _DECAF_LANG_SHORT_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/Number.h>
+#include <decaf/lang/Comparable.h>
+#include <decaf/lang/exceptions/NumberFormatException.h>
+#include <string>
+
+namespace decaf{
+namespace lang{
+
+    class DECAF_API Short : public Number,
+                            public Comparable<Short>,
+                            public Comparable<short> {
+    private:
+
+        // The short value
+        short value;
+
+    public:
+
+        /** Size of this objects primitive type in bits */
+        static const int SIZE = 16;
+
+        /** Max Value for this Object's primitive type */
+        static const short MAX_VALUE = (short)0x7FFF;
+
+        /** Max Value for this Object's primitive type */
+        static const short MIN_VALUE = (short)0x8000;
+
+    public:
+
+        /**
+         * @param value - short to wrap
+         */
+        Short( short value );
+
+        /**
+         * @param value - string value to convert to short and wrap
+         * @throws NumberFormatException
+         */
+        Short( const std::string& value ) throw( exceptions::NumberFormatException );
+
+        virtual ~Short() {}
+
+        /**
+         * Compares this Short instance with another.
+         * @param s - the Short instance to be compared
+         * @return zero if this object represents the same short value as the
+         * argument; a positive value if this object represents a value greater
+         * than the passed in value, and -1 if this object repesents a value
+         * less than the passed in value.
+         */
+        virtual int compareTo( const Short& s ) const;
+
+        /**
+         * @returns true if the two Short Objects have the same value.
+         */
+        bool equals( const Short& s ) const {
+            return this->value == s.value;
+        }
+
+        /**
+         * Compares equality between this object and the one passed.
+         * @param s - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
+         */
+        virtual bool operator==( const Short& s ) const {
+            return this->value == s.value;
+        }
+
+        /**
+         * Compares this object to another and returns true if this object
+         * is considered to be less than the one passed.  This
+         * @param s - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
+         */
+        virtual bool operator<( const Short& s ) const {
+            return this->value < s.value;
+        }
+
+        /**
+         * Compares this Short instance with another.
+         * @param s - the Short instance to be compared
+         * @return zero if this object represents the same short value as the
+         * argument; a positive value if this object represents a value greater
+         * than the passed in value, and -1 if this object repesents a value
+         * less than the passed in value.
+         */
+        virtual int compareTo( const short& s ) const;
+
+        /**
+         * @returns true if the two Short Objects have the same value.
+         */
+        bool equals( const short& s ) const {
+            return this->value == s;
+        }
+
+        /**
+         * Compares equality between this object and the one passed.
+         * @param s - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
+         */
+        virtual bool operator==( const short& s ) const {
+            return this->value == s;
+        }
+
+        /**
+         * Compares this object to another and returns true if this object
+         * is considered to be less than the one passed.  This
+         * @param s - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
+         */
+        virtual bool operator<( const short& s ) const {
+            return this->value < s;
+        }
+
+        /**
+         * @returns this Short Object as a String Representation
+         */
+        std::string toString() const;
+
+        /**
+         * Answers the double value which the receiver represents
+         * @return double the value of the receiver.
+         */
+        virtual double doubleValue() const {
+            return (double)this->value;
+        }
+
+        /**
+         * Answers the float value which the receiver represents
+         * @return float the value of the receiver.
+         */
+        virtual float floatValue() const {
+            return (float)this->value;
+        }
+
+        /**
+         * Answers the byte value which the receiver represents
+         * @return int the value of the receiver.
+         */
+        virtual unsigned char byteValue() const {
+            return (unsigned char)this->value;
+        }
+
+        /**
+         * Answers the short value which the receiver represents
+         * @return int the value of the receiver.
+         */
+        virtual short shortValue() const {
+            return this->value;
+        }
+
+        /**
+         * Answers the int value which the receiver represents
+         * @return int the value of the receiver.
+         */
+        virtual int intValue() const {
+            return (int)this->value;
+        }
+
+        /**
+         * Answers the long value which the receiver represents
+         * @return long the value of the receiver.
+         */
+        virtual long long longValue() const {
+            return (long long)this->value;
+        }
+
+    public:   // statics
+
+        /**
+         * @returns a string representing the primitive value as Base 10
+         */
+        static std::string toString( short value );
+
+        /**
+         * Decodes a String into a Short. Accepts decimal, hexadecimal, and octal
+         * numbers given by the following grammar:
+         *
+         * The sequence of characters following an (optional) negative sign and/or
+         * radix specifier ("0x", "0X", "#", or leading zero) is parsed as by the
+         * Short.parseShort method with the indicated radix (10, 16, or 8). This
+         * sequence of characters must represent a positive value or a
+         * NumberFormatException will be thrown. The result is negated if first
+         * character of the specified String is the minus sign. No whitespace
+         * characters are permitted in the string.
+         * @param value - The string to decode
+         * @returns a Short object containing the decoded value
+         * @throws NumberFomatException if the string is not formatted correctly.
+         */
+        static Short decode( const std::string& value )
+            throw ( exceptions::NumberFormatException );
+
+        /**
+         * Returns the value obtained by reversing the order of the bytes in the
+         * two's complement representation of the specified short value.
+         * @param value - the short whose bytes we are to reverse
+         * @return the reversed short.
+         */
+        static short reverseBytes( short value );
+
+        /**
+         * Parses the string argument as a signed short in the radix specified by
+         * the second argument. The characters in the string must all be digits,
+         * of the specified radix (as determined by whether
+         * Character.digit(char, int) returns a nonnegative value) except that the
+         * first character may be an ASCII minus sign '-'  ('\u002D') to indicate
+         * a negative value. The resulting byte value is returned.
+         *
+         * An exception of type NumberFormatException is thrown if any of the
+         * following situations occurs:
+         *  * The first argument is null or is a string of length zero.
+         *  * The radix is either smaller than Character.MIN_RADIX or larger than
+         *    Character.MAX_RADIX.
+         *  * Any character of the string is not a digit of the specified radix,
+         *    except that the first character may be a minus sign '-' ('\u002D')
+         *    provided that the string is longer than length 1.
+         *  * The value represented by the string is not a value of type short.
+         *
+         * @param s - the String containing the short representation to be parsed
+         * @param radix - the radix to be used while parsing s
+         * @return the short represented by the string argument in the specified radix.
+         * @throws NumberFormatException - If String does not contain a parsable short.
+         */
+        static short parseShort( const std::string& s, int radix )
+            throw ( exceptions::NumberFormatException );
+
+        /**
+         * Parses the string argument as a signed decimal short. The characters
+         * in the string must all be decimal digits, except that the first
+         * character may be an ASCII minus sign '-' ('\u002D') to indicate a
+         * negative value. The resulting short value is returned, exactly as if
+         * the argument and the radix 10 were given as arguments to the
+         * parseShort( const std::string, int ) method.
+         * @param s - String to convert to a short
+         * @returns the converted short value
+         * @throws NumberFormatException if the string is not a short.
+         */
+        static short parseShort( const std::string& s )
+            throw ( exceptions::NumberFormatException );
+
+        /**
+         * Returns a Short instance representing the specified short value.
+         * @param value - the short to wrap
+         * @return the new Short object wrapping value.
+         */
+        static Short valueOf( short value );
+
+        /**
+         * Returns a Short object holding the value given by the specified std::string.
+         * The argument is interpreted as representing a signed decimal short,
+         * exactly as if the argument were given to the parseShort( std::string )
+         * method. The result is a Short object that represents the short value
+         * specified by the string.
+         * @param value - std::string to parse as base 10
+         * @return new Short Object wrapping the primitive
+         * @throws NumberFormatException if the string is not a decimal short.
+         */
+        static Short valueOf( const std::string& value )
+            throw ( exceptions::NumberFormatException );
+
+        /**
+         * Returns a Short object holding the value extracted from the specified
+         * std::string when parsed with the radix given by the second argument.
+         * The first argument is interpreted as representing a signed short in the
+         * radix specified by the second argument, exactly as if the argument were
+         * given to the parseShort( std::string, int ) method. The result is a
+         * Short object that represents the short value specified by the string.
+         * @param value - std::string to parse as base ( radix )
+         * @param radix - base of the string to parse.
+         * @return new Short Object wrapping the primitive
+         * @throws NumberFormatException if the string is not a valid short.
+         */
+        static Short valueOf( const std::string& value, int radix )
+            throw ( exceptions::NumberFormatException );
+
+    };
+
+}}
+
+#endif /*_DECAF_LANG_SHORT_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp Tue Apr 29 13:52:30 2008
@@ -0,0 +1,228 @@
+/*
+ * 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.
+ */
+
+#include "System.h"
+
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/RuntimeException.h>
+#include <decaf/util/Date.h>
+#include <decaf/util/StringTokenizer.h>
+#include <apr.h>
+#include <apr_errno.h>
+#include <apr_env.h>
+
+#if APR_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <cstdlib>
+
+using namespace std;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::util;
+using namespace decaf::internal;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+System::System() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+AprPool& System::getAprPool() {
+    static AprPool aprPool;
+    return aprPool;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void System::unsetenv( const std::string& name ) throw ( lang::Exception ) {
+
+    apr_status_t result = APR_SUCCESS;
+
+    // Clear the value, errors are thrown out as an exception
+    result = apr_env_delete( name.c_str(), getAprPool().getAprPool() );
+    getAprPool().cleanup();
+
+    if( result != APR_SUCCESS ) {
+
+        char buffer[256] = {0};
+
+        throw NullPointerException(
+            __FILE__, __LINE__,
+            "System::getenv - ",
+            apr_strerror( result, buffer, 255 ) );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string System::getenv( const std::string& name ) throw ( Exception ) {
+
+    char* value = NULL;
+    apr_status_t result = APR_SUCCESS;
+
+    // Read the value, errors are thrown out as an exception
+    result = apr_env_get( &value, name.c_str(), getAprPool().getAprPool() );
+
+    if( result != APR_SUCCESS ) {
+
+        char buffer[256] = {0};
+
+        throw NullPointerException(
+            __FILE__, __LINE__,
+            "System::getenv - ",
+            apr_strerror( result, buffer, 255 ) );
+    }
+
+    // Copy and cleanup
+    if( value == NULL ) {
+        return "";
+    }
+
+    std::string envVal( value );
+    getAprPool().cleanup();
+
+    return value;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void System::setenv( const std::string& name, const std::string& value )
+    throw ( lang::Exception ) {
+
+    apr_status_t result = APR_SUCCESS;
+
+    // Write the value, errors are thrown out as an exception
+    result = apr_env_set( name.c_str(), value.c_str(), getAprPool().getAprPool() );
+    getAprPool().cleanup();
+
+    if( result != APR_SUCCESS ) {
+
+        char buffer[256] = {0};
+
+        throw NullPointerException(
+            __FILE__, __LINE__,
+            "System::getenv - ",
+            apr_strerror( result, buffer, 255 ) );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+long long System::currentTimeMillis() {
+    return Date::getCurrentTimeMilliseconds();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Map<string, string> System::getenv() throw ( Exception ) {
+
+    Map<string, string> values;
+    StringTokenizer tokenizer( "" );
+    string key = "";
+    string value = "";
+    int tokens = 0;
+    std::vector<std::string> env = getEnvArray();
+
+    for( std::size_t i = 0; i < env.size(); i++ ){
+        tokenizer.reset( env[i], "=" );
+
+        tokens = tokenizer.countTokens();
+
+        if( tokens == 1 ) {
+            // special case, no value set, store empty string as value
+            key = tokenizer.nextToken();
+            value = string("");
+        } else if( tokens > 2 ) {
+            // special case: first equals delimits the key value, the rest are
+            // part of the variable
+            int pos = (int)env[i].find( "=" );
+            key = env[i].substr( 0, pos );
+            value = env[i].substr( pos + 1, string::npos );
+        } else if( tokens == 0 ) {
+            // Odd case, got a string with no equals sign.
+            throw IllegalArgumentException(
+                __FILE__, __LINE__,
+                "System::getenv - Invalid env string. %s",
+                env[i].c_str() );
+        } else {
+            // Normal case.
+            key = tokenizer.nextToken();
+            value = tokenizer.nextToken();
+        }
+
+        // Store the env var
+        values.setValue( key, value );
+    }
+
+    return values;
+}
+
+#if defined(_WIN32)
+
+#include <windows.h>
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<std::string> System::getEnvArray() {
+
+    std::vector<std::string> buffer;
+    int count = 0;
+    LPTSTR lpszVars;
+    LPVOID lpvEnv;
+
+    lpvEnv = GetEnvironmentStrings();
+    if( NULL == lpvEnv ){
+        return buffer;
+    }
+
+    lpszVars = (LPTSTR)lpvEnv;
+    while( *lpszVars != NULL ) {
+        count++;
+        lpszVars += strlen(lpszVars)+1;
+    }
+
+    lpszVars = (LPTSTR)lpvEnv;
+    int index = 0;
+    while( *lpszVars != NULL ) {
+        buffer.push_back( lpszVars );
+        lpszVars += strlen(lpszVars)+1;
+    }
+
+    FreeEnvironmentStrings( (LPTCH)lpvEnv );
+    return buffer;
+}
+
+#else
+
+////////////////////////////////////////////////////////////////////////////////
+extern char** environ;
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<std::string> System::getEnvArray() {
+
+    std::vector<std::string> buffer;
+    int count = 0;
+
+    for( int i = 0; *(environ + i); i++ ){
+        count++;
+    }
+
+    for( int i = 0; *(environ + i); i++ ){
+        buffer.push_back( environ[i] );
+    }
+
+    return buffer;
+}
+
+#endif

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/System.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/System.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/System.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/System.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,98 @@
+/*
+ * 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_LANG_SYSTEM_H_
+#define _DECAF_LANG_SYSTEM_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/util/Map.h>
+#include <decaf/lang/Exception.h>
+#include <decaf/internal/AprPool.h>
+#include <string>
+
+namespace decaf{
+namespace lang{
+
+    class DECAF_API System {
+    public:
+
+        System();
+        virtual ~System() {}
+
+    public:  // Static Methods
+
+        /**
+         * Enumerates the system environment and returns a map of env variable
+         * names to the string values they hold.
+         * @return A Map of all environment variables.
+         * @throw Exception if an error occurs
+         */
+        static util::Map<std::string, std::string> getenv()
+            throw ( lang::Exception );
+
+        /**
+         * Reads an environment value from the system and returns it as a
+         * string object
+         * @param name - the env var to read
+         * @return a string with the value from the var or ""
+         * @throws an Exception if an error occurs while reading the Env.
+         */
+        static std::string getenv( const std::string& name )
+            throw ( lang::Exception );
+
+        /**
+         * Clears a set env value if one is set.
+         * @param name - the env var to clear
+         * @throws an Exception if an error occurs while reading the Env.
+         */
+        static void unsetenv( const std::string& name )
+            throw ( lang::Exception );
+
+        /**
+         * Sets the specified system property to the value given
+         * @param name - name of the env val to set
+         * @param value - value to assign to name
+         * @throws an Exception if an error occurs
+         */
+        static void setenv( const std::string& name, const std::string& value )
+            throw ( lang::Exception );
+
+        /**
+         * @returns the current system time in Milliseconds
+         */
+        static long long currentTimeMillis();
+
+    private:
+
+        /**
+         * Enumerates the environment and return an array of strings
+         * with the values.  Caller owns the array.  The array is terminated
+         * by an element that holds the value NULL
+         * @returns a vector of env name=value paris.
+         */
+        static std::vector< std::string > getEnvArray();
+
+        /**
+         * Gets the one and only APR Pool instance
+         */
+        static internal::AprPool& getAprPool();
+
+    };
+
+}}
+
+#endif /*_DECAF_LANG_SYSTEM_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.cpp?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.cpp Tue Apr 29 13:52:30 2008
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+
+#include "Thread.h"
+
+#include <apr_time.h>
+#include <apr_portable.h>
+
+#include <decaf/lang/Exception.h>
+#include <decaf/lang/exceptions/RuntimeException.h>
+
+using namespace decaf;
+using namespace decaf::internal;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+Thread::Thread() {
+    this->task = this;
+    this->started = false;
+    this->joined = false;
+    this->threadHandle = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Thread::Thread( Runnable* task ) {
+    this->task = task;
+    this->started = false;
+    this->joined = false;
+    this->threadHandle = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Thread::~Thread(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Thread::start() throw ( Exception )
+{
+    if( this->started ) {
+        throw Exception(
+            __FILE__, __LINE__,
+            "Thread::start - Thread already started");
+    }
+
+    apr_status_t err = apr_thread_create(
+        &this->threadHandle,
+        NULL,
+        runCallback,
+        this,
+        pool.getAprPool() );
+
+    if( err != APR_SUCCESS ) {
+        throw Exception(
+            __FILE__, __LINE__,
+            "Thread::start - Coud not start thread");
+    }
+
+    // Mark the thread as started.
+    started = true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Thread::join() throw( Exception )
+{
+    if( !this->started ) {
+        throw Exception( __FILE__, __LINE__,
+            "Thread::join() called without having called Thread::start()");
+    }
+
+    if( !this->joined ) {
+        apr_status_t threadReturn;
+        if( apr_thread_join( &threadReturn, this->threadHandle ) != APR_SUCCESS ) {
+            throw Exception( __FILE__, __LINE__,
+                "Thread::join() - Failed to Join the Thread");
+        }
+    }
+    this->joined = true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Thread::sleep( int millisecs ) {
+    apr_sleep( (apr_interval_time_t)(millisecs * 1000) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned long Thread::getId() {
+    return (unsigned long)( apr_os_thread_current() );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void* APR_THREAD_FUNC Thread::runCallback( apr_thread_t* self, void* param ) {
+
+    // Get the instance.
+    Thread* thread = (Thread*)param;
+
+    // Invoke run on the task.
+    try{
+        thread->task->run();
+    } catch( ... ){
+        RuntimeException ex(
+            __FILE__, __LINE__,
+            "unhandled exception bubbled up to Thread::run");
+        ex.printStackTrace();
+    }
+
+    // Indicate we are done.
+    apr_thread_exit( self, APR_SUCCESS );
+    return NULL;
+}

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Thread.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,130 @@
+/*
+ * 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_LANG_THREAD_H_
+#define _DECAF_LANG_THREAD_H_
+
+#include <decaf/lang/Exception.h>
+#include <decaf/lang/Runnable.h>
+#include <decaf/util/Config.h>
+#include <stdexcept>
+#include <assert.h>
+
+#include <decaf/internal/AprPool.h>
+#include <apr_thread_proc.h>
+
+namespace decaf{
+namespace lang{
+
+    /**
+     * Basic thread class - mimics the Java Thread.  Derived classes may
+     * implement the run method, or this class can be used as is with
+     * a provided Runnable delegate.
+     */
+    class DECAF_API Thread : public Runnable
+    {
+    private:
+
+        /**
+         * The task to be run by this thread, defaults to
+         * this thread object.
+         */
+        Runnable* task;
+
+        /**
+         * APR Pool to allocate thread from
+         */
+        decaf::internal::AprPool pool;
+
+        /**
+         * APR Thread Handle
+         */
+        apr_thread_t* threadHandle;
+
+        /**
+         * Started state of this thread.
+         */
+        bool started;
+
+        /**
+         * Indicates whether the thread has already been
+         * joined.
+         */
+        bool joined;
+
+    public:
+
+        /**
+         * default Constructor
+         */
+        Thread();
+
+        /**
+         * Constructor
+         * @param task the Runnable that this thread manages
+         */
+        Thread( Runnable* task );
+
+        virtual ~Thread();
+
+        /**
+         * Creates a system thread and starts it in a joinable mode.
+         * Upon creation, the
+         * run() method of either this object or the provided Runnable
+         * object will be invoked in the context of this thread.
+         * @exception runtime_error is thrown if the system could
+         * not start the thread.
+         */
+        virtual void start() throw ( Exception );
+
+        /**
+         * Wait til the thread exits. This is when the run()
+         * method has returned or has thrown an exception.
+         */
+        virtual void join() throw ( Exception );
+
+        /**
+         * Default implementation of the run method - does nothing.
+         */
+        virtual void run(){};
+
+    public:
+
+        /**
+         * Halts execution of the calling thread for a specified no of millisec.
+         *
+         * Note that this method is a static method that applies to the
+         * calling thread and not to the thread object.
+         * @param millisecs time in milliseconds to sleep
+         */
+        static void sleep( int millisecs );
+
+        /**
+         * Obtains the Thread Id of the current thread
+         * @return Thread Id
+         */
+        static unsigned long getId();
+
+    private:
+
+        // Internal thread handling
+        static void* APR_THREAD_FUNC runCallback( apr_thread_t* self, void* param );
+
+    };
+
+}}
+
+#endif /*_DECAF_LANG_THREAD_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/Throwable.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Throwable.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Throwable.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Throwable.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,92 @@
+/*
+ * 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_LANG_THROWABLE_H_
+#define _DECAF_LANG_THROWABLE_H_
+
+// Includes
+#include <string>
+#include <vector>
+#include <iostream>
+#include <exception>
+
+#include <decaf/util/Config.h>
+
+namespace decaf{
+namespace lang{
+
+    /**
+     * This class represents an error that has occurred.
+     */
+    class DECAF_API Throwable : public std::exception {
+
+    public:
+
+        Throwable() throw() {}
+
+        virtual ~Throwable() throw() {}
+
+        /**
+         * Gets the cause of the error.
+         * @return string errors message
+         */
+        virtual std::string getMessage() const = 0;
+
+        /**
+         * Adds a file/line number to the stack trace.
+         * @param file The name of the file calling this method (use __FILE__).
+         * @param lineNumber The line number in the calling file (use __LINE__).
+         */
+        virtual void setMark( const char* file, const int lineNumber ) = 0;
+
+        /**
+         * 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 Copy of this Exception object
+         */
+        virtual Throwable* clone() const = 0;
+
+        /**
+         * Provides the stack trace for every point where
+         * this exception was caught, marked, and rethrown.
+         * @return vector containing stack trace strings
+         */
+        virtual std::vector< std::pair< std::string, int> > getStackTrace() const = 0;
+
+        /**
+         * Prints the stack trace to std::err
+         */
+        virtual void printStackTrace() const = 0;
+
+        /**
+         * Prints the stack trace to the given output stream.
+         * @param stream the target output stream.
+         */
+        virtual void printStackTrace( std::ostream& stream ) const = 0;
+
+        /**
+         * Gets the stack trace as one contiguous string.
+         * @return string with formatted stack trace data
+         */
+        virtual std::string getStackTraceString() const = 0;
+
+    };
+
+}}
+
+#endif /*_DECAF_LANG_THROWABLE_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/ExceptionDefines.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/ExceptionDefines.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/ExceptionDefines.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/ExceptionDefines.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,79 @@
+/*
+ * 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_LANG_EXCEPTIONS_EXCEPTIONDEFINES_H_
+#define _DECAF_LANG_EXCEPTIONS_EXCEPTIONDEFINES_H_
+
+/**
+ * Macro for catching and rethrowing an exception of
+ * a given type.
+ * @param type The type of the exception to throw
+ * (e.g. Exception ).
+ */
+#define DECAF_CATCH_RETHROW( type ) \
+    catch( type& ex ){ \
+        ex.setMark( __FILE__, __LINE__ ); \
+        throw ex; \
+    }
+
+/**
+ * Macro for catching an exception of one type and then rethrowing
+ * as another type.
+ * @param sourceType the type of the exception to be caught.
+ * @param targetType the type of the exception to be thrown.
+ */
+#define DECAF_CATCH_EXCEPTION_CONVERT( sourceType, targetType ) \
+    catch( sourceType& ex ){ \
+        targetType target( ex ); \
+        target.setMark( __FILE__, __LINE__ ); \
+        throw target; \
+    }
+
+/**
+ * A catch-all that throws a known exception.
+ * @param type the type of exception to be thrown.
+ */
+#define DECAF_CATCHALL_THROW( type ) \
+    catch( ... ){ \
+        type ex( __FILE__, __LINE__, \
+            "caught unknown exception" ); \
+        throw ex; \
+    }
+
+/**
+ * A catch-all that does not throw an exception, one use would
+ * be to catch any exception in a destructor and mark it, but not
+ * throw so that cleanup would continue as normal.
+ */
+#define DECAF_CATCHALL_NOTHROW( ) \
+    catch( ... ){ \
+        lang::Exception ex( __FILE__, __LINE__, \
+            "caught unknown exception, not rethrowing" ); \
+    }
+
+/**
+ * Macro for catching and rethrowing an exception of
+ * a given type.
+ * @param type The type of the exception to throw
+ * (e.g. Exception ).
+ */
+#define DECAF_CATCH_NOTHROW( type ) \
+    catch( type& ex ){ \
+        ex.setMark( __FILE__, __LINE__ ); \
+    }
+
+#endif /*_DECAF_LANG_EXCEPTIONS_EXCEPTIONDEFINES_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalArgumentException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalArgumentException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalArgumentException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalArgumentException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,96 @@
+/*
+ * 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_LANG_EXCEPTIONS_ILLEGALARGUMENTEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_ILLEGALARGUMENTEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an illegal argument was passed into a method.
+     */
+    class DECAF_API IllegalArgumentException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        IllegalArgumentException() throw() {}
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        IllegalArgumentException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        IllegalArgumentException( const IllegalArgumentException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        IllegalArgumentException(const char* file, const int lineNumber,
+            const char* msg, ...) throw()
+        : Exception()
+        {
+            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 Exception* clone() const{
+            return new IllegalArgumentException( *this );
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~IllegalArgumentException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_ILLEGALARGUMENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalMonitorStateException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalMonitorStateException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalMonitorStateException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalMonitorStateException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,94 @@
+/*
+ * 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_LANG_EXCEPTIONS_ILLEGALMONITORSTATEEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_ILLEGALMONITORSTATEEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+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 DECAF_API IllegalMonitorStateException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        IllegalMonitorStateException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        IllegalMonitorStateException(const Exception& ex) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        IllegalMonitorStateException(const IllegalMonitorStateException& ex) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        IllegalMonitorStateException( const char* file,
+                                      const int lineNumber,
+                                      const char* msg, ...) throw()
+        {
+            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 IllegalMonitorStateException* clone() const{
+            return new IllegalMonitorStateException(*this);
+        }
+
+        virtual ~IllegalMonitorStateException() throw() {}
+
+   };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_ILLEGALMONITORSTATEEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,95 @@
+/*
+ * 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_LANG_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+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 DECAF_API IllegalStateException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        IllegalStateException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        IllegalStateException(const Exception& ex) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        IllegalStateException(const IllegalStateException& ex) throw()
+        : Exception()
+        {
+            *(Exception*)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, ...) throw()
+        : Exception()
+        {
+            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 IllegalStateException* clone() const{
+            return new IllegalStateException(*this);
+        }
+
+        virtual ~IllegalStateException() throw() {}
+
+   };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,96 @@
+/*
+ * 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_LANG_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an illegal argument was passed into a method.
+     */
+    class DECAF_API IndexOutOfBoundsException : public Exception
+    {
+    public:
+
+      /**
+       * Default Constructor
+       */
+      IndexOutOfBoundsException() throw() {}
+
+      /**
+       * Conversion Constructor from some other Exception
+       * @param An exception that should become this type of Exception
+       */
+      IndexOutOfBoundsException( const Exception& ex ) throw()
+      : Exception()
+      {
+         *(Exception*)this = ex;
+      }
+
+      /**
+       * Copy Constructor
+       */
+      IndexOutOfBoundsException( const IndexOutOfBoundsException& ex ) throw()
+      : Exception()
+      {
+         *(Exception*)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, ...) throw()
+      : Exception()
+      {
+         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 IndexOutOfBoundsException* clone() const{
+         return new IndexOutOfBoundsException( *this );
+      }
+
+      /**
+       * Destructor
+       */
+      virtual ~IndexOutOfBoundsException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,94 @@
+/*
+ * 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_LANG_EXCEPTIONS_INTERRUPTEDENTEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_INTERRUPTEDENTEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an Thread is interrupted during a wait.
+     */
+    class DECAF_API InterruptedException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        InterruptedException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        InterruptedException(const Exception& ex) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        InterruptedException(const InterruptedException& ex) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        InterruptedException( const char* file,
+                              const int lineNumber,
+                              const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 InterruptedException* clone() const{
+            return new InterruptedException(*this);
+        }
+
+        virtual ~InterruptedException() throw() {}
+
+   };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_INTERRUPTEDENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,95 @@
+/*
+ * 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_LANG_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an operation is requested, but the state of the object
+     * servicing the request is not correct for that request.
+     */
+    class DECAF_API InvalidStateException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        InvalidStateException() throw() {}
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        InvalidStateException(const Exception& ex) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        InvalidStateException( const InvalidStateException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        InvalidStateException( const char* file,
+                               const int lineNumber,
+                               const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 InvalidStateException* clone() const{
+            return new InvalidStateException(*this);
+        }
+
+        virtual ~InvalidStateException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,95 @@
+/*
+ * 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_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown from an operation that attempts to access some element that does
+     * not exist.
+     */
+    class DECAF_API NoSuchElementException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        NoSuchElementException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        NoSuchElementException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        NoSuchElementException( const NoSuchElementException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        NoSuchElementException( const char* file,
+                                const int lineNumber,
+                                const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 NoSuchElementException* clone() const{
+            return new NoSuchElementException(*this);
+        }
+
+        virtual ~NoSuchElementException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,95 @@
+/*
+ * 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_LANG_EXCEPTIONS_NULLPOINTERENTEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_NULLPOINTERENTEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an error occurs that involves a pointer being NULL
+     */
+    class DECAF_API NullPointerException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        NullPointerException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        NullPointerException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        NullPointerException(const NullPointerException& ex) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        NullPointerException( const char* file,
+                              const int lineNumber,
+                              const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 NullPointerException* clone() const{
+            return new NullPointerException( *this );
+        }
+
+        virtual ~NullPointerException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_NULLPOINTERENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NumberFormatException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NumberFormatException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NumberFormatException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NumberFormatException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,93 @@
+/*
+ * 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_LANG_EXCEPTIONS_NUMBERFORMATEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_NUMBERFORMATEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an error occurs that involves a conversion to a Number from
+     * a string and the string is not a valid number.
+     */
+    class NumberFormatException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        NumberFormatException() {}
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        NumberFormatException( const Exception& ex ) throw()
+        : Exception() {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        NumberFormatException(const NumberFormatException& ex) throw()
+        : Exception() {
+            *(Exception*)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
+         */
+        NumberFormatException( const char* file,
+                               const int lineNumber,
+                               const char* msg, ... ) throw()
+        : Exception() {
+            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 NumberFormatException* clone() const {
+            return new NumberFormatException( *this );
+        }
+
+        virtual ~NumberFormatException() throw () {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_NUMBERFORMATEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,96 @@
+/*
+ * 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_LANG_EXCEPTIONS_RUNTIMEENTEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_RUNTIMEENTEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an error occurs that involves something in the run time
+     * This could be a memory allocation exception or some other generally
+     * unrecoverable exception.
+     */
+    class DECAF_API RuntimeException : public Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        RuntimeException() throw() {};
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        RuntimeException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        RuntimeException( const RuntimeException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        RuntimeException( const char* file,
+                          const int lineNumber,
+                          const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 RuntimeException* clone() const{
+            return new RuntimeException( *this );
+        }
+
+        virtual ~RuntimeException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_RUNTIMEENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h?rev=652104&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h (added)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h Tue Apr 29 13:52:30 2008
@@ -0,0 +1,94 @@
+/*
+ * 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_LANG_EXCEPTIONS_UNSUPPORTEDOPERATIONEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_UNSUPPORTEDOPERATIONEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace lang{
+namespace exceptions{
+
+    /*
+     * Thrown when an unsupported method is called.
+     */
+    class DECAF_API UnsupportedOperationException : public lang::Exception
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        UnsupportedOperationException() throw() {};
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        UnsupportedOperationException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        UnsupportedOperationException( const UnsupportedOperationException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)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
+         */
+        UnsupportedOperationException( const char* file,
+                                       const int lineNumber,
+                                       const char* msg, ... ) throw()
+        : Exception()
+        {
+            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 UnsupportedOperationException* clone() const{
+            return new UnsupportedOperationException( *this );
+        }
+
+        virtual ~UnsupportedOperationException() throw() {}
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_UNSUPPORTEDOPERATIONEXCEPTION_H_*/



Mime
View raw message