activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419365 [7/25] - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/thread/ activemq-core/src/test/java/org/apache/activemq/openwire/v1/ activemq-cpp/src/main/activemq/concurrent/ activemq-cpp/src/main/activemq/co...
Date Wed, 05 Jul 2006 22:27:47 GMT
Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h Wed Jul  5 15:27:34 2006
@@ -1,185 +1,185 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_
-
-#include <activemq/connector/SessionInfo.h>
-#include <activemq/connector/ConsumerInfo.h>
-#include <activemq/transport/Transport.h>
-#include <activemq/concurrent/Mutex.h>
-#include <activemq/connector/ConnectorException.h>
-#include <activemq/connector/stomp/StompCommandListener.h>
-#include <activemq/connector/ConsumerMessageListener.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-    
-    /**
-     * The Stomp Session Manager is responsible for managing multiple
-     * Client Sessions.  The management involves routing messages to 
-     * sessions.  If more than one ActiveMQConsumer is created that is
-     * listening to the same Topic or Queue, then the messages that are
-     * received must be delivered to each of those sessions, and copied
-     * so that a transactional session can manage the lifetime of the
-     * message.
-     */
-    class StompSessionManager : public StompCommandListener
-    {
-    private:
-    
-        // Map Types
-        typedef std::map<unsigned int, ConsumerInfo*>  ConsumerMap;
-        typedef std::map<std::string, ConsumerMap>     DestinationMap;        
-
-    private:
-    
-        // Next id to be used for a Session Id
-        unsigned int nextSessionId;
-        
-        // Next id to be used for a Consumer Id
-        unsigned int nextConsumerId;
-        
-        // Mutex to protect ids.
-        concurrent::Mutex mutex;
-        
-        // Mapping of a Session to all the consumer's
-        DestinationMap destinationMap;
-        
-        // Transport that we use to find a transport for sending
-        // commands
-        transport::Transport* transport;
-        
-        // Consumer Message listener, we notify this whenever we receive 
-        // a new StompMessage type command.
-        ConsumerMessageListener* messageListener;
-        
-        // The global connection id
-        std::string connectionId;
-        
-    public:
-
-    	StompSessionManager( const std::string& connectionId, 
-                             transport::Transport* transport );
-    	virtual ~StompSessionManager(void);
-
-        /**
-         * Creates a new Session and returns a SessionInfo object whose
-         * lifetime is the property of the caller.
-         * @param the ackMode of the session.
-         * @return new SessionInfo object
-         */
-        virtual connector::SessionInfo* createSession(
-            cms::Session::AcknowledgeMode ackMode)
-                throw ( exceptions::ActiveMQException );
-
-        /**
-         * removes the specified Session from the Manager, all data that
-         * is associated with session consumers is now lost.  The session
-         * is not deleted here, it is the owner's responsibility.
-         * @param the session info for the session to remove.
-         */
-        virtual void removeSession( connector::SessionInfo* session )
-            throw ( exceptions::ActiveMQException );
-        
-        /**
-         * Creates a new consumer to the specified session, will subscribe
-         * to the destination if another consumer hasn't already been 
-         * subbed to that destination.  The returned consumer is the 
-         * owned by the caller and not deleted by this class.
-         * @param destination to subscribe to
-         * @param session to associate with
-         * @param selector string
-         * @return new ConsumerInfo object.
-         */
-        virtual connector::ConsumerInfo* createConsumer(
-            cms::Destination* destination, 
-            SessionInfo* session,
-            const std::string& selector)
-                throw( ConnectorException );
-
-        /**
-         * Creates a new durable consumer to the specified session, will 
-         * subscribe to the destination if another consumer hasn't already 
-         * been subbed to that destination.  The returned consumer is the 
-         * owned by the caller and not deleted by this class.
-         * @param Topic to subscribe to
-         * @param session to associate with
-         * @param Subscription Name
-         * @param selector string
-         * @param Should we be notified of messages we send.
-         * @return new ConsumerInfo object.
-         */
-        virtual connector::ConsumerInfo* createDurableConsumer(
-            cms::Destination* destination, 
-            SessionInfo* session,
-            const std::string& name,
-            const std::string& selector,
-            bool noLocal )
-                throw ( ConnectorException );
-
-        /**
-         * Removes the Consumer from the session, will unsubscrive if the
-         * consumer is the only one listeneing on this destination.  The
-         * Consumer is not deleted, just unassociated from the Manager
-         * caller is responsible for managing the lifetime.
-         * @param the ConsumerInfo for the consumer to remove
-         * @throws ConnectorException
-         */            
-        virtual void removeConsumer( connector::ConsumerInfo* consumer )
-            throw( ConnectorException );
-
-        /** 
-         * Sets the listener of consumer messages.
-         * @param listener the observer.
-         */
-        virtual void setConsumerMessageListener(
-            ConsumerMessageListener* listener )
-        {
-            this->messageListener = listener;
-        }
-
-    public:   // StompCommand Listener
-    
-        /**
-         * Process the Stomp Command
-         * @param command to process
-         * @throw ConnterException
-         */
-        virtual void onStompCommand( commands::StompCommand* command ) 
-            throw ( StompConnectorException );    
-            
-    protected:
-    
-        /**
-         * Gets the Next Session Id
-         * @return unique session id
-         */
-        virtual unsigned int getNextSessionId(void);
-        
-        /**
-         * Gets the Next Session Id
-         * @return unique session id
-         */
-        virtual unsigned int getNextConsumerId(void);
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_
+
+#include <activemq/connector/SessionInfo.h>
+#include <activemq/connector/ConsumerInfo.h>
+#include <activemq/transport/Transport.h>
+#include <activemq/concurrent/Mutex.h>
+#include <activemq/connector/ConnectorException.h>
+#include <activemq/connector/stomp/StompCommandListener.h>
+#include <activemq/connector/ConsumerMessageListener.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+    
+    /**
+     * The Stomp Session Manager is responsible for managing multiple
+     * Client Sessions.  The management involves routing messages to 
+     * sessions.  If more than one ActiveMQConsumer is created that is
+     * listening to the same Topic or Queue, then the messages that are
+     * received must be delivered to each of those sessions, and copied
+     * so that a transactional session can manage the lifetime of the
+     * message.
+     */
+    class StompSessionManager : public StompCommandListener
+    {
+    private:
+    
+        // Map Types
+        typedef std::map<unsigned int, ConsumerInfo*>  ConsumerMap;
+        typedef std::map<std::string, ConsumerMap>     DestinationMap;        
+
+    private:
+    
+        // Next id to be used for a Session Id
+        unsigned int nextSessionId;
+        
+        // Next id to be used for a Consumer Id
+        unsigned int nextConsumerId;
+        
+        // Mutex to protect ids.
+        concurrent::Mutex mutex;
+        
+        // Mapping of a Session to all the consumer's
+        DestinationMap destinationMap;
+        
+        // Transport that we use to find a transport for sending
+        // commands
+        transport::Transport* transport;
+        
+        // Consumer Message listener, we notify this whenever we receive 
+        // a new StompMessage type command.
+        ConsumerMessageListener* messageListener;
+        
+        // The global connection id
+        std::string connectionId;
+        
+    public:
+
+    	StompSessionManager( const std::string& connectionId, 
+                             transport::Transport* transport );
+    	virtual ~StompSessionManager(void);
+
+        /**
+         * Creates a new Session and returns a SessionInfo object whose
+         * lifetime is the property of the caller.
+         * @param the ackMode of the session.
+         * @return new SessionInfo object
+         */
+        virtual connector::SessionInfo* createSession(
+            cms::Session::AcknowledgeMode ackMode)
+                throw ( exceptions::ActiveMQException );
+
+        /**
+         * removes the specified Session from the Manager, all data that
+         * is associated with session consumers is now lost.  The session
+         * is not deleted here, it is the owner's responsibility.
+         * @param the session info for the session to remove.
+         */
+        virtual void removeSession( connector::SessionInfo* session )
+            throw ( exceptions::ActiveMQException );
+        
+        /**
+         * Creates a new consumer to the specified session, will subscribe
+         * to the destination if another consumer hasn't already been 
+         * subbed to that destination.  The returned consumer is the 
+         * owned by the caller and not deleted by this class.
+         * @param destination to subscribe to
+         * @param session to associate with
+         * @param selector string
+         * @return new ConsumerInfo object.
+         */
+        virtual connector::ConsumerInfo* createConsumer(
+            cms::Destination* destination, 
+            SessionInfo* session,
+            const std::string& selector)
+                throw( ConnectorException );
+
+        /**
+         * Creates a new durable consumer to the specified session, will 
+         * subscribe to the destination if another consumer hasn't already 
+         * been subbed to that destination.  The returned consumer is the 
+         * owned by the caller and not deleted by this class.
+         * @param Topic to subscribe to
+         * @param session to associate with
+         * @param Subscription Name
+         * @param selector string
+         * @param Should we be notified of messages we send.
+         * @return new ConsumerInfo object.
+         */
+        virtual connector::ConsumerInfo* createDurableConsumer(
+            cms::Destination* destination, 
+            SessionInfo* session,
+            const std::string& name,
+            const std::string& selector,
+            bool noLocal )
+                throw ( ConnectorException );
+
+        /**
+         * Removes the Consumer from the session, will unsubscrive if the
+         * consumer is the only one listeneing on this destination.  The
+         * Consumer is not deleted, just unassociated from the Manager
+         * caller is responsible for managing the lifetime.
+         * @param the ConsumerInfo for the consumer to remove
+         * @throws ConnectorException
+         */            
+        virtual void removeConsumer( connector::ConsumerInfo* consumer )
+            throw( ConnectorException );
+
+        /** 
+         * Sets the listener of consumer messages.
+         * @param listener the observer.
+         */
+        virtual void setConsumerMessageListener(
+            ConsumerMessageListener* listener )
+        {
+            this->messageListener = listener;
+        }
+
+    public:   // StompCommand Listener
+    
+        /**
+         * Process the Stomp Command
+         * @param command to process
+         * @throw ConnterException
+         */
+        virtual void onStompCommand( commands::StompCommand* command ) 
+            throw ( StompConnectorException );    
+            
+    protected:
+    
+        /**
+         * Gets the Next Session Id
+         * @return unique session id
+         */
+        virtual unsigned int getNextSessionId(void);
+        
+        /**
+         * Gets the Next Session Id
+         * @return unique session id
+         */
+        virtual unsigned int getNextConsumerId(void);
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONMANAGER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h Wed Jul  5 15:27:34 2006
@@ -1,74 +1,74 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_STOMPTOPIC_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPTOPIC_H_
-
-#include <activemq/connector/stomp/StompDestination.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <cms/Topic.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-    
-    class StompTopic : public StompDestination<cms::Topic>
-    {
-    public:
-
-        StompTopic(void) : StompDestination<cms::Topic>() {}
-
-        StompTopic(const std::string& name) : 
-            StompDestination< cms::Topic >( name, cms::Destination::TOPIC )
-        {}
-
-        virtual ~StompTopic(void) {}
-
-        /**
-         * Gets the name of this queue.
-         * @return The queue name.
-         */
-        virtual std::string getTopicName(void) const 
-            throw( cms::CMSException ) {
-                return toString();
-        }
-
-        /**
-         * 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(void) const {
-            return new StompTopic( toString() );
-        }
-
-    protected:
-
-        /**
-         * Retrieves the proper Stomp Prefix for the specified type
-         * of Destination
-         * @return string prefix
-         */
-        virtual std::string getPrefix(void) const {
-            return commands::CommandConstants::topicPrefix;
-        }
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPTOPIC_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_STOMPTOPIC_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPTOPIC_H_
+
+#include <activemq/connector/stomp/StompDestination.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <cms/Topic.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+    
+    class StompTopic : public StompDestination<cms::Topic>
+    {
+    public:
+
+        StompTopic(void) : StompDestination<cms::Topic>() {}
+
+        StompTopic(const std::string& name) : 
+            StompDestination< cms::Topic >( name, cms::Destination::TOPIC )
+        {}
+
+        virtual ~StompTopic(void) {}
+
+        /**
+         * Gets the name of this queue.
+         * @return The queue name.
+         */
+        virtual std::string getTopicName(void) const 
+            throw( cms::CMSException ) {
+                return toString();
+        }
+
+        /**
+         * 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(void) const {
+            return new StompTopic( toString() );
+        }
+
+    protected:
+
+        /**
+         * Retrieves the proper Stomp Prefix for the specified type
+         * of Destination
+         * @return string prefix
+         */
+        virtual std::string getPrefix(void) const {
+            return commands::CommandConstants::topicPrefix;
+        }
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPTOPIC_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h Wed Jul  5 15:27:34 2006
@@ -1,88 +1,88 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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_CONNECTOR_STOMPTRANSACTIONINFO_H_
-#define ACTIVEMQ_CONNECTOR_STOMPTRANSACTIONINFO_H_
-
-#include <activemq/connector/TransactionInfo.h>
-#include <activemq/connector/SessionInfo.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompTransactionInfo : public connector::TransactionInfo
-    {
-    private:
-    
-        // Transaction Id
-        unsigned int transactionId;
-        
-        // Session Info - We do not own this
-        const SessionInfo* session;
-        
-    public:
-
-        /**
-         * TransactionInfo Constructor
-         */
-        StompTransactionInfo(void) {
-            transactionId = 0;
-            session = NULL;
-        }
-
-        /**
-         * Destructor
-         */
-        virtual ~StompTransactionInfo(void) {}
-
-        /**
-         * Gets the Transction Id
-         * @return unsigned int Id
-         */
-        virtual unsigned int getTransactionId(void) const {
-            return transactionId;
-        }
-
-        /**
-         * Sets the Transction Id
-         * @param unsigned int Id
-         */
-        virtual void setTransactionId( const unsigned int id ) {
-            this->transactionId = id;
-        } 
-
-        /**
-         * Gets the Session Info that this Transction is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual const SessionInfo* getSessionInfo(void) const {
-            return session;
-        }
-        
-        /**
-         * Gets the Session Info that this Transction is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual void setSessionInfo( const SessionInfo* session ) {
-            this->session = session;
-        }
-
-    };
-
-}}}
-
-#endif /*ACTIVEMQ_CONNECTOR_STOMPTRANSACTIONINFO_H_*/
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed 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_CONNECTOR_STOMPTRANSACTIONINFO_H_
+#define ACTIVEMQ_CONNECTOR_STOMPTRANSACTIONINFO_H_
+
+#include <activemq/connector/TransactionInfo.h>
+#include <activemq/connector/SessionInfo.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompTransactionInfo : public connector::TransactionInfo
+    {
+    private:
+    
+        // Transaction Id
+        unsigned int transactionId;
+        
+        // Session Info - We do not own this
+        const SessionInfo* session;
+        
+    public:
+
+        /**
+         * TransactionInfo Constructor
+         */
+        StompTransactionInfo(void) {
+            transactionId = 0;
+            session = NULL;
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~StompTransactionInfo(void) {}
+
+        /**
+         * Gets the Transction Id
+         * @return unsigned int Id
+         */
+        virtual unsigned int getTransactionId(void) const {
+            return transactionId;
+        }
+
+        /**
+         * Sets the Transction Id
+         * @param unsigned int Id
+         */
+        virtual void setTransactionId( const unsigned int id ) {
+            this->transactionId = id;
+        } 
+
+        /**
+         * Gets the Session Info that this Transction is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual const SessionInfo* getSessionInfo(void) const {
+            return session;
+        }
+        
+        /**
+         * Gets the Session Info that this Transction is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual void setSessionInfo( const SessionInfo* session ) {
+            this->session = session;
+        }
+
+    };
+
+}}}
+
+#endif /*ACTIVEMQ_CONNECTOR_STOMPTRANSACTIONINFO_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h Wed Jul  5 15:27:34 2006
@@ -1,85 +1,85 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_
-
-#include <activemq/connector/stomp/commands/AbstractCommand.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <activemq/transport/Command.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    /**
-     * Represents the Stomp Abort Command which rolls back a
-     * transaction in progress.
-     */
-    class AbortCommand : public AbstractCommand< transport::Command >
-    {
-    public:
-
-        AbortCommand(void) :
-            AbstractCommand<transport::Command>() {
-                initialize( getFrame() );
-        }
-        AbortCommand( StompFrame* frame ) : 
-            AbstractCommand<transport::Command>(frame) {
-                validate( getFrame() );
-        }
-        virtual ~AbortCommand(void) {}
-        
-    protected:
-    
-        /**
-         * Inheritors are required to override this method to init the
-         * frame with data appropriate for the command type.
-         * @param Frame to init
-         */
-        virtual void initialize( StompFrame& frame )
-        {
-            frame.setCommand( CommandConstants::toString(
-                CommandConstants::ABORT ) );
-        }
-
-        /**
-         * Inheritors are required to override this method to validate 
-         * the passed stomp frame before it is marshalled or unmarshaled
-         * @param Frame to validate
-         * @returns true if frame is valid
-         */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if((frame.getCommand() == 
-                CommandConstants::toString( CommandConstants::ABORT ) ) &&
-               (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_
+
+#include <activemq/connector/stomp/commands/AbstractCommand.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <activemq/transport/Command.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    /**
+     * Represents the Stomp Abort Command which rolls back a
+     * transaction in progress.
+     */
+    class AbortCommand : public AbstractCommand< transport::Command >
+    {
+    public:
+
+        AbortCommand(void) :
+            AbstractCommand<transport::Command>() {
+                initialize( getFrame() );
+        }
+        AbortCommand( StompFrame* frame ) : 
+            AbstractCommand<transport::Command>(frame) {
+                validate( getFrame() );
+        }
+        virtual ~AbortCommand(void) {}
+        
+    protected:
+    
+        /**
+         * Inheritors are required to override this method to init the
+         * frame with data appropriate for the command type.
+         * @param Frame to init
+         */
+        virtual void initialize( StompFrame& frame )
+        {
+            frame.setCommand( CommandConstants::toString(
+                CommandConstants::ABORT ) );
+        }
+
+        /**
+         * Inheritors are required to override this method to validate 
+         * the passed stomp frame before it is marshalled or unmarshaled
+         * @param Frame to validate
+         * @returns true if frame is valid
+         */
+        virtual bool validate( const StompFrame& frame ) const
+        {
+            if((frame.getCommand() == 
+                CommandConstants::toString( CommandConstants::ABORT ) ) &&
+               (frame.getProperties().hasProperty(
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h Wed Jul  5 15:27:34 2006
@@ -1,280 +1,280 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
-
-#include <activemq/connector/stomp/StompFrame.h>
-#include <activemq/connector/stomp/commands/StompCommand.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/util/Integer.h>
-#include <activemq/util/Long.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-    
-    /**
-     * Interface for all Stomp commands.  Commands wrap
-     * around a stomp frame and provide their own marshalling
-     * to and from frames.  Stomp frame objects are dumb and have
-     * a generic interface that becomes cumbersome to use directly.
-     * Commands help to abstract the stomp frame by providing a
-     * more user-friendly interface to the frame content.  
-     */
-    
-    template<typename T>
-    class AbstractCommand
-    : 
-        public StompCommand,
-        public T
-    {
-    protected:
-    
-        // Frame that contains the actual message
-        StompFrame* frame;
-
-    protected:
-    
-        StompFrame& getFrame(void) {
-            if( frame == NULL ){
-                throw exceptions::NullPointerException(
-                    __FILE__, __LINE__,
-                    "AbstractCommand::getFrame - Frame not initialized");
-            }
-
-            return *frame;
-        }
-        
-        const StompFrame& getFrame(void) const {
-            if( frame == NULL ){
-                throw exceptions::NullPointerException(
-                    __FILE__, __LINE__,
-                    "AbstractCommand::getFrame - Frame not initialized");
-            }
-
-            return *frame;
-        }
-        
-        void destroyFrame(void)
-        {
-            if( frame != NULL ){
-                delete frame;
-                frame = NULL;
-            }
-        }
-    
-        const char* getPropertyValue( const std::string& name ) const{
-            return getFrame().getProperties().getProperty( name );
-        }
-
-        const std::string getPropertyValue( 
-            const std::string& name, 
-            const std::string& defReturn ) const {
-            return getFrame().getProperties().getProperty( 
-                name, defReturn );
-        }
-        
-        void setPropertyValue( const std::string& name, const std::string& value ){
-            getFrame().getProperties().setProperty( name, value );
-        }
-        
-        /**
-         * Inheritors are required to override this method to init the
-         * frame with data appropriate for the command type.
-         * @param Frame to init
-         */
-        virtual void initialize( StompFrame& frame ) = 0;
-
-        /**
-         * Inheritors are required to override this method to validate 
-         * the passed stomp frame before it is marshalled or unmarshaled
-         * @param Frame to validate
-         * @returns true if frame is valid
-         */
-        virtual bool validate( const StompFrame& frame ) const = 0;
-        
-    public:
-    
-        AbstractCommand(void){ 
-            frame = new StompFrame;
-        }
-        AbstractCommand(StompFrame* frame){ 
-            this->frame = frame;
-        }
-        virtual ~AbstractCommand(void){
-            destroyFrame();
-        }
-        
-        /**
-         * Sets the Command Id of this Message
-         * @param Command Id
-         */
-        virtual void setCommandId( const unsigned int id ){
-            setPropertyValue(
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_REQUESTID),
-                 util::Integer::toString( id ) );
-        }
-
-        /**
-         * Gets the Command Id of this Message
-         * @return Command Id
-         */
-        virtual unsigned int getCommandId(void) const {
-            return util::Integer::parseInt(
-                getPropertyValue(
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_REQUESTID ),
-                    "0" ) );
-        }
-        
-        /**
-         * Set if this Message requires a Response
-         * @param true if response is required
-         */
-        virtual void setResponseRequired( const bool required ) {
-        }
-        
-        /**
-         * Is a Response required for this Command
-         * @return true if a response is required.
-         */
-        virtual bool isResponseRequired(void) const {
-            return frame->getProperties().hasProperty( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_REQUESTID) );
-        }
-        
-        /**
-         * Gets the Correlation Id that is associated with this message
-         * @return the Correlation Id
-         */
-        virtual unsigned int getCorrelationId(void) const {
-            return util::Integer::parseInt(
-                getPropertyValue(
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_RESPONSEID ),
-                     "0" ) );
-        }
-
-        /**
-         * Sets the Correlation Id if this Command
-         * @param Id
-         */
-        virtual void setCorrelationId( const unsigned int corrId ) {
-            setPropertyValue(
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_RESPONSEID),
-                 util::Integer::toString( corrId ) );
-        }
-        
-        /**
-         * Get the Transaction Id of this Command
-         * @return the Id of the Transaction
-         */      
-        virtual const char* getTransactionId(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_TRANSACTIONID) );
-        }
-      
-        /**
-         * Set the Transaction Id of this Command
-         * @param the Id of the Transaction
-         */
-        virtual void setTransactionId( const std::string& id ){
-            setPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_TRANSACTIONID),
-                id );
-        }  
-
-        /**
-         * Retrieve the Stomp Command Id for this message.
-         * @return Stomp CommandId enum
-         */
-        virtual CommandConstants::CommandId getStompCommandId(void) const {
-            return CommandConstants::toCommandId(
-                getFrame().getCommand() );
-        }
-        
-        /**
-         * Marshals the command to a stomp frame.
-         * @returns the stomp frame representation of this
-         * command.
-         * @throws MarshalException if the command is not
-         * in a state that can be marshaled.
-         */
-        virtual const StompFrame& marshal(void) const 
-            throw (marshal::MarshalException)
-        {
-            if( frame == NULL || !validate( *frame ) ){
-                throw marshal::MarshalException( 
-                    __FILE__, __LINE__,
-                    "AbstractCommand::marshal() - frame invalid" );
-            }
-            
-            return getFrame();
-        }
-
-    protected:
-
-        /**
-         * Fetch the number of bytes in the Stomp Frame Body
-         * @return number of bytes
-         */
-        virtual unsigned long getNumBytes(void) const{
-            return getFrame().getBodyLength();
-        }
-
-        /**
-         * Returns a char array of bytes that are contained in the message
-         * @param pointer to array of bytes.
-         */
-        virtual const char* getBytes(void) const{
-            return getFrame().getBody();
-        }
-    
-        /**
-         * Set the bytes that are to be sent in the body of this message
-         * the content length flag indicates if the Content Length header
-         * should be set.
-         * @param bytes to store
-         * @param number of bytes to pull from the bytes buffer
-         * @param true if the content length header should be set
-         */
-        virtual void setBytes( const char* bytes, 
-                               const unsigned long numBytes,
-                               const bool setContentLength = true )
-        {
-            char* copy = new char[numBytes];
-            memcpy( copy, bytes, numBytes );
-            getFrame().setBody( copy, numBytes );
-            if( setContentLength )
-            {
-                setPropertyValue( 
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_CONTENTLENGTH),
-                    util::Long::toString( numBytes ) );
-            }
-        }
-    };
-    
-}}}}
-
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
+#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
+
+#include <activemq/connector/stomp/StompFrame.h>
+#include <activemq/connector/stomp/commands/StompCommand.h>
+#include <activemq/exceptions/NullPointerException.h>
+#include <activemq/util/Integer.h>
+#include <activemq/util/Long.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+    
+    /**
+     * Interface for all Stomp commands.  Commands wrap
+     * around a stomp frame and provide their own marshalling
+     * to and from frames.  Stomp frame objects are dumb and have
+     * a generic interface that becomes cumbersome to use directly.
+     * Commands help to abstract the stomp frame by providing a
+     * more user-friendly interface to the frame content.  
+     */
+    
+    template<typename T>
+    class AbstractCommand
+    : 
+        public StompCommand,
+        public T
+    {
+    protected:
+    
+        // Frame that contains the actual message
+        StompFrame* frame;
+
+    protected:
+    
+        StompFrame& getFrame(void) {
+            if( frame == NULL ){
+                throw exceptions::NullPointerException(
+                    __FILE__, __LINE__,
+                    "AbstractCommand::getFrame - Frame not initialized");
+            }
+
+            return *frame;
+        }
+        
+        const StompFrame& getFrame(void) const {
+            if( frame == NULL ){
+                throw exceptions::NullPointerException(
+                    __FILE__, __LINE__,
+                    "AbstractCommand::getFrame - Frame not initialized");
+            }
+
+            return *frame;
+        }
+        
+        void destroyFrame(void)
+        {
+            if( frame != NULL ){
+                delete frame;
+                frame = NULL;
+            }
+        }
+    
+        const char* getPropertyValue( const std::string& name ) const{
+            return getFrame().getProperties().getProperty( name );
+        }
+
+        const std::string getPropertyValue( 
+            const std::string& name, 
+            const std::string& defReturn ) const {
+            return getFrame().getProperties().getProperty( 
+                name, defReturn );
+        }
+        
+        void setPropertyValue( const std::string& name, const std::string& value ){
+            getFrame().getProperties().setProperty( name, value );
+        }
+        
+        /**
+         * Inheritors are required to override this method to init the
+         * frame with data appropriate for the command type.
+         * @param Frame to init
+         */
+        virtual void initialize( StompFrame& frame ) = 0;
+
+        /**
+         * Inheritors are required to override this method to validate 
+         * the passed stomp frame before it is marshalled or unmarshaled
+         * @param Frame to validate
+         * @returns true if frame is valid
+         */
+        virtual bool validate( const StompFrame& frame ) const = 0;
+        
+    public:
+    
+        AbstractCommand(void){ 
+            frame = new StompFrame;
+        }
+        AbstractCommand(StompFrame* frame){ 
+            this->frame = frame;
+        }
+        virtual ~AbstractCommand(void){
+            destroyFrame();
+        }
+        
+        /**
+         * Sets the Command Id of this Message
+         * @param Command Id
+         */
+        virtual void setCommandId( const unsigned int id ){
+            setPropertyValue(
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_REQUESTID),
+                 util::Integer::toString( id ) );
+        }
+
+        /**
+         * Gets the Command Id of this Message
+         * @return Command Id
+         */
+        virtual unsigned int getCommandId(void) const {
+            return util::Integer::parseInt(
+                getPropertyValue(
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_REQUESTID ),
+                    "0" ) );
+        }
+        
+        /**
+         * Set if this Message requires a Response
+         * @param true if response is required
+         */
+        virtual void setResponseRequired( const bool required ) {
+        }
+        
+        /**
+         * Is a Response required for this Command
+         * @return true if a response is required.
+         */
+        virtual bool isResponseRequired(void) const {
+            return frame->getProperties().hasProperty( 
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_REQUESTID) );
+        }
+        
+        /**
+         * Gets the Correlation Id that is associated with this message
+         * @return the Correlation Id
+         */
+        virtual unsigned int getCorrelationId(void) const {
+            return util::Integer::parseInt(
+                getPropertyValue(
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_RESPONSEID ),
+                     "0" ) );
+        }
+
+        /**
+         * Sets the Correlation Id if this Command
+         * @param Id
+         */
+        virtual void setCorrelationId( const unsigned int corrId ) {
+            setPropertyValue(
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_RESPONSEID),
+                 util::Integer::toString( corrId ) );
+        }
+        
+        /**
+         * Get the Transaction Id of this Command
+         * @return the Id of the Transaction
+         */      
+        virtual const char* getTransactionId(void) const{
+            return getPropertyValue( 
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_TRANSACTIONID) );
+        }
+      
+        /**
+         * Set the Transaction Id of this Command
+         * @param the Id of the Transaction
+         */
+        virtual void setTransactionId( const std::string& id ){
+            setPropertyValue( 
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_TRANSACTIONID),
+                id );
+        }  
+
+        /**
+         * Retrieve the Stomp Command Id for this message.
+         * @return Stomp CommandId enum
+         */
+        virtual CommandConstants::CommandId getStompCommandId(void) const {
+            return CommandConstants::toCommandId(
+                getFrame().getCommand() );
+        }
+        
+        /**
+         * Marshals the command to a stomp frame.
+         * @returns the stomp frame representation of this
+         * command.
+         * @throws MarshalException if the command is not
+         * in a state that can be marshaled.
+         */
+        virtual const StompFrame& marshal(void) const 
+            throw (marshal::MarshalException)
+        {
+            if( frame == NULL || !validate( *frame ) ){
+                throw marshal::MarshalException( 
+                    __FILE__, __LINE__,
+                    "AbstractCommand::marshal() - frame invalid" );
+            }
+            
+            return getFrame();
+        }
+
+    protected:
+
+        /**
+         * Fetch the number of bytes in the Stomp Frame Body
+         * @return number of bytes
+         */
+        virtual unsigned long getNumBytes(void) const{
+            return getFrame().getBodyLength();
+        }
+
+        /**
+         * Returns a char array of bytes that are contained in the message
+         * @param pointer to array of bytes.
+         */
+        virtual const char* getBytes(void) const{
+            return getFrame().getBody();
+        }
+    
+        /**
+         * Set the bytes that are to be sent in the body of this message
+         * the content length flag indicates if the Content Length header
+         * should be set.
+         * @param bytes to store
+         * @param number of bytes to pull from the bytes buffer
+         * @param true if the content length header should be set
+         */
+        virtual void setBytes( const char* bytes, 
+                               const unsigned long numBytes,
+                               const bool setContentLength = true )
+        {
+            char* copy = new char[numBytes];
+            memcpy( copy, bytes, numBytes );
+            getFrame().setBody( copy, numBytes );
+            if( setContentLength )
+            {
+                setPropertyValue( 
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_CONTENTLENGTH),
+                    util::Long::toString( numBytes ) );
+            }
+        }
+    };
+    
+}}}}
+
+#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h Wed Jul  5 15:27:34 2006
@@ -1,113 +1,113 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_
-#define _ACTIVEMQ_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_
-
-#include <activemq/connector/stomp/commands/AbstractCommand.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <activemq/transport/Command.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    /**
-     * Stomp Command that Represents Acknowledgement of a message
-     * receive.  The Ack Command has one required attribute, message
-     * Id.  For each message sent to the client from the broker, the
-     * message will not be considered consumed until an Ack is sent.  
-     * Optionally a Transaction Id can be set that indicates that the
-     * message acknowledgement should be part of a named transaction.
-     */
-    class AckCommand : public AbstractCommand< transport::Command >
-    {
-    public:
-
-        AckCommand(void) :
-            AbstractCommand<transport::Command>() {
-                initialize( getFrame() );
-        }
-        AckCommand( StompFrame* frame ) : 
-            AbstractCommand<transport::Command>(frame) {
-                validate( getFrame() );
-        }
-        virtual ~AckCommand(void) {}
-      
-        /**
-         * Get the Message Id of this Command
-         * @return the Id of the Message
-         */      
-        virtual const char* getMessageId(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_MESSAGEID) );
-        }
-      
-        /**
-         * Set the Message Id that this Ack is associated with
-         * @param the Message Id
-         */
-        virtual void setMessageId(const std::string& messageId){
-            setPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_MESSAGEID),
-                messageId );
-        }
-
-    protected:
-    
-        /**
-         * Inheritors are required to override this method to init the
-         * frame with data appropriate for the command type.
-         * @param Frame to init
-         */
-        virtual void initialize( StompFrame& frame )
-        {
-            frame.setCommand( CommandConstants::toString(
-                CommandConstants::ACK ) );
-        }
-
-        /**
-         * Inheritors are required to override this method to validate 
-         * the passed stomp frame before it is marshalled or unmarshaled
-         * @param Frame to validate
-         * @returns true if frame is valid
-         */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if((frame.getCommand() == 
-                CommandConstants::toString( CommandConstants::ACK )) &&
-               (frame.getProperties().hasProperty(
-                   CommandConstants::toString( 
-                       CommandConstants::HEADER_TRANSACTIONID ) ) &&
-               (frame.getProperties().hasProperty(
-                   CommandConstants::toString( 
-                       CommandConstants::HEADER_MESSAGEID ) ) ) ) );
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_
+#define _ACTIVEMQ_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_
+
+#include <activemq/connector/stomp/commands/AbstractCommand.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <activemq/transport/Command.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    /**
+     * Stomp Command that Represents Acknowledgement of a message
+     * receive.  The Ack Command has one required attribute, message
+     * Id.  For each message sent to the client from the broker, the
+     * message will not be considered consumed until an Ack is sent.  
+     * Optionally a Transaction Id can be set that indicates that the
+     * message acknowledgement should be part of a named transaction.
+     */
+    class AckCommand : public AbstractCommand< transport::Command >
+    {
+    public:
+
+        AckCommand(void) :
+            AbstractCommand<transport::Command>() {
+                initialize( getFrame() );
+        }
+        AckCommand( StompFrame* frame ) : 
+            AbstractCommand<transport::Command>(frame) {
+                validate( getFrame() );
+        }
+        virtual ~AckCommand(void) {}
+      
+        /**
+         * Get the Message Id of this Command
+         * @return the Id of the Message
+         */      
+        virtual const char* getMessageId(void) const{
+            return getPropertyValue( 
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_MESSAGEID) );
+        }
+      
+        /**
+         * Set the Message Id that this Ack is associated with
+         * @param the Message Id
+         */
+        virtual void setMessageId(const std::string& messageId){
+            setPropertyValue( 
+                CommandConstants::toString( 
+                    CommandConstants::HEADER_MESSAGEID),
+                messageId );
+        }
+
+    protected:
+    
+        /**
+         * Inheritors are required to override this method to init the
+         * frame with data appropriate for the command type.
+         * @param Frame to init
+         */
+        virtual void initialize( StompFrame& frame )
+        {
+            frame.setCommand( CommandConstants::toString(
+                CommandConstants::ACK ) );
+        }
+
+        /**
+         * Inheritors are required to override this method to validate 
+         * the passed stomp frame before it is marshalled or unmarshaled
+         * @param Frame to validate
+         * @returns true if frame is valid
+         */
+        virtual bool validate( const StompFrame& frame ) const
+        {
+            if((frame.getCommand() == 
+                CommandConstants::toString( CommandConstants::ACK )) &&
+               (frame.getProperties().hasProperty(
+                   CommandConstants::toString( 
+                       CommandConstants::HEADER_TRANSACTIONID ) ) &&
+               (frame.getProperties().hasProperty(
+                   CommandConstants::toString( 
+                       CommandConstants::HEADER_MESSAGEID ) ) ) ) );
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNCETOR_STOMP_COMMANDS_ACKCOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h Wed Jul  5 15:27:34 2006
@@ -1,90 +1,90 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_
-
-#include <activemq/connector/stomp/commands/AbstractCommand.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <activemq/transport/Command.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-    
-    /**
-     * Begins a Transaction.  Transactions in this case apply to
-     * sending and acknowledging -- any messages sent or acknowledged
-     * during a transaction will be handled atomically based on the
-     * transaction.
-     * 
-     * A transaction Identifier is required and this id will be used
-     * for all sends, commits, aborts, or acks.
-     */
-    class BeginCommand : public AbstractCommand< transport::Command >
-    {
-    public:
-   
-        BeginCommand(void) :
-            AbstractCommand<transport::Command>() {
-                initialize( getFrame() );
-        }
-        BeginCommand( StompFrame* frame ) : 
-            AbstractCommand<transport::Command>(frame) {
-                validate( getFrame() );
-        }
-        virtual ~BeginCommand(void) {}
-
-    protected:
-    
-        /**
-         * Inheritors are required to override this method to init the
-         * frame with data appropriate for the command type.
-         * @param Frame to init
-         */
-        virtual void initialize( StompFrame& frame )
-        {
-            frame.setCommand( CommandConstants::toString(
-                CommandConstants::BEGIN ) );
-        }
-
-        /**
-         * Inheritors are required to override this method to validate 
-         * the passed stomp frame before it is marshalled or unmarshaled
-         * @param Frame to validate
-         * @returns true if frame is valid
-         */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if((frame.getCommand() == 
-                CommandConstants::toString( CommandConstants::BEGIN )) &&
-               (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_
+
+#include <activemq/connector/stomp/commands/AbstractCommand.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <activemq/transport/Command.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+    
+    /**
+     * Begins a Transaction.  Transactions in this case apply to
+     * sending and acknowledging -- any messages sent or acknowledged
+     * during a transaction will be handled atomically based on the
+     * transaction.
+     * 
+     * A transaction Identifier is required and this id will be used
+     * for all sends, commits, aborts, or acks.
+     */
+    class BeginCommand : public AbstractCommand< transport::Command >
+    {
+    public:
+   
+        BeginCommand(void) :
+            AbstractCommand<transport::Command>() {
+                initialize( getFrame() );
+        }
+        BeginCommand( StompFrame* frame ) : 
+            AbstractCommand<transport::Command>(frame) {
+                validate( getFrame() );
+        }
+        virtual ~BeginCommand(void) {}
+
+    protected:
+    
+        /**
+         * Inheritors are required to override this method to init the
+         * frame with data appropriate for the command type.
+         * @param Frame to init
+         */
+        virtual void initialize( StompFrame& frame )
+        {
+            frame.setCommand( CommandConstants::toString(
+                CommandConstants::BEGIN ) );
+        }
+
+        /**
+         * Inheritors are required to override this method to validate 
+         * the passed stomp frame before it is marshalled or unmarshaled
+         * @param Frame to validate
+         * @returns true if frame is valid
+         */
+        virtual bool validate( const StompFrame& frame ) const
+        {
+            if((frame.getCommand() == 
+                CommandConstants::toString( CommandConstants::BEGIN )) &&
+               (frame.getProperties().hasProperty(
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h Wed Jul  5 15:27:34 2006
@@ -1,96 +1,96 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_
-
-#include <cms/BytesMessage.h>
-#include <activemq/connector/stomp/commands/StompMessage.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    /**
-     * Implements the interface for a cms::BytesMessage.  Uses the template
-     * class StompMessage to implement all cms::Message type functionality
-     * and implements the BytesMessage interface here.
-     */    
-    class BytesMessageCommand : public StompMessage< cms::BytesMessage >
-    {
-    public:
-
-        BytesMessageCommand(void) :
-            StompMessage< cms::BytesMessage >() {
-                initialize( getFrame() );
-        }
-        BytesMessageCommand( StompFrame* frame ) : 
-            StompMessage< cms::BytesMessage >(frame) {
-                validate( getFrame() );
-        }
-    	virtual ~BytesMessageCommand(void) {}
-
-        /**
-         * Clonse this message exactly, returns a new instance that the
-         * caller is required to delete.
-         * @return new copy of this message
-         */
-        virtual cms::Message* clone(void) const {
-            StompFrame* frame = getFrame().clone();
-            
-            return new BytesMessageCommand( frame );
-        }   
-
-        /**
-         * sets the bytes given to the message body.  
-         * @param Byte Buffer to copy
-         * @param Number of bytes in Buffer to copy
-         * @throws CMSException
-         */
-        virtual void setBodyBytes( const unsigned char* buffer, 
-                                   const unsigned long numBytes ) 
-            throw( cms::CMSException ) {
-            this->setBytes(
-                reinterpret_cast<const char*>( buffer ), numBytes );
-        }
-        
-        /**
-         * Gets the bytes that are contained in this message, user should
-         * copy this data into a user allocated buffer.  Call 
-         * <code>getBodyLength</code> to determine the number of bytes
-         * to expect.
-         * @return const pointer to a byte buffer
-         */
-        virtual const unsigned char* getBodyBytes(void) const {
-            return reinterpret_cast<const unsigned char*>( this->getBytes() );
-        }
-      
-        /**
-         * Returns the number of bytes contained in the body of this message.
-         * @return number of bytes.
-         */
-        virtual unsigned long getBodyLength(void) const {
-            return this->getNumBytes();
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_
+
+#include <cms/BytesMessage.h>
+#include <activemq/connector/stomp/commands/StompMessage.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    /**
+     * Implements the interface for a cms::BytesMessage.  Uses the template
+     * class StompMessage to implement all cms::Message type functionality
+     * and implements the BytesMessage interface here.
+     */    
+    class BytesMessageCommand : public StompMessage< cms::BytesMessage >
+    {
+    public:
+
+        BytesMessageCommand(void) :
+            StompMessage< cms::BytesMessage >() {
+                initialize( getFrame() );
+        }
+        BytesMessageCommand( StompFrame* frame ) : 
+            StompMessage< cms::BytesMessage >(frame) {
+                validate( getFrame() );
+        }
+    	virtual ~BytesMessageCommand(void) {}
+
+        /**
+         * Clonse this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual cms::Message* clone(void) const {
+            StompFrame* frame = getFrame().clone();
+            
+            return new BytesMessageCommand( frame );
+        }   
+
+        /**
+         * sets the bytes given to the message body.  
+         * @param Byte Buffer to copy
+         * @param Number of bytes in Buffer to copy
+         * @throws CMSException
+         */
+        virtual void setBodyBytes( const unsigned char* buffer, 
+                                   const unsigned long numBytes ) 
+            throw( cms::CMSException ) {
+            this->setBytes(
+                reinterpret_cast<const char*>( buffer ), numBytes );
+        }
+        
+        /**
+         * Gets the bytes that are contained in this message, user should
+         * copy this data into a user allocated buffer.  Call 
+         * <code>getBodyLength</code> to determine the number of bytes
+         * to expect.
+         * @return const pointer to a byte buffer
+         */
+        virtual const unsigned char* getBodyBytes(void) const {
+            return reinterpret_cast<const unsigned char*>( this->getBytes() );
+        }
+      
+        /**
+         * Returns the number of bytes contained in the body of this message.
+         * @return number of bytes.
+         */
+        virtual unsigned long getBodyLength(void) const {
+            return this->getNumBytes();
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommandConstants.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommandConstants.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h Wed Jul  5 15:27:34 2006
@@ -1,85 +1,85 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_
-
-#include <activemq/connector/stomp/commands/AbstractCommand.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <activemq/transport/Command.h>
-#include <string>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-    
-    /**
-     * Commits a Transaction.
-     */
-    class CommitCommand  : public AbstractCommand< transport::Command >
-    {
-    public:
-   
-        CommitCommand(void) :
-            AbstractCommand<transport::Command>() {
-                initialize( getFrame() );
-        }
-        CommitCommand( StompFrame* frame ) : 
-            AbstractCommand<transport::Command>(frame) {
-                validate( getFrame() );
-        }
-        virtual ~CommitCommand(void) {}
-
-    protected:
-    
-        /**
-         * Inheritors are required to override this method to init the
-         * frame with data appropriate for the command type.
-         * @param Frame to init
-         */
-        virtual void initialize( StompFrame& frame )
-        {
-            frame.setCommand( CommandConstants::toString(
-                CommandConstants::COMMIT ) );
-        }
-
-        /**
-         * Inheritors are required to override this method to validate 
-         * the passed stomp frame before it is marshalled or unmarshaled
-         * @param Frame to validate
-         * @returns true if frame is valid
-         */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if((frame.getCommand() == 
-                CommandConstants::toString( CommandConstants::COMMIT )) &&
-               (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
-                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_
+
+#include <activemq/connector/stomp/commands/AbstractCommand.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <activemq/transport/Command.h>
+#include <string>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+    
+    /**
+     * Commits a Transaction.
+     */
+    class CommitCommand  : public AbstractCommand< transport::Command >
+    {
+    public:
+   
+        CommitCommand(void) :
+            AbstractCommand<transport::Command>() {
+                initialize( getFrame() );
+        }
+        CommitCommand( StompFrame* frame ) : 
+            AbstractCommand<transport::Command>(frame) {
+                validate( getFrame() );
+        }
+        virtual ~CommitCommand(void) {}
+
+    protected:
+    
+        /**
+         * Inheritors are required to override this method to init the
+         * frame with data appropriate for the command type.
+         * @param Frame to init
+         */
+        virtual void initialize( StompFrame& frame )
+        {
+            frame.setCommand( CommandConstants::toString(
+                CommandConstants::COMMIT ) );
+        }
+
+        /**
+         * Inheritors are required to override this method to validate 
+         * the passed stomp frame before it is marshalled or unmarshaled
+         * @param Frame to validate
+         * @returns true if frame is valid
+         */
+        virtual bool validate( const StompFrame& frame ) const
+        {
+            if((frame.getCommand() == 
+                CommandConstants::toString( CommandConstants::COMMIT )) &&
+               (frame.getProperties().hasProperty(
+                    CommandConstants::toString( 
+                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMITCOMMAND_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message