activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r733487 [2/10] - /activemq/activemq-cpp/trunk/src/main/activemq/commands/
Date Sun, 11 Jan 2009 16:36:05 GMT
Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMapMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMapMessage.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMapMessage.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMapMessage.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,347 @@
+/*
+ * 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_COMMANDS_ACTIVEMQMAPMESSAGE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQMAPMESSAGE_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQMessageBase.h>
+#include <activemq/util/PrimitiveMap.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <cms/MapMessage.h>
+#include <vector>
+#include <string>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQMapMessage :
+        public ActiveMQMessageBase<cms::MapMessage> {
+
+    private:
+
+        // Map Structure to hold unmarshalled Map Data
+        mutable util::PrimitiveMap* map;
+
+    public:
+
+        const static unsigned char ID_ACTIVEMQMAPMESSAGE = 25;
+
+    public:
+
+        ActiveMQMapMessage();
+        virtual ~ActiveMQMapMessage();
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Determine if this object is aware of marshaling and should have
+         * its before and after marshaling methods called.  Defaults to false.
+         * @returns true if aware of marshaling
+         */
+        virtual bool isMarshalAware() const {
+            return true;
+        }
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQMapMessage* cloneDataStructure() const {
+            ActiveMQMapMessage* message = new ActiveMQMapMessage();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQMessageBase<cms::MapMessage>::copyDataStructure( src );
+
+            const ActiveMQMapMessage* srcMap =
+                dynamic_cast< const ActiveMQMapMessage* >( src );
+
+            if( srcMap != NULL && srcMap->map != NULL ) {
+                this->map = new util::PrimitiveMap( *srcMap->map );
+            }
+        }
+
+        /**
+         * Perform any processing needed before an marshal
+         * @param wireformat - the OpenWireFormat object in use.
+         */
+        virtual void beforeMarshal( wireformat::WireFormat* wireFormat )
+            throw ( decaf::io::IOException );
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMapMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::MapMessage>::toString();
+            stream << "End Class = ActiveMQMapMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::MapMessage>::equals( value );
+        }
+
+    public:   // CMS Message
+
+        /**
+         * Clone this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual cms::MapMessage* clone() const {
+            return dynamic_cast<cms::MapMessage*>(
+                this->cloneDataStructure() );
+        }
+
+    public:   // CMS MapMessage
+
+        /**
+         * Returns an Enumeration of all the names in the MapMessage
+         * object.
+         * @return STL Vector of String values, each of which is the
+         *         name of an item in the MapMessage
+         * @throws CMSException
+         */
+        virtual std::vector<std::string> getMapNames() const;
+
+        /**
+         * Indicates whether an item exists in this MapMessage object.
+         * @param name - String name of the Object in question
+         * @return boolean value indicating if the name is in the map
+         */
+        virtual bool itemExists( const std::string& name ) const;
+
+        /**
+         * Returns the Boolean value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual bool getBoolean( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a boolean value with the specified name into the Map.
+         * @param name - the name of the boolean
+         * @param value - the boolean value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setBoolean( const std::string& name,
+                                 bool value ) throw( cms::CMSException );
+
+        /**
+         * Returns the Byte value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual unsigned char getByte( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Byte value with the specified name into the Map.
+         * @param name - the name of the Byte
+         * @param value - the Byte value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setByte( const std::string& name,
+                              unsigned char value )
+                                 throw( cms::CMSException );
+
+        /**
+         * Returns the Bytes value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual std::vector<unsigned char> getBytes( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Bytes value with the specified name into the Map.
+         * @param name - the name of the Bytes
+         * @param value - the Bytes value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setBytes( const std::string& name,
+                               const std::vector<unsigned char>& value )
+                                throw( cms::CMSException );
+
+        /**
+         * Returns the Char value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual char getChar( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Char value with the specified name into the Map.
+         * @param name - the name of the Char
+         * @param value - the Char value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setChar( const std::string& name, char value )
+            throw( cms::CMSException );
+
+        /**
+         * Returns the Double value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual double getDouble( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Double value with the specified name into the Map.
+         * @param name - the name of the Double
+         * @param value - the Double value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setDouble( const std::string& name,
+                                double value ) throw( cms::CMSException );
+
+        /**
+         * Returns the Float value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual float getFloat( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Float value with the specified name into the Map.
+         * @param name - the name of the Float
+         * @param value - the Float value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setFloat( const std::string& name, float value )
+            throw( cms::CMSException );
+
+        /**
+         * Returns the Int value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual int getInt( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Int value with the specified name into the Map.
+         * @param name - the name of the Int
+         * @param value - the Int value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setInt( const std::string& name, int value )
+            throw( cms::CMSException );
+
+        /**
+         * Returns the Long value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual long long getLong( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Long value with the specified name into the Map.
+         * @param name - the name of the Long
+         * @param value - the Long value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setLong( const std::string& name, long long value )
+            throw( cms::CMSException );
+
+        /**
+         * Returns the Short value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual short getShort( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a Short value with the specified name into the Map.
+         * @param name - the name of the Short
+         * @param value - the Short value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setShort( const std::string& name, short value )
+            throw( cms::CMSException );
+
+        /**
+         * Returns the String value of the Specified name
+         * @param name of the value to fetch from the map
+         * @throws CMSException
+         */
+        virtual std::string getString( const std::string& name ) const
+            throw( cms::CMSException );
+
+        /**
+         * Sets a String value with the specified name into the Map.
+         * @param name - the name of the String
+         * @param value - the String value to set in the Map
+         * @throws CMSException
+         */
+        virtual void setString( const std::string& name,
+                                const std::string& value )
+                                    throw( cms::CMSException );
+
+    protected:
+
+        /**
+         * Fetches a reference to this objects PrimitiveMap, if one needs
+         * to be created or unmarshaled, this will perform the correct steps.
+         * @returns reference to a PrimtiveMap.
+         */
+        util::PrimitiveMap& getMap() throw ( decaf::lang::exceptions::NullPointerException );
+        const util::PrimitiveMap& getMap() const throw ( decaf::lang::exceptions::NullPointerException );
+
+        /**
+         * Performs the unmarshal on the Map if needed, otherwise just returns
+         */
+        virtual void checkMapIsUnmarshalled() const
+            throw ( decaf::lang::exceptions::NullPointerException );
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQMAPMESSAGE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMapMessage.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,32 @@
+/*
+ * 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 <activemq/commands/ActiveMQMessage.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQMessage::ActiveMQMessage() :
+    ActiveMQMessageBase<cms::Message>()
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQMessage::getDataStructureType() const {
+    return ActiveMQMessage::ID_ACTIVEMQMESSAGE;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,102 @@
+/*
+ * 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_COMMANDS_ACTIVEMQMESSAGE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGE_H_
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQMessageBase.h>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQMessage :
+        public ActiveMQMessageBase<cms::Message> {
+
+    public:
+
+        static const unsigned char ID_ACTIVEMQMESSAGE = 23;
+
+    public:
+
+        ActiveMQMessage();
+        virtual ~ActiveMQMessage() {}
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQMessageBase<cms::Message>::copyDataStructure( src );
+        }
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQMessage* cloneDataStructure() const {
+            ActiveMQMessage* message = new ActiveMQMessage();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::Message>::toString();
+            stream << "Begin Class = ActiveMQMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::Message>::equals( value );
+        }
+
+    public:  // cms::Message
+
+        /**
+         * Clone this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual cms::Message* clone() const {
+            return dynamic_cast<cms::Message*>(
+                this->cloneDataStructure() );
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessage.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,742 @@
+/*
+ * 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_COMMANDS_ACTIVEMQMESSAGEBASE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGEBASE_H_
+
+#include <activemq/commands/Message.h>
+#include <activemq/core/ActiveMQAckHandler.h>
+#include <activemq/core/ActiveMQMessage.h>
+#include <activemq/util/PrimitiveMap.h>
+#include <activemq/util/Config.h>
+#include <activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h>
+#include <activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h>
+#include <activemq/wireformat/openwire/utils/MessagePropertyInterceptor.h>
+#include <cms/DeliveryMode.h>
+#include <decaf/util/Date.h>
+#include <memory>
+
+namespace activemq{
+namespace commands{
+
+    /**
+     * Base class for all Messages tagged with the ActiveMQXXXMessage
+     * type.  The class implements the basic wrapper around the generated
+     * Message class as well as satisfying the contract of the
+     * core::ActiveMQMessage interface and the cms::Message method of which
+     * T must be a derivation of.
+     */
+    template< typename T>
+    class AMQCPP_API ActiveMQMessageBase : public T,
+                                           public Message,
+                                           public core::ActiveMQMessage {
+    private:
+
+        core::ActiveMQAckHandler* ackHandler;
+        int redeliveryCount;
+        util::PrimitiveMap properties;
+        std::auto_ptr<wireformat::openwire::utils::MessagePropertyInterceptor> propertiesInterceptor;
+
+    public:
+
+        ActiveMQMessageBase() {
+            this->ackHandler = NULL;
+            this->redeliveryCount = 0;
+            this->propertiesInterceptor.reset(
+                new wireformat::openwire::utils::MessagePropertyInterceptor(
+                    this, &this->properties ) );
+        }
+
+        virtual ~ActiveMQMessageBase() {}
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            const ActiveMQMessageBase<T>* message =
+                dynamic_cast< const ActiveMQMessageBase<T>* >( src );
+
+            this->properties.copy( message->properties );
+            this->setAckHandler( message->getAckHandler() );
+            this->setRedeliveryCount( message->getRedeliveryCount() );
+
+            commands::Message::copyDataStructure( src );
+        }
+
+        /**
+         * Indicates that this command is aware of Marshalling, and needs
+         * to have its Marshalling methods invoked.
+         * @returns boolean indicating desire to be in marshalling stages
+         */
+        virtual bool isMarshalAware() const {
+            return true;
+        }
+
+        /**
+         * Handles the marshaling of the objects properties into the
+         * internal byte array before the object is marshaled to the
+         * wire
+         * @param wireFormat - the wireformat controller
+         */
+        virtual void beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )
+            throw ( decaf::io::IOException ) {
+
+            try{
+
+                marshalledProperties.clear();
+                if( !properties.isEmpty() )
+                {
+                    wireformat::openwire::marshal::PrimitiveMapMarshaller::marshal(
+                        &properties, marshalledProperties );
+                }
+            }
+            AMQ_CATCH_RETHROW( decaf::io::IOException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )
+            AMQ_CATCHALL_THROW( decaf::io::IOException )
+        }
+
+        /**
+         * Called after unmarshaling is started to cleanup the object being
+         * unmarshaled.
+         * @param wireFormat - the wireformat object to control unmarshaling
+         */
+        virtual void afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )
+            throw ( decaf::io::IOException ) {
+
+            try{
+
+                wireformat::openwire::marshal::PrimitiveMapMarshaller::unmarshal(
+                    &properties, marshalledProperties );
+            }
+            AMQ_CATCH_RETHROW( decaf::io::IOException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )
+            AMQ_CATCHALL_THROW( decaf::io::IOException )
+        }
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQMessageBase" << std::endl;
+            stream << " Value of ackHandler = " << ackHandler << std::endl;
+            stream << " Value of redeliveryCount = " << this->redeliveryCount << std::endl;
+            stream << " Value of properties = " << this->properties.toString() << std::endl;
+            stream << commands::Message::toString();
+            stream << "End Class = ActiveMQMessageBase" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+
+            const ActiveMQMessageBase<T>* valuePtr =
+                dynamic_cast< const ActiveMQMessageBase<T>* >( value );
+
+            if( value == NULL || valuePtr == NULL ) {
+                return false;
+            }
+
+            // Check this class's fields
+            if( ackHandler != valuePtr->getAckHandler() ){
+                return false;
+            }
+            if( redeliveryCount != valuePtr->getRedeliveryCount() ) {
+                return false;
+            }
+            if( !properties.equals( valuePtr->properties ) ) {
+                return false;
+            }
+
+            // Now check the base class
+            if( !commands::Message::equals( value ) ) {
+                return false;
+            }
+
+            return true;
+        }
+
+    public:   // core::ActiveMQMessage
+
+        /**
+         * Sets the Acknowledgment Handler that this Message will use
+         * when the Acknowledge method is called.
+         * @param handler ActiveMQAckHandler to call
+         */
+        virtual void setAckHandler( core::ActiveMQAckHandler* handler ) {
+            this->ackHandler = handler;
+        }
+
+        /**
+         * Gets the Acknowledgment Handler that this Message will use
+         * when the Acknowledge method is called.
+         * @returns handler ActiveMQAckHandler to call or NULL if not set
+         */
+        virtual core::ActiveMQAckHandler* getAckHandler() const {
+            return this->ackHandler;
+        }
+
+        /**
+         * Gets the number of times this message has been redelivered.
+         * @return redelivery count
+         */
+        virtual int getRedeliveryCount(void) const {
+            return redeliveryCount;
+        }
+
+        /**
+         * Sets the count of the number of times this message has been
+         * redelivered
+         * @param count the redelivery count
+         */
+        virtual void setRedeliveryCount( int count ) {
+            this->redeliveryCount = count;
+        }
+
+        /**
+         * Returns if this message has expired, meaning that its
+         * Expiration time has elapsed.
+         * @returns true if message is expired.
+         */
+        virtual bool isExpired() const {
+            long long expireTime = this->getCMSExpiration();
+            long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();
+            if( expireTime > 0 && currentTime > expireTime ) {
+                return true;
+            }
+            return false;
+        }
+
+    public:   // CMS Message
+
+        /**
+         * Acknowledges all consumed messages of the session
+         * of this consumed message.
+         */
+        virtual void acknowledge() const throw( cms::CMSException ) {
+            try{
+                this->getAckHandler()->acknowledgeMessage( this );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Clears out the body of the message.  This does not clear the
+         * headers or properties.
+         */
+        virtual void clearBody() {
+            this->setContent( std::vector<unsigned char>() );
+        }
+
+        /**
+         * Clears the message properties.  Does not clear the body or
+         * header values.
+         */
+        virtual void clearProperties() {
+            properties.clear();
+        }
+
+        /**
+         * Retrieves the property names.
+         * @return The complete set of property names currently in this
+         * message.
+         */
+        virtual std::vector<std::string> getPropertyNames() const {
+            return properties.getKeys();
+        }
+
+        /**
+         * Indicates whether or not a given property exists.
+         * @param name The name of the property to look up.
+         * @return True if the property exists in this message.
+         */
+        virtual bool propertyExists( const std::string& name ) const {
+            return properties.containsKey( name );
+        }
+
+        /**
+         * Gets a boolean property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual bool getBooleanProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getBooleanProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a byte property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual unsigned char getByteProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getByteProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a double property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual double getDoubleProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getDoubleProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a float property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual float getFloatProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getFloatProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a int property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual int getIntProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getIntProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a long property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual long long getLongProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getLongProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a short property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual short getShortProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getShortProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Gets a string property.
+         * @param name The name of the property to retrieve.
+         * @return The value for the named property.
+         * @throws CMSException if the property does not exist.
+         */
+        virtual std::string getStringProperty( const std::string& name ) const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->propertiesInterceptor->getStringProperty( name );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a boolean property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setBooleanProperty( const std::string& name,
+                                         bool value )
+                                            throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setBooleanProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a byte property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setByteProperty( const std::string& name,
+                                      unsigned char value )
+                                        throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setByteProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a double property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setDoubleProperty( const std::string& name,
+                                        double value )
+                                            throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setDoubleProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a float property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setFloatProperty( const std::string& name,
+                                       float value )
+                                        throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setFloatProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a int property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setIntProperty( const std::string& name,
+                                     int value )
+                                        throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setIntProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a long property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setLongProperty( const std::string& name,
+                                      long long value )
+                                        throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setLongProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a short property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setShortProperty( const std::string& name,
+                                       short value )
+                                        throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setShortProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Sets a string property.
+         * @param name The name of the property to retrieve.
+         * @param value The value for the named property.
+         * @throws CMSException
+         */
+        virtual void setStringProperty( const std::string& name,
+                                        const std::string& value )
+                                            throw( cms::CMSException ) {
+
+            try{
+                this->propertiesInterceptor->setStringProperty( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Get the Correlation Id for this message
+         * @return string representation of the correlation Id
+         */
+        virtual std::string getCMSCorrelationID() const {
+            return this->getCorrelationId();
+        }
+
+        /**
+         * Sets the Correlation Id used by this message
+         * @param correlationId - String representing the correlation id.
+         */
+        virtual void setCMSCorrelationID( const std::string& correlationId ) {
+            this->setCorrelationId( correlationId );
+        }
+
+        /**
+         * Gets the DeliveryMode for this message
+         * @return DeliveryMode enumerated value.
+         */
+        virtual int getCMSDeliveryMode() const {
+            return this->isPersistent();
+        }
+
+        /**
+         * Sets the DeliveryMode for this message
+         * @param mode - DeliveryMode enumerated value.
+         */
+        virtual void setCMSDeliveryMode( int mode ) {
+            this->setPersistent( mode == (int)cms::DeliveryMode::PERSISTENT );
+        }
+
+        /**
+         * Gets the Destination for this Message, returns a
+         * @return Destination object
+         */
+        virtual const cms::Destination* getCMSDestination(void) const {
+            return dynamic_cast<const cms::Destination*>(
+                this->getDestination() );
+        }
+
+        /**
+         * Sets the Destination for this message
+         * @param destination - Destination Object
+         */
+        virtual void setCMSDestination( const cms::Destination* destination ) {
+
+            delete getDestination();
+            if( destination != NULL ) {
+                this->setDestination(
+                    dynamic_cast<ActiveMQDestination*>(
+                        destination->clone() ) );
+            } else {
+                this->setDestination( NULL );
+            }
+        }
+
+        /**
+         * Gets the Expiration Time for this Message
+         * @return time value
+         */
+        virtual long long getCMSExpiration() const {
+            return this->getExpiration();
+        }
+
+        /**
+         * Sets the Expiration Time for this message
+         * @param expireTime - time value
+         */
+        virtual void setCMSExpiration( long long expireTime ) {
+            this->setExpiration( expireTime );
+        }
+
+        /**
+         * Gets the CMS Message Id for this Message
+         * @return time value
+         */
+        virtual std::string getCMSMessageID() const {
+            return wireformat::openwire::marshal::BaseDataStreamMarshaller::toString( this->getMessageId() );
+        }
+
+        /**
+         * Sets the CMS Message Id for this message
+         * @param id - time value
+         */
+        virtual void setCMSMessageID( const std::string& id AMQCPP_UNUSED) {}
+
+        /**
+         * Gets the Priority Value for this Message
+         * @return priority value
+         */
+        virtual int getCMSPriority() const {
+            return this->getPriority();
+        }
+
+        /**
+         * Sets the Priority Value for this message
+         * @param priority - priority value for this message
+         */
+        virtual void setCMSPriority( int priority ) {
+            this->setPriority( priority );
+        }
+
+        /**
+         * Gets the Redelivered Flag for this Message
+         * @return redelivered value
+         */
+        virtual bool getCMSRedelivered() const {
+            return this->getRedeliveryCounter() != 0;
+        }
+
+        /**
+         * Sets the Redelivered Flag for this message
+         * @param redelivered - boolean redelivered value
+         */
+        virtual void setCMSRedelivered( bool redelivered AMQCPP_UNUSED) {}
+
+        /**
+         * Gets the CMS Reply To Address for this Message
+         * @return Reply To Value
+         */
+        virtual const cms::Destination* getCMSReplyTo(void) const {
+            return dynamic_cast< const cms::Destination* >(
+                this->getReplyTo() );
+        }
+
+        /**
+         * Sets the CMS Reply To Address for this message
+         * @param id - Reply To value
+         */
+        virtual void setCMSReplyTo( const cms::Destination* destination ) {
+
+            delete getReplyTo();
+            if( destination != NULL ) {
+                this->setReplyTo(
+                    dynamic_cast<ActiveMQDestination*>(
+                        destination->clone() ) );
+            } else {
+                this->setReplyTo( NULL );
+            }
+        }
+
+        /**
+         * Gets the Time Stamp for this Message
+         * @return time stamp value
+         */
+        virtual long long getCMSTimestamp() const {
+            return this->getTimestamp();
+        }
+
+        /**
+         * Sets the Time Stamp for this message
+         * @param timeStamp - integer time stamp value
+         */
+        virtual void setCMSTimestamp( long long timeStamp ) {
+            this->setTimestamp( timeStamp );
+        }
+
+        /**
+         * Gets the CMS Message Type for this Message
+         * @return type value
+         */
+        virtual std::string getCMSType() const {
+            return this->getType();
+        }
+
+        /**
+         * Sets the CMS Message Type for this message
+         * @param type - message type value string
+         */
+        virtual void setCMSType( const std::string& type ) {
+            this->setType( type );
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGEBASE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,31 @@
+/*
+ * 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 <activemq/commands/ActiveMQObjectMessage.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQObjectMessage::ActiveMQObjectMessage() :
+    ActiveMQMessageBase<cms::ObjectMessage>() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQObjectMessage::getDataStructureType() const {
+    return ActiveMQObjectMessage::ID_ACTIVEMQOBJECTMESSAGE;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,108 @@
+/*
+ * 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_COMMANDS_ACTIVEMQOBJECTMESSAGE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQOBJECTMESSAGE_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/commands/ActiveMQMessageBase.h>
+#include <cms/ObjectMessage.h>
+#include <activemq/util/Config.h>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQObjectMessage :
+        public ActiveMQMessageBase<cms::ObjectMessage> {
+
+    public:
+
+        const static unsigned char ID_ACTIVEMQOBJECTMESSAGE = 26;
+
+    public:
+
+        ActiveMQObjectMessage();
+        virtual ~ActiveMQObjectMessage() {}
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQObjectMessage* cloneDataStructure() const {
+            ActiveMQObjectMessage* message = new ActiveMQObjectMessage();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQMessageBase<cms::ObjectMessage>::copyDataStructure( src );
+        }
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const{
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+            stream << ActiveMQMessageBase<cms::ObjectMessage>::toString();
+            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQMessageBase<cms::ObjectMessage>::equals( value );
+        }
+
+    public:  // cms::Message
+
+        /**
+         * Clone this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual cms::Message* clone() const {
+            return dynamic_cast<cms::Message*>(
+                this->cloneDataStructure() );
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQOBJECTMESSAGE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQObjectMessage.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,35 @@
+/*
+ * 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 <activemq/commands/ActiveMQQueue.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQQueue::ActiveMQQueue() : ActiveMQDestination()
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQQueue::ActiveMQQueue( const std::string& name ) :
+    ActiveMQDestination( name )
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQQueue::getDataStructureType() const {
+    return ActiveMQQueue::ID_ACTIVEMQQUEUE;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,174 @@
+/*
+ * 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_COMMANDS_ACTIVEMQQUEUE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQQUEUE_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQDestination.h>
+#include <activemq/exceptions/ActiveMQException.h>
+#include <decaf/lang/Exception.h>
+#include <cms/Queue.h>
+#include <vector>
+#include <string>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQQueue : public ActiveMQDestination,
+                                     public cms::Queue {
+    public:
+
+        const static unsigned char ID_ACTIVEMQQUEUE = 100;
+
+    public:
+
+        ActiveMQQueue();
+        ActiveMQQueue( const std::string& name );
+        virtual ~ActiveMQQueue() {}
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQQueue* cloneDataStructure() const {
+            ActiveMQQueue* message = new ActiveMQQueue();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQDestination::copyDataStructure( src );
+        }
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQQueue" << std::endl;
+            stream << ActiveMQDestination::toString();
+            stream << "End Class = ActiveMQQueue" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
+        /**
+         * @returns the cms::Destination interface pointer that the
+         *          objects that derive from this class implement.
+         */
+        virtual const cms::Destination* getCMSDestination() const {
+            return this;
+        }
+
+    public:   // CMS Destination
+
+        /**
+         * Retrieve the Destination Type for this Destination
+         * @return The Destination Type
+         */
+        virtual cms::Destination::DestinationType getDestinationType(void) const {
+            return cms::Destination::QUEUE;
+        }
+
+        /**
+         * Converts the Destination to a String value representing the
+         * Provider specific name fot this destination, which is not
+         * necessarily equal to the User Supplied name of the Destination
+         * @return Provider specific Name
+         */
+        virtual std::string toProviderString() const {
+            return this->getPhysicalName();
+        }
+
+        /**
+         * Creates a new instance of this destination type that is a
+         * copy of this one, and returns it.
+         * @returns cloned copy of this object
+         */
+        virtual cms::Destination* clone() const {
+            return dynamic_cast<cms::Destination*>(
+                this->cloneDataStructure() );
+        }
+
+        /**
+         * Copies the contents of the given Destinastion object to this one.
+         * @param source The source Destination object.
+         */
+        virtual void copy( const cms::Destination& source ) {
+            this->copyDataStructure(
+                dynamic_cast<const DataStructure*>( &source ) );
+        }
+
+        /**
+         * Retrieve any properties that might be part of the destination
+         * that was specified.  This is a deviation from the JMS spec
+         * but necessary due to C++ restrictions.
+         * @return const reference to a properties object.
+         */
+        virtual const cms::CMSProperties& getCMSProperties() const {
+            return this->getOptions();
+        }
+
+    public:  // CMS Queue
+
+        /**
+         * Gets the name of this queue.
+         * @return The queue name.
+         */
+        virtual std::string getQueueName() const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->getPhysicalName();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQQUEUE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQQueue.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,34 @@
+/*
+ * 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 <activemq/commands/ActiveMQStreamMessage.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQStreamMessage::ActiveMQStreamMessage() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQStreamMessage::~ActiveMQStreamMessage() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQStreamMessage::getDataStructureType() const {
+    return ActiveMQStreamMessage::ID_ACTIVEMQSTREAMMESSAGE;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,80 @@
+/*
+ * 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_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQMessage.h>
+#include <string>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQStreamMessage : public ActiveMQMessage {
+    public:
+
+        const static unsigned char ID_ACTIVEMQSTREAMMESSAGE = 27;
+
+    public:
+
+        ActiveMQStreamMessage();
+        virtual ~ActiveMQStreamMessage();
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQStreamMessage* cloneDataStructure() const {
+            ActiveMQStreamMessage* message = new ActiveMQStreamMessage();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQMessage::copyDataStructure( src );
+        }
+
+    public:  // ActiveMQMessage
+
+        /**
+         * Returns if this message has expired, meaning that its
+         * Expiration time has elapsed.
+         * @returns true if message is expired.
+         */
+        virtual bool isExpired() const {
+            return false;
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQStreamMessage.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 <activemq/commands/ActiveMQTempDestination.h>
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::exceptions;
+using namespace activemq::connector;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempDestination::ActiveMQTempDestination() :
+    ActiveMQDestination(),
+    connector( NULL ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempDestination::ActiveMQTempDestination( const std::string& name ) :
+    ActiveMQDestination( name ),
+    connector( NULL ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempDestination::~ActiveMQTempDestination() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQTempDestination::getDataStructureType() const {
+    return ActiveMQTempDestination::ID_ACTIVEMQTEMPDESTINATION;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,106 @@
+/*
+ * 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_COMMANDS_ACTIVEMQTEMPDESTINATION_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPDESTINATION_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQDestination.h>
+#include <activemq/connector/Connector.h>
+#include <activemq/connector/BaseConnectorResource.h>
+#include <cms/Closeable.h>
+#include <vector>
+#include <string>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQTempDestination : public ActiveMQDestination,
+                                               public connector::BaseConnectorResource {
+    protected:
+
+        /**
+         * Connector that we call back on close to allow this resource to
+         * be cleaned up correctly at this end and at the Broker End.
+         */
+        connector::Connector* connector;
+
+    public:
+
+        const static unsigned char ID_ACTIVEMQTEMPDESTINATION = 0;
+
+    public:
+
+        ActiveMQTempDestination();
+        ActiveMQTempDestination( const std::string& name );
+        virtual ~ActiveMQTempDestination();
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQTempDestination* cloneDataStructure() const {
+            return NULL;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQDestination::copyDataStructure( src );
+        }
+
+        /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQTempDestination" << std::endl;
+            stream << ActiveMQDestination::toString();
+            stream << "End Class = ActiveMQTempDestination" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQTEMPDESTINATION_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp Sun Jan 11 08:36:02 2009
@@ -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.
+ */
+#include <activemq/commands/ActiveMQTempQueue.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempQueue::ActiveMQTempQueue() : ActiveMQTempDestination() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempQueue::ActiveMQTempQueue( const std::string& name ) :
+    ActiveMQTempDestination( name )
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempQueue::~ActiveMQTempQueue() {
+    try {
+        this->close();
+    }
+    AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQTempQueue::getDataStructureType() const {
+    return ActiveMQTempQueue::ID_ACTIVEMQTEMPQUEUE;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.h?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.h Sun Jan 11 08:36:02 2009
@@ -0,0 +1,184 @@
+/*
+ * 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_COMMANDS_ACTIVEMQTEMPQUEUE_H_
+#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPQUEUE_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/util/Config.h>
+#include <activemq/commands/ActiveMQTempDestination.h>
+#include <cms/TemporaryQueue.h>
+#include <vector>
+#include <string>
+
+namespace activemq{
+namespace commands{
+
+    class AMQCPP_API ActiveMQTempQueue : public ActiveMQTempDestination,
+                                         public cms::TemporaryQueue {
+    public:
+
+        const static unsigned char ID_ACTIVEMQTEMPQUEUE = 102;
+
+    public:
+
+        ActiveMQTempQueue();
+        ActiveMQTempQueue( const std::string& name );
+        virtual ~ActiveMQTempQueue();
+
+        virtual unsigned char getDataStructureType() const;
+
+        /**
+         * Clone this object and return a new instance that the
+         * caller now owns, this will be an exact copy of this one
+         * @returns new copy of this object.
+         */
+        virtual ActiveMQTempQueue* cloneDataStructure() const {
+            ActiveMQTempQueue* message = new ActiveMQTempQueue();
+            message->copyDataStructure( this );
+            return message;
+        }
+
+        /**
+         * Copy the contents of the passed object into this objects
+         * members, overwriting any existing data.
+         * @return src - Source Object
+         */
+        virtual void copyDataStructure( const DataStructure* src ) {
+            ActiveMQTempDestination::copyDataStructure( src );
+        }
+
+        /**
+         * Converts the Destination Name into a String
+         * @return string name
+         */
+        virtual std::string toString(void) const {
+            std::ostringstream stream;
+
+            stream << "Begin Class = ActiveMQTempQueue" << std::endl;
+            stream << ActiveMQTempDestination::toString();
+            stream << "End Class = ActiveMQTempQueue" << std::endl;
+
+            return stream.str();
+        }
+
+        /**
+         * Compares the DataStructure passed in to this one, and returns if
+         * they are equivalent.  Equivalent here means that they are of the
+         * same type, and that each element of the objects are the same.
+         * @returns true if DataStructure's are Equal.
+         */
+        virtual bool equals( const DataStructure* value ) const {
+            return ActiveMQDestination::equals( value );
+        }
+
+        /**
+         * @returns the cms::Destination interface pointer that the
+         *          objects that derive from this class implement.
+         */
+        virtual const cms::Destination* getCMSDestination() const {
+            return this;
+        }
+
+    public:   // CMS Destination
+
+        /**
+         * Retrieve the Destination Type for this Destination
+         * @return The Destination Type
+         */
+        virtual cms::Destination::DestinationType getDestinationType() const {
+            return cms::Destination::TEMPORARY_QUEUE;
+        }
+
+        /**
+         * Converts the Destination to a String value representing the
+         * Provider specific name fot this destination, which is not
+         * necessarily equal to the User Supplied name of the Destination
+         * @return Provider specific Name
+         */
+        virtual std::string toProviderString() const {
+            return this->getPhysicalName();
+        }
+
+        /**
+         * Creates a new instance of this destination type that is a
+         * copy of this one, and returns it.
+         * @returns cloned copy of this object
+         */
+        virtual cms::Destination* clone() const {
+            return dynamic_cast<cms::Destination*>(
+                this->cloneDataStructure() );
+        }
+
+        /**
+         * Copies the contents of the given Destinastion object to this one.
+         * @param source The source Destination object.
+         */
+        virtual void copy( const cms::Destination& source ) {
+            this->copyDataStructure(
+                dynamic_cast<const DataStructure*>( &source ) );
+        }
+
+        /**
+         * Retrieve any properties that might be part of the destination
+         * that was specified.  This is a deviation from the JMS spec
+         * but necessary due to C++ restrictions.
+         * @return const reference to a properties object.
+         */
+        virtual const cms::CMSProperties& getCMSProperties() const {
+            return this->getOptions();
+        }
+
+    public:
+
+        /**
+         * Gets the name of this queue.
+         * @return The queue name.
+         */
+        virtual std::string getQueueName() const
+            throw( cms::CMSException ) {
+
+            try{
+                return this->getPhysicalName();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Destroy's the Temp Destination at the Broker
+         * @throws CMSException
+         */
+        virtual void destroy() throw ( cms::CMSException ) {
+            try{
+                close();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQTEMPQUEUE_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempTopic.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempTopic.cpp?rev=733487&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempTopic.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempTopic.cpp Sun Jan 11 08:36:02 2009
@@ -0,0 +1,44 @@
+/*
+ * 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 <activemq/commands/ActiveMQTempTopic.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempTopic::ActiveMQTempTopic() : ActiveMQTempDestination() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempTopic::ActiveMQTempTopic( const std::string& name ) :
+    ActiveMQTempDestination( name )
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempTopic::~ActiveMQTempTopic() {
+    try {
+        this->close();
+    }
+    AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ActiveMQTempTopic::getDataStructureType() const {
+    return ActiveMQTempTopic::ID_ACTIVEMQTEMPTOPIC;
+}
+

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempTopic.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message