activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419365 [6/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/StompConnectorException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorException.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorException.h Wed Jul  5 15:27:34 2006
@@ -1,65 +1,65 @@
-/*
- * 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_STOMPCONNECTOREXCEPTION_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTOREXCEPTION_H_
-
-#include <activemq/connector/ConnectorException.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    /*
-     * Signals that an Connector exception of some sort has occurred.
-     */
-    class StompConnectorException : public connector::ConnectorException
-    {
-    public:
-   
-      StompConnectorException() {}
-      StompConnectorException( const exceptions::ActiveMQException& ex ){
-        *(ActiveMQException*)this = ex;
-      }
-      StompConnectorException( const StompConnectorException& ex ){
-        *(exceptions::ActiveMQException*)this = ex;
-      }
-      StompConnectorException(const char* file, const int lineNumber, 
-        const char* msg, ...)
-      {
-          va_list vargs ;
-          va_start(vargs, msg) ;
-          buildMessage(msg, vargs) ;
-            
-          // Set the first mark for this exception.
-          setMark( file, lineNumber );
-      }
-      
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual exceptions::ActiveMQException* clone() const{
-          return new StompConnectorException( *this );
-      }
-      virtual ~StompConnectorException() {}
-
-    };
-
-}}}
-
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTOREXCEPTION_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_STOMPCONNECTOREXCEPTION_H_
+#define ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTOREXCEPTION_H_
+
+#include <activemq/connector/ConnectorException.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    /*
+     * Signals that an Connector exception of some sort has occurred.
+     */
+    class StompConnectorException : public connector::ConnectorException
+    {
+    public:
+   
+      StompConnectorException() {}
+      StompConnectorException( const exceptions::ActiveMQException& ex ){
+        *(ActiveMQException*)this = ex;
+      }
+      StompConnectorException( const StompConnectorException& ex ){
+        *(exceptions::ActiveMQException*)this = ex;
+      }
+      StompConnectorException(const char* file, const int lineNumber, 
+        const char* msg, ...)
+      {
+          va_list vargs ;
+          va_start(vargs, msg) ;
+          buildMessage(msg, vargs) ;
+            
+          // Set the first mark for this exception.
+          setMark( file, lineNumber );
+      }
+      
+      /**
+       * Clones this exception.  This is useful for cases where you need
+       * to preserve the type of the original exception as well as the message.
+       * All subclasses should override.
+       */
+      virtual exceptions::ActiveMQException* clone() const{
+          return new StompConnectorException( *this );
+      }
+      virtual ~StompConnectorException() {}
+
+    };
+
+}}}
+
+#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTOREXCEPTION_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.cpp Wed Jul  5 15:27:34 2006
@@ -1,49 +1,49 @@
-/*
- * 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.
- */
- 
-#include <activemq/connector/stomp/StompConnectorFactory.h>
-#include <activemq/connector/stomp/StompConnector.h>
-#include <activemq/connector/Connector.h>
-#include <activemq/transport/Transport.h>
-
-using namespace activemq;
-using namespace activemq::util;
-using namespace activemq::transport;
-using namespace activemq::connector;
-using namespace activemq::connector::stomp;
-
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-Connector* StompConnectorFactory::createConnector(
-    const activemq::util::Properties& properties,
-    activemq::transport::Transport* transport)
-{
-    return dynamic_cast<Connector*>(
-        new StompConnector(transport, properties));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-ConnectorFactory& StompConnectorFactory::getInstance(void)
-{
-    // Create a static instance of the registrar and return a reference to
-    // its internal instance of this class.
-    static ConnectorFactoryMapRegistrar registrar(
-        "stomp", new StompConnectorFactory());
-
-    return registrar.getFactory();
-}
+/*
+ * 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.
+ */
+ 
+#include <activemq/connector/stomp/StompConnectorFactory.h>
+#include <activemq/connector/stomp/StompConnector.h>
+#include <activemq/connector/Connector.h>
+#include <activemq/transport/Transport.h>
+
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::transport;
+using namespace activemq::connector;
+using namespace activemq::connector::stomp;
+
+////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////
+Connector* StompConnectorFactory::createConnector(
+    const activemq::util::Properties& properties,
+    activemq::transport::Transport* transport)
+{
+    return dynamic_cast<Connector*>(
+        new StompConnector(transport, properties));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ConnectorFactory& StompConnectorFactory::getInstance(void)
+{
+    // Create a static instance of the registrar and return a reference to
+    // its internal instance of this class.
+    static ConnectorFactoryMapRegistrar registrar(
+        "stomp", new StompConnectorFactory());
+
+    return registrar.getFactory();
+}

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.h Wed Jul  5 15:27:34 2006
@@ -1,54 +1,54 @@
-/*
- * 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_STOMPCONNECTORFACTORY_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORFACTORY_H_
-
-#include <activemq/connector/ConnectorFactory.h>
-#include <activemq/connector/ConnectorFactoryMapRegistrar.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompConnectorFactory : public connector::ConnectorFactory
-    {
-    private:
-
-
-    public:
-   
-        virtual ~StompConnectorFactory(void) {}
-   
-        /** 
-         * Creates a StompConnector
-         * @param The Properties that the new connector is configured with
-         */
-        virtual Connector* createConnector(
-            const activemq::util::Properties& properties,
-            activemq::transport::Transport* transport);
-
-        /**
-         * Returns an instance of this Factory by reference
-         * @return StompConnectorFactory reference
-         */
-        static ConnectorFactory& getInstance(void);
-
-    };
-
-}}}
-
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORFACTORY_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_STOMPCONNECTORFACTORY_H_
+#define ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORFACTORY_H_
+
+#include <activemq/connector/ConnectorFactory.h>
+#include <activemq/connector/ConnectorFactoryMapRegistrar.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompConnectorFactory : public connector::ConnectorFactory
+    {
+    private:
+
+
+    public:
+   
+        virtual ~StompConnectorFactory(void) {}
+   
+        /** 
+         * Creates a StompConnector
+         * @param The Properties that the new connector is configured with
+         */
+        virtual Connector* createConnector(
+            const activemq::util::Properties& properties,
+            activemq::transport::Transport* transport);
+
+        /**
+         * Returns an instance of this Factory by reference
+         * @return StompConnectorFactory reference
+         */
+        static ConnectorFactory& getInstance(void);
+
+    };
+
+}}}
+
+#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORFACTORY_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConsumerInfo.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConsumerInfo.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConsumerInfo.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConsumerInfo.h Wed Jul  5 15:27:34 2006
@@ -1,118 +1,118 @@
-/*
- * 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_STOMPCONSUMERINFO_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONSUMERINFO_H_
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompConsumerInfo : public ConsumerInfo
-    {
-    private:
-
-        // Message Selector for this Consumer
-        std::string selector;
-        
-        // Consumer Id
-        unsigned int consumerId;
-        
-        // Destination
-        cms::Destination* destination;
-        
-        // Session Info - We do not own this
-        const SessionInfo* session;
-    
-    public:
-
-    	StompConsumerInfo(void) {
-            selector = "";
-            consumerId = 0;
-            destination = NULL;
-        }
-    	virtual ~StompConsumerInfo(void) { delete destination; }
-
-        /**
-         * Gets this message consumer's message selector expression.
-         * @return This Consumer's selector expression or "".
-         */
-        virtual const std::string& getMessageSelector(void) const {
-            return selector;
-        }
-        
-        /**
-         * Sets this message consumer's message selector expression.
-         * @param This Consumer's selector expression or "".
-         */
-        virtual void setMessageSelector( const std::string& selector ) {
-            this->selector = selector;
-        }
-
-        /**
-         * Gets the ID that is assigned to this consumer
-         * @return value of the Consumer Id.
-         */
-        virtual unsigned int getConsumerId(void) const {
-            return consumerId;
-        }
-        
-        /**
-         * Sets the ID that is assigned to this consumer
-         * @return string value of the Consumer Id.
-         */
-        virtual void setConsumerId( const unsigned int id ) {
-            this->consumerId = id;
-        }
-        
-        /**
-         * Gets the Destination that this Consumer is subscribed on
-         * @return Destination
-         */
-        virtual const cms::Destination& getDestination(void) const {
-            return *destination;
-        }
-        
-        /**
-         * Sets the destination that this Consumer is listening on
-         * @param Destination
-         */
-        virtual void setDestination( const cms::Destination& destination ) {
-            this->destination = destination.clone();
-        }
-        
-        /**
-         * Gets the Session Info that this consumer is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual const SessionInfo* getSessionInfo(void) const {
-            return session;
-        }
-        
-        /**
-         * Gets the Session Info that this consumer is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual void setSessionInfo( const SessionInfo* session ) {
-            this->session = session;
-        }
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPCONSUMERINFO_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_STOMPCONSUMERINFO_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONSUMERINFO_H_
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompConsumerInfo : public ConsumerInfo
+    {
+    private:
+
+        // Message Selector for this Consumer
+        std::string selector;
+        
+        // Consumer Id
+        unsigned int consumerId;
+        
+        // Destination
+        cms::Destination* destination;
+        
+        // Session Info - We do not own this
+        const SessionInfo* session;
+    
+    public:
+
+    	StompConsumerInfo(void) {
+            selector = "";
+            consumerId = 0;
+            destination = NULL;
+        }
+    	virtual ~StompConsumerInfo(void) { delete destination; }
+
+        /**
+         * Gets this message consumer's message selector expression.
+         * @return This Consumer's selector expression or "".
+         */
+        virtual const std::string& getMessageSelector(void) const {
+            return selector;
+        }
+        
+        /**
+         * Sets this message consumer's message selector expression.
+         * @param This Consumer's selector expression or "".
+         */
+        virtual void setMessageSelector( const std::string& selector ) {
+            this->selector = selector;
+        }
+
+        /**
+         * Gets the ID that is assigned to this consumer
+         * @return value of the Consumer Id.
+         */
+        virtual unsigned int getConsumerId(void) const {
+            return consumerId;
+        }
+        
+        /**
+         * Sets the ID that is assigned to this consumer
+         * @return string value of the Consumer Id.
+         */
+        virtual void setConsumerId( const unsigned int id ) {
+            this->consumerId = id;
+        }
+        
+        /**
+         * Gets the Destination that this Consumer is subscribed on
+         * @return Destination
+         */
+        virtual const cms::Destination& getDestination(void) const {
+            return *destination;
+        }
+        
+        /**
+         * Sets the destination that this Consumer is listening on
+         * @param Destination
+         */
+        virtual void setDestination( const cms::Destination& destination ) {
+            this->destination = destination.clone();
+        }
+        
+        /**
+         * Gets the Session Info that this consumer is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual const SessionInfo* getSessionInfo(void) const {
+            return session;
+        }
+        
+        /**
+         * Gets the Session Info that this consumer is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual void setSessionInfo( const SessionInfo* session ) {
+            this->session = session;
+        }
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPCONSUMERINFO_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompDestination.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompDestination.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompDestination.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompDestination.h Wed Jul  5 15:27:34 2006
@@ -1,106 +1,106 @@
-/*
- * 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_STOMPDESTINATION_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPDESTINATION_H_
-
-#include <string>
-
-#include <cms/Destination.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    /**
-     * Templatized Destination Class that bundles all the common aspects
-     * of a Stomp Destination into one class.  The template arguement is 
-     * one of Topic, Queue, TemporaryTopic, or TemporaryQueue.
-     */
-    template <typename T>
-    class StompDestination : public T
-    {
-    private:
-    
-        // Destination type
-        cms::Destination::DestinationType destType;
-        
-        // Name of the Destination
-        std::string name;
-        
-    public:
-
-    	StompDestination(void) {}
-        
-    	StompDestination( const std::string& name,
-                          cms::Destination::DestinationType type )
-        {
-            this->name = name;
-            this->destType = type;
-        }
-
-        virtual ~StompDestination(void) {}
-
-        /**
-         * Retrieves the name of this destination, plus the stomp
-         * destination decorator
-         * @return name
-         */
-        virtual std::string toProviderString(void) const {
-            return getPrefix() + name;
-        }
-        
-        /**
-         * Retrieve the Destination Type for this Destination
-         * @return The Destination Type
-         */
-        virtual cms::Destination::DestinationType getDestinationType(void) const {
-            return destType;
-        }
-        
-        /**
-         * Converts the Destination Name into a String minus the 
-         * stomp decorator
-         * @return string name
-         */
-        virtual std::string toString(void) const {
-            return name;
-        }
-
-        /**
-         * 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->destType = source.getDestinationType();
-            this->name = source.toString();
-        }
-
-    protected:
-    
-        /**
-         * Retrieves the proper Stomp Prefix for the specified type
-         * of Destination
-         * @return string prefix
-         */
-        virtual std::string getPrefix(void) const = 0;
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPDESTINATION_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_STOMPDESTINATION_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPDESTINATION_H_
+
+#include <string>
+
+#include <cms/Destination.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    /**
+     * Templatized Destination Class that bundles all the common aspects
+     * of a Stomp Destination into one class.  The template arguement is 
+     * one of Topic, Queue, TemporaryTopic, or TemporaryQueue.
+     */
+    template <typename T>
+    class StompDestination : public T
+    {
+    private:
+    
+        // Destination type
+        cms::Destination::DestinationType destType;
+        
+        // Name of the Destination
+        std::string name;
+        
+    public:
+
+    	StompDestination(void) {}
+        
+    	StompDestination( const std::string& name,
+                          cms::Destination::DestinationType type )
+        {
+            this->name = name;
+            this->destType = type;
+        }
+
+        virtual ~StompDestination(void) {}
+
+        /**
+         * Retrieves the name of this destination, plus the stomp
+         * destination decorator
+         * @return name
+         */
+        virtual std::string toProviderString(void) const {
+            return getPrefix() + name;
+        }
+        
+        /**
+         * Retrieve the Destination Type for this Destination
+         * @return The Destination Type
+         */
+        virtual cms::Destination::DestinationType getDestinationType(void) const {
+            return destType;
+        }
+        
+        /**
+         * Converts the Destination Name into a String minus the 
+         * stomp decorator
+         * @return string name
+         */
+        virtual std::string toString(void) const {
+            return name;
+        }
+
+        /**
+         * 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->destType = source.getDestinationType();
+            this->name = source.toString();
+        }
+
+    protected:
+    
+        /**
+         * Retrieves the proper Stomp Prefix for the specified type
+         * of Destination
+         * @return string prefix
+         */
+        virtual std::string getPrefix(void) const = 0;
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPDESTINATION_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h Wed Jul  5 15:27:34 2006
@@ -1,127 +1,127 @@
-/*
- * 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_STOMPFRAMEWRAPPER_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_
- 
-#include <string>
-#include <map>
-#include <activemq/util/SimpleProperties.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    /**
-     * A Stomp-level message frame that encloses all messages
-     * to and from the broker.
-     */
-    class StompFrame{           
-    public:
-    
-        /**
-         * Default constructor.
-         */
-        StompFrame(void){
-            body = NULL;
-            bodyLength = 0;
-        }
-        
-        /**
-         * Destruction - frees the memory pool.
-         */
-        virtual ~StompFrame(void) { delete body; }
-        
-        /**
-         * Clonse this message exactly, returns a new instance that the
-         * caller is required to delete.
-         * @return new copy of this message
-         */
-        virtual StompFrame* clone(void) const {
-            StompFrame* frame = new StompFrame();
-            frame->command = command;
-            frame->properties = properties;
-            char* cpyBody = new char[bodyLength];
-            memcpy(cpyBody, body, bodyLength);
-            frame->setBody(cpyBody, bodyLength);
-            return frame;
-        }
-        
-        /**
-         * Sets the command for this stomp frame.
-         * @param command The command to be set.
-         */
-        void setCommand( const std::string& cmd ){
-            this->command = cmd;
-        }
-        
-        /**
-         * Accessor for this frame's command field.
-         */
-        const std::string& getCommand(void) const{
-            return command;
-        }
-        
-        /**
-         * Gets access to the header properties for this frame.
-         */
-        util::Properties& getProperties(void){ return properties; }
-        const util::Properties& getProperties(void) const { 
-            return properties;
-        }
-        
-        /**
-         * Accessor for the body data of this frame.
-         * @return char pointer to body data
-         */
-        const char* getBody(void) const{
-            return body;
-        }
-        
-        /**
-         * Return the number of bytes contained in this frames body
-         * @return Body bytes length.
-         */
-        int getBodyLength(void) const{ return bodyLength; }
-        
-        /**
-         * Sets the body data of this frame as a byte sequence.
-         * @param bytes The byte buffer to be set in the body.
-         * @param numBytes The number of bytes in the buffer.
-         */
-        void setBody( const char* bytes, const int numBytes ){
-            body = bytes;
-            bodyLength = numBytes;
-        }   
-        
-    private:
-
-        // String Name of this command.
-        std::string command;
-
-        // Properties of the Stomp Message
-        util::SimpleProperties properties;
-
-        // Byte data of Body.
-        const char* body;
-        int bodyLength;     
-        
-    };
-    
-}}}
-
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_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_STOMPFRAMEWRAPPER_H_
+#define ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_
+ 
+#include <string>
+#include <map>
+#include <activemq/util/SimpleProperties.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    /**
+     * A Stomp-level message frame that encloses all messages
+     * to and from the broker.
+     */
+    class StompFrame{           
+    public:
+    
+        /**
+         * Default constructor.
+         */
+        StompFrame(void){
+            body = NULL;
+            bodyLength = 0;
+        }
+        
+        /**
+         * Destruction - frees the memory pool.
+         */
+        virtual ~StompFrame(void) { delete body; }
+        
+        /**
+         * Clonse this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual StompFrame* clone(void) const {
+            StompFrame* frame = new StompFrame();
+            frame->command = command;
+            frame->properties = properties;
+            char* cpyBody = new char[bodyLength];
+            memcpy(cpyBody, body, bodyLength);
+            frame->setBody(cpyBody, bodyLength);
+            return frame;
+        }
+        
+        /**
+         * Sets the command for this stomp frame.
+         * @param command The command to be set.
+         */
+        void setCommand( const std::string& cmd ){
+            this->command = cmd;
+        }
+        
+        /**
+         * Accessor for this frame's command field.
+         */
+        const std::string& getCommand(void) const{
+            return command;
+        }
+        
+        /**
+         * Gets access to the header properties for this frame.
+         */
+        util::Properties& getProperties(void){ return properties; }
+        const util::Properties& getProperties(void) const { 
+            return properties;
+        }
+        
+        /**
+         * Accessor for the body data of this frame.
+         * @return char pointer to body data
+         */
+        const char* getBody(void) const{
+            return body;
+        }
+        
+        /**
+         * Return the number of bytes contained in this frames body
+         * @return Body bytes length.
+         */
+        int getBodyLength(void) const{ return bodyLength; }
+        
+        /**
+         * Sets the body data of this frame as a byte sequence.
+         * @param bytes The byte buffer to be set in the body.
+         * @param numBytes The number of bytes in the buffer.
+         */
+        void setBody( const char* bytes, const int numBytes ){
+            body = bytes;
+            bodyLength = numBytes;
+        }   
+        
+    private:
+
+        // String Name of this command.
+        std::string command;
+
+        // Properties of the Stomp Message
+        util::SimpleProperties properties;
+
+        // Byte data of Body.
+        const char* body;
+        int bodyLength;     
+        
+    };
+    
+}}}
+
+#endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompProducerInfo.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompProducerInfo.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompProducerInfo.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompProducerInfo.h Wed Jul  5 15:27:34 2006
@@ -1,99 +1,99 @@
-/*
- * 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_STOMPPRODUCERINFO_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPPRODUCERINFO_H_
-
-#include <activemq/connector/ProducerInfo.h>
-#include <cms/Destination.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompProducerInfo : public ProducerInfo
-    {
-    private:
-    
-        // Producer Id
-        unsigned int producerId;
-
-        // Default Destination
-        cms::Destination* dest;
-        
-        // Session that this producer is attached to - we do not own this
-        const SessionInfo* session;
-        
-    public:
-
-    	StompProducerInfo(void) { dest = NULL; }
-    	virtual ~StompProducerInfo(void) { delete dest; }
-
-        /**
-         * Retrieves the default destination that this producer
-         * sends its messages to.
-         * @return Destionation, owned by this object
-         */
-        virtual const cms::Destination& getDestination(void) const {
-            return *dest;
-        }
-
-        /**
-         * Sets the Default Destination for this Producer
-         * @param reference to a destination, copied internally
-         */
-        virtual void setDestination( const cms::Destination& dest ) {
-            this->dest = dest.clone();
-        }
-
-        /**
-         * Gets the ID that is assigned to this Producer
-         * @return value of the Producer Id.
-         */
-        virtual unsigned int getProducerId(void) const {
-            return producerId;
-        }
-        
-        /**
-         * Sets the ID that is assigned to this Producer
-         * @return string value of the Producer Id.
-         */
-        virtual void setProducerId( const unsigned int id ) {
-            this->producerId = id;
-        }
-
-        /**
-         * Gets the Session Info that this consumer is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual const SessionInfo* getSessionInfo(void) const {
-            return session;
-        }
-
-        /**
-         * Gets the Session Info that this consumer is attached too
-         * @return SessionnInfo pointer
-         */
-        virtual void setSessionInfo( const SessionInfo* session ) {
-            this->session = session;
-        }
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPPRODUCERINFO_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_STOMPPRODUCERINFO_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPPRODUCERINFO_H_
+
+#include <activemq/connector/ProducerInfo.h>
+#include <cms/Destination.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompProducerInfo : public ProducerInfo
+    {
+    private:
+    
+        // Producer Id
+        unsigned int producerId;
+
+        // Default Destination
+        cms::Destination* dest;
+        
+        // Session that this producer is attached to - we do not own this
+        const SessionInfo* session;
+        
+    public:
+
+    	StompProducerInfo(void) { dest = NULL; }
+    	virtual ~StompProducerInfo(void) { delete dest; }
+
+        /**
+         * Retrieves the default destination that this producer
+         * sends its messages to.
+         * @return Destionation, owned by this object
+         */
+        virtual const cms::Destination& getDestination(void) const {
+            return *dest;
+        }
+
+        /**
+         * Sets the Default Destination for this Producer
+         * @param reference to a destination, copied internally
+         */
+        virtual void setDestination( const cms::Destination& dest ) {
+            this->dest = dest.clone();
+        }
+
+        /**
+         * Gets the ID that is assigned to this Producer
+         * @return value of the Producer Id.
+         */
+        virtual unsigned int getProducerId(void) const {
+            return producerId;
+        }
+        
+        /**
+         * Sets the ID that is assigned to this Producer
+         * @return string value of the Producer Id.
+         */
+        virtual void setProducerId( const unsigned int id ) {
+            this->producerId = id;
+        }
+
+        /**
+         * Gets the Session Info that this consumer is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual const SessionInfo* getSessionInfo(void) const {
+            return session;
+        }
+
+        /**
+         * Gets the Session Info that this consumer is attached too
+         * @return SessionnInfo pointer
+         */
+        virtual void setSessionInfo( const SessionInfo* session ) {
+            this->session = session;
+        }
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPPRODUCERINFO_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompQueue.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompQueue.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompQueue.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompQueue.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_STOMPQUEUE_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPQUEUE_H_
-
-#include <activemq/connector/stomp/StompDestination.h>
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <cms/Queue.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompQueue : public StompDestination<cms::Queue>
-    {
-    public:
-
-    	StompQueue(void) : StompDestination< cms::Queue >() {}
-
-        StompQueue(const std::string& name) : 
-            StompDestination< cms::Queue >( name, cms::Destination::QUEUE )
-        {}
-
-    	virtual ~StompQueue(void) {}
-
-        /**
-         * Gets the name of this queue.
-         * @return The queue name.
-         */
-        virtual std::string getQueueName(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 StompQueue( 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::queuePrefix;
-        }
-        
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPQUEUE_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_STOMPQUEUE_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPQUEUE_H_
+
+#include <activemq/connector/stomp/StompDestination.h>
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+#include <cms/Queue.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompQueue : public StompDestination<cms::Queue>
+    {
+    public:
+
+    	StompQueue(void) : StompDestination< cms::Queue >() {}
+
+        StompQueue(const std::string& name) : 
+            StompDestination< cms::Queue >( name, cms::Destination::QUEUE )
+        {}
+
+    	virtual ~StompQueue(void) {}
+
+        /**
+         * Gets the name of this queue.
+         * @return The queue name.
+         */
+        virtual std::string getQueueName(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 StompQueue( 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::queuePrefix;
+        }
+        
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPQUEUE_H_*/

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

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionInfo.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionInfo.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionInfo.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionInfo.h Wed Jul  5 15:27:34 2006
@@ -1,134 +1,134 @@
-/*
- * 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_STOMPSESSIONINFO_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONINFO_H_
-
-#include <activemq/connector/SessionInfo.h>
-#include <cms/Session.h>
-#include <string>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompSessionInfo : public connector::SessionInfo
-    {
-    private:
-    
-        // Acknowledge Mode of this Session
-        cms::Session::AcknowledgeMode ackMode;
-        
-        // The id of the connection to the broker 
-        // (given to us by the broker)
-        std::string connectionId;
-        
-        // The unique session id
-        unsigned int sessionId;
-        
-        // Info for this sessions current transaction
-        const TransactionInfo* transaction;
-        
-    public:
-
-        /**
-         * Constructor
-         */
-        StompSessionInfo(void)
-        {
-            sessionId = 0;
-            ackMode = cms::Session::AutoAcknowledge;
-        }
-
-        /**
-         * Destructor
-         */
-        virtual ~StompSessionInfo(void) {}
-
-        /**
-         * Gets the Connection Id of the Connection that this consumer is
-         * using to receive its messages.
-         * @return string value of the connection id
-         */
-        virtual const std::string& getConnectionId(void) const{
-            return connectionId;
-        }
-   
-        /**
-         * Sets the Connection Id of the Connection that this consumer is
-         * using to receive its messages.
-         * @param string value of the connection id
-         */
-        virtual void setConnectionId( const std::string& id ){
-            connectionId = id;
-        }
-        
-        /**
-         * Gets the Sessions Id value
-         * @return id for this session
-         */
-        virtual unsigned int getSessionId(void) const {
-            return sessionId;
-        }
-
-        /**
-         * Sets the Session Id for this Session
-         * @param integral id value for this session
-         */
-        virtual void setSessionId( const unsigned int id ) {
-            this->sessionId = id;
-        }
-
-        /**
-         * Sets the Ack Mode of this Session Info object
-         * @param Ack Mode
-         */
-        virtual void setAckMode(cms::Session::AcknowledgeMode ackMode) {
-            this->ackMode = ackMode;
-        }
-        
-        /**
-         * Gets the Ack Mode of this Session
-         * @return Ack Mode
-         */
-        virtual cms::Session::AcknowledgeMode getAckMode(void) const {
-            return ackMode;
-        }
-        
-        /**
-         * Gets the currently active transaction info, if this session is
-         * transacted, returns NULL when not transacted.  You must call
-         * getAckMode and see if the session is transacted.
-         * @return Transaction Id of current Transaction
-         */
-        virtual const TransactionInfo* getTransactionInfo(void) const {
-            return transaction;
-        }
-        
-        /**
-         * Sets the current transaction info for this session, this is nit
-         * used when the session is not transacted.
-         * @param Transaction Id
-         */        
-        virtual void setTransactionInfo( const TransactionInfo* transaction ) {
-            this->transaction = transaction;
-        }
-
-   };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONINFO_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_STOMPSESSIONINFO_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONINFO_H_
+
+#include <activemq/connector/SessionInfo.h>
+#include <cms/Session.h>
+#include <string>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompSessionInfo : public connector::SessionInfo
+    {
+    private:
+    
+        // Acknowledge Mode of this Session
+        cms::Session::AcknowledgeMode ackMode;
+        
+        // The id of the connection to the broker 
+        // (given to us by the broker)
+        std::string connectionId;
+        
+        // The unique session id
+        unsigned int sessionId;
+        
+        // Info for this sessions current transaction
+        const TransactionInfo* transaction;
+        
+    public:
+
+        /**
+         * Constructor
+         */
+        StompSessionInfo(void)
+        {
+            sessionId = 0;
+            ackMode = cms::Session::AutoAcknowledge;
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~StompSessionInfo(void) {}
+
+        /**
+         * Gets the Connection Id of the Connection that this consumer is
+         * using to receive its messages.
+         * @return string value of the connection id
+         */
+        virtual const std::string& getConnectionId(void) const{
+            return connectionId;
+        }
+   
+        /**
+         * Sets the Connection Id of the Connection that this consumer is
+         * using to receive its messages.
+         * @param string value of the connection id
+         */
+        virtual void setConnectionId( const std::string& id ){
+            connectionId = id;
+        }
+        
+        /**
+         * Gets the Sessions Id value
+         * @return id for this session
+         */
+        virtual unsigned int getSessionId(void) const {
+            return sessionId;
+        }
+
+        /**
+         * Sets the Session Id for this Session
+         * @param integral id value for this session
+         */
+        virtual void setSessionId( const unsigned int id ) {
+            this->sessionId = id;
+        }
+
+        /**
+         * Sets the Ack Mode of this Session Info object
+         * @param Ack Mode
+         */
+        virtual void setAckMode(cms::Session::AcknowledgeMode ackMode) {
+            this->ackMode = ackMode;
+        }
+        
+        /**
+         * Gets the Ack Mode of this Session
+         * @return Ack Mode
+         */
+        virtual cms::Session::AcknowledgeMode getAckMode(void) const {
+            return ackMode;
+        }
+        
+        /**
+         * Gets the currently active transaction info, if this session is
+         * transacted, returns NULL when not transacted.  You must call
+         * getAckMode and see if the session is transacted.
+         * @return Transaction Id of current Transaction
+         */
+        virtual const TransactionInfo* getTransactionInfo(void) const {
+            return transaction;
+        }
+        
+        /**
+         * Sets the current transaction info for this session, this is nit
+         * used when the session is not transacted.
+         * @param Transaction Id
+         */        
+        virtual void setTransactionInfo( const TransactionInfo* transaction ) {
+            this->transaction = transaction;
+        }
+
+   };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPSESSIONINFO_H_*/

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

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp Wed Jul  5 15:27:34 2006
@@ -1,326 +1,326 @@
-/*
- * 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.
- */
-
-#include "StompSessionManager.h"
-
-#include <activemq/core/ActiveMQMessage.h>
-#include <activemq/concurrent/Concurrent.h>
-#include <activemq/connector/stomp/StompSessionInfo.h>
-#include <activemq/connector/stomp/StompConsumerInfo.h>
-#include <activemq/connector/stomp/commands/SubscribeCommand.h>
-#include <activemq/connector/stomp/commands/UnsubscribeCommand.h>
-#include <activemq/connector/stomp/StompSelector.h>
-
-using namespace std;
-using namespace activemq;
-using namespace activemq::core;
-using namespace activemq::exceptions;
-using namespace activemq::transport;
-using namespace activemq::connector;
-using namespace activemq::connector::stomp;
-using namespace activemq::connector::stomp::commands;
-
-////////////////////////////////////////////////////////////////////////////////
-StompSessionManager::StompSessionManager( const std::string& connectionId, 
-                                          Transport* transport )
-{
-    if( transport == NULL )
-    {
-        throw NullPointerException( 
-            __FILE__, __LINE__,
-            "StompSessionManager::StompSessionManager" );
-    }
-
-    this->transport = transport;
-    this->connectionId = connectionId;
-    this->nextSessionId = 0;
-    this->nextConsumerId = 0;
-    this->messageListener = NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-StompSessionManager::~StompSessionManager(void)
-{
-    // NOTE - I am not cleaning out the ConsumerInfo objects in the
-    // map becaise it is really the job of the consumer ot remove itself
-    // when it is destructed.  If it doesn't then we would have problems,
-    // but if it does, but it's deleted after this object then we would
-    // still have problems.  
-}
-
-////////////////////////////////////////////////////////////////////////////////
-unsigned int StompSessionManager::getNextSessionId(void)
-{
-    synchronized(&mutex)
-    {
-        return nextSessionId++;
-    }
-    
-    return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-unsigned int StompSessionManager::getNextConsumerId(void)
-{
-    synchronized(&mutex)
-    {
-        return nextConsumerId++;
-    }
-
-    return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-connector::SessionInfo* StompSessionManager::createSession(
-    cms::Session::AcknowledgeMode ackMode) 
-        throw ( exceptions::ActiveMQException )
-{
-    try
-    {
-        SessionInfo* session = new StompSessionInfo();
-        
-        // Init data
-        session->setAckMode(ackMode);
-        session->setConnectionId( connectionId );
-        session->setSessionId( getNextSessionId() );
-        
-        return session;
-    }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void StompSessionManager::removeSession( 
-    connector::SessionInfo* session )
-        throw ( exceptions::ActiveMQException )
-{
-    // NO-op
-}
-    
-////////////////////////////////////////////////////////////////////////////////
-connector::ConsumerInfo* StompSessionManager::createConsumer(
-    cms::Destination* destination, 
-    SessionInfo* session,
-    const std::string& selector)
-        throw( ConnectorException )
-{
-    try
-    {
-        // Delegate to the createDurableConsumer method, just pas the
-        // appropriate params so that a regular consumer is created on
-        // the broker side.
-        return createDurableConsumer( 
-            destination, session, "", selector, false );    
-    }
-    AMQ_CATCH_RETHROW( ConnectorException )
-    AMQ_CATCHALL_THROW( ConnectorException )
-}
-
-////////////////////////////////////////////////////////////////////////////////
-connector::ConsumerInfo* StompSessionManager::createDurableConsumer(
-    cms::Destination* destination, 
-    SessionInfo* session,
-    const std::string& name,
-    const std::string& selector,
-    bool noLocal )
-        throw ( ConnectorException )
-{
-    try
-    {
-        synchronized(&mutex)
-        {
-            // Find the right mapping to consumers        
-            ConsumerMap& consumerMap = 
-                destinationMap[ destination->toString() ];
-            
-            // We only need to send a sub request if there are no active 
-            // consumers on this destination.  
-            if( consumerMap.empty() )
-            {
-                // Send the request to the Broker
-                SubscribeCommand cmd;
-                
-                if( session->getAckMode() == cms::Session::ClientAcknowledge )
-                {
-                    cmd.setAckMode( CommandConstants::ACK_CLIENT );
-                }
-                cmd.setDestination( destination->toProviderString() );
-                cmd.setNoLocal( noLocal );
-
-                if( name != "" )
-                {
-                    cmd.setSubscriptionName( name );
-                }
-                
-                // The Selector is set on the first subscribe on this dest,
-                // and if another consumer is created on this destination
-                // that specifies a selector it will be ignored.  While 
-                // this is not ideal, is the only way to handle the fact
-                // that activemq stomp doesn't support multiple sessions.
-                if( selector != "" )
-                {
-                    cmd.setMessageSelector( selector );
-                }
-        
-                // Fire the message        
-                transport->oneway( &cmd );
-            }
-             
-            // Initialize a new Consumer info Message
-            ConsumerInfo* consumer = new StompConsumerInfo();
-            
-            consumer->setConsumerId( getNextConsumerId() );
-            consumer->setDestination( *destination );
-            consumer->setMessageSelector( selector );
-            consumer->setSessionInfo( session );
-    
-            // Store this consumer for later message dispatching.        
-            consumerMap.insert( 
-                make_pair( consumer->getConsumerId(), consumer ) );
-            
-            return consumer;
-        }
-        
-        return NULL;
-    }
-    AMQ_CATCH_RETHROW( ConnectorException )
-    AMQ_CATCHALL_THROW( ConnectorException )
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void StompSessionManager::removeConsumer(
-    connector::ConsumerInfo* consumer)
-        throw( ConnectorException )
-{
-    try
-    {
-        synchronized(&mutex)
-        {
-            DestinationMap::iterator itr = 
-                destinationMap.find( consumer->getDestination().toString() );
-                
-            if( itr == destinationMap.end() )
-            {
-                // Already removed from the map
-                return;
-            }
-            
-            ConsumerMap& consumers = itr->second;
-            
-            // Remove from the map.
-            consumers.erase( consumer->getConsumerId() );
-            
-            // If there are no more on this destination then we unsubscribe
-            if( consumers.empty() )
-            {
-                UnsubscribeCommand cmd;
-                
-                cmd.setDestination( 
-                    consumer->getDestination().toProviderString() );
-                
-                // Send the message
-                transport->oneway( &cmd );
-            }    
-        }
-    }
-    AMQ_CATCH_RETHROW( ConnectorException )
-    AMQ_CATCHALL_THROW( ConnectorException )
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void StompSessionManager::onStompCommand( commands::StompCommand* command ) 
-    throw ( StompConnectorException )
-{
-    try
-    {
-        cms::Message* message = dynamic_cast< cms::Message*>( command );
-
-        if( message == NULL )
-        {
-            throw StompConnectorException(
-                __FILE__, __LINE__,
-                "StompSessionManager::onStompCommand - Invalid Command" );
-        }
-
-        if( messageListener == NULL )
-        {
-            throw StompConnectorException(
-                __FILE__, __LINE__,
-                "StompSessionManager::onStompCommand - "
-                "No Message Listener Registered." );
-        }
-                
-        synchronized(&mutex)
-        {
-            DestinationMap::iterator itr = 
-                destinationMap.find( message->getCMSDestination().toString() );
-
-            if( itr == destinationMap.end() )
-            {
-                throw StompConnectorException(
-                    __FILE__, __LINE__,
-                    "StompSessionManager::onStompCommand - "
-                    "Received a Message that doesn't have a listener" );
-            }
-
-            // If we only have 1 consumer, we don't need to clone the original
-            // message.
-            if(itr->second.size() == 1)
-            {
-                ConsumerInfo* consumerInfo = itr->second.begin()->second;
-                
-                if( StompSelector::isSelected( 
-                        consumerInfo->getMessageSelector(),
-                        message ) )
-                {                    
-                    ActiveMQMessage* msg = 
-                        dynamic_cast< ActiveMQMessage* >( message );
-                    messageListener->onConsumerMessage( consumerInfo, msg );
-                }
-                
-                return;
-            }
-
-            // We have more than one consumer of this message - we have to
-            // clone the message for each consumer so they don't destroy each other's
-            // message.
-            ConsumerMap::iterator c_itr = itr->second.begin();
-            
-            for(; c_itr != itr->second.end(); ++c_itr )
-            {
-                ConsumerInfo* consumerInfo = c_itr->second;
-                
-                if( StompSelector::isSelected( 
-                        consumerInfo->getMessageSelector(),
-                        message ) )
-                {
-                    ActiveMQMessage* msg = 
-                        dynamic_cast< ActiveMQMessage* >( message->clone() );
-                    messageListener->onConsumerMessage( consumerInfo, msg );
-                }
-            }
-            
-            // We got here which means that we sent copies, so remove
-            // the original.
-            delete command;
-        }
-    }
-    AMQ_CATCH_RETHROW( StompConnectorException )
-    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, StompConnectorException )
-    AMQ_CATCHALL_THROW( StompConnectorException )
-}
+/*
+ * 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.
+ */
+
+#include "StompSessionManager.h"
+
+#include <activemq/core/ActiveMQMessage.h>
+#include <activemq/concurrent/Concurrent.h>
+#include <activemq/connector/stomp/StompSessionInfo.h>
+#include <activemq/connector/stomp/StompConsumerInfo.h>
+#include <activemq/connector/stomp/commands/SubscribeCommand.h>
+#include <activemq/connector/stomp/commands/UnsubscribeCommand.h>
+#include <activemq/connector/stomp/StompSelector.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::core;
+using namespace activemq::exceptions;
+using namespace activemq::transport;
+using namespace activemq::connector;
+using namespace activemq::connector::stomp;
+using namespace activemq::connector::stomp::commands;
+
+////////////////////////////////////////////////////////////////////////////////
+StompSessionManager::StompSessionManager( const std::string& connectionId, 
+                                          Transport* transport )
+{
+    if( transport == NULL )
+    {
+        throw NullPointerException( 
+            __FILE__, __LINE__,
+            "StompSessionManager::StompSessionManager" );
+    }
+
+    this->transport = transport;
+    this->connectionId = connectionId;
+    this->nextSessionId = 0;
+    this->nextConsumerId = 0;
+    this->messageListener = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+StompSessionManager::~StompSessionManager(void)
+{
+    // NOTE - I am not cleaning out the ConsumerInfo objects in the
+    // map becaise it is really the job of the consumer ot remove itself
+    // when it is destructed.  If it doesn't then we would have problems,
+    // but if it does, but it's deleted after this object then we would
+    // still have problems.  
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned int StompSessionManager::getNextSessionId(void)
+{
+    synchronized(&mutex)
+    {
+        return nextSessionId++;
+    }
+    
+    return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned int StompSessionManager::getNextConsumerId(void)
+{
+    synchronized(&mutex)
+    {
+        return nextConsumerId++;
+    }
+
+    return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+connector::SessionInfo* StompSessionManager::createSession(
+    cms::Session::AcknowledgeMode ackMode) 
+        throw ( exceptions::ActiveMQException )
+{
+    try
+    {
+        SessionInfo* session = new StompSessionInfo();
+        
+        // Init data
+        session->setAckMode(ackMode);
+        session->setConnectionId( connectionId );
+        session->setSessionId( getNextSessionId() );
+        
+        return session;
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void StompSessionManager::removeSession( 
+    connector::SessionInfo* session )
+        throw ( exceptions::ActiveMQException )
+{
+    // NO-op
+}
+    
+////////////////////////////////////////////////////////////////////////////////
+connector::ConsumerInfo* StompSessionManager::createConsumer(
+    cms::Destination* destination, 
+    SessionInfo* session,
+    const std::string& selector)
+        throw( ConnectorException )
+{
+    try
+    {
+        // Delegate to the createDurableConsumer method, just pas the
+        // appropriate params so that a regular consumer is created on
+        // the broker side.
+        return createDurableConsumer( 
+            destination, session, "", selector, false );    
+    }
+    AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCHALL_THROW( ConnectorException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+connector::ConsumerInfo* StompSessionManager::createDurableConsumer(
+    cms::Destination* destination, 
+    SessionInfo* session,
+    const std::string& name,
+    const std::string& selector,
+    bool noLocal )
+        throw ( ConnectorException )
+{
+    try
+    {
+        synchronized(&mutex)
+        {
+            // Find the right mapping to consumers        
+            ConsumerMap& consumerMap = 
+                destinationMap[ destination->toString() ];
+            
+            // We only need to send a sub request if there are no active 
+            // consumers on this destination.  
+            if( consumerMap.empty() )
+            {
+                // Send the request to the Broker
+                SubscribeCommand cmd;
+                
+                if( session->getAckMode() == cms::Session::ClientAcknowledge )
+                {
+                    cmd.setAckMode( CommandConstants::ACK_CLIENT );
+                }
+                cmd.setDestination( destination->toProviderString() );
+                cmd.setNoLocal( noLocal );
+
+                if( name != "" )
+                {
+                    cmd.setSubscriptionName( name );
+                }
+                
+                // The Selector is set on the first subscribe on this dest,
+                // and if another consumer is created on this destination
+                // that specifies a selector it will be ignored.  While 
+                // this is not ideal, is the only way to handle the fact
+                // that activemq stomp doesn't support multiple sessions.
+                if( selector != "" )
+                {
+                    cmd.setMessageSelector( selector );
+                }
+        
+                // Fire the message        
+                transport->oneway( &cmd );
+            }
+             
+            // Initialize a new Consumer info Message
+            ConsumerInfo* consumer = new StompConsumerInfo();
+            
+            consumer->setConsumerId( getNextConsumerId() );
+            consumer->setDestination( *destination );
+            consumer->setMessageSelector( selector );
+            consumer->setSessionInfo( session );
+    
+            // Store this consumer for later message dispatching.        
+            consumerMap.insert( 
+                make_pair( consumer->getConsumerId(), consumer ) );
+            
+            return consumer;
+        }
+        
+        return NULL;
+    }
+    AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCHALL_THROW( ConnectorException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void StompSessionManager::removeConsumer(
+    connector::ConsumerInfo* consumer)
+        throw( ConnectorException )
+{
+    try
+    {
+        synchronized(&mutex)
+        {
+            DestinationMap::iterator itr = 
+                destinationMap.find( consumer->getDestination().toString() );
+                
+            if( itr == destinationMap.end() )
+            {
+                // Already removed from the map
+                return;
+            }
+            
+            ConsumerMap& consumers = itr->second;
+            
+            // Remove from the map.
+            consumers.erase( consumer->getConsumerId() );
+            
+            // If there are no more on this destination then we unsubscribe
+            if( consumers.empty() )
+            {
+                UnsubscribeCommand cmd;
+                
+                cmd.setDestination( 
+                    consumer->getDestination().toProviderString() );
+                
+                // Send the message
+                transport->oneway( &cmd );
+            }    
+        }
+    }
+    AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCHALL_THROW( ConnectorException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void StompSessionManager::onStompCommand( commands::StompCommand* command ) 
+    throw ( StompConnectorException )
+{
+    try
+    {
+        cms::Message* message = dynamic_cast< cms::Message*>( command );
+
+        if( message == NULL )
+        {
+            throw StompConnectorException(
+                __FILE__, __LINE__,
+                "StompSessionManager::onStompCommand - Invalid Command" );
+        }
+
+        if( messageListener == NULL )
+        {
+            throw StompConnectorException(
+                __FILE__, __LINE__,
+                "StompSessionManager::onStompCommand - "
+                "No Message Listener Registered." );
+        }
+                
+        synchronized(&mutex)
+        {
+            DestinationMap::iterator itr = 
+                destinationMap.find( message->getCMSDestination().toString() );
+
+            if( itr == destinationMap.end() )
+            {
+                throw StompConnectorException(
+                    __FILE__, __LINE__,
+                    "StompSessionManager::onStompCommand - "
+                    "Received a Message that doesn't have a listener" );
+            }
+
+            // If we only have 1 consumer, we don't need to clone the original
+            // message.
+            if(itr->second.size() == 1)
+            {
+                ConsumerInfo* consumerInfo = itr->second.begin()->second;
+                
+                if( StompSelector::isSelected( 
+                        consumerInfo->getMessageSelector(),
+                        message ) )
+                {                    
+                    ActiveMQMessage* msg = 
+                        dynamic_cast< ActiveMQMessage* >( message );
+                    messageListener->onConsumerMessage( consumerInfo, msg );
+                }
+                
+                return;
+            }
+
+            // We have more than one consumer of this message - we have to
+            // clone the message for each consumer so they don't destroy each other's
+            // message.
+            ConsumerMap::iterator c_itr = itr->second.begin();
+            
+            for(; c_itr != itr->second.end(); ++c_itr )
+            {
+                ConsumerInfo* consumerInfo = c_itr->second;
+                
+                if( StompSelector::isSelected( 
+                        consumerInfo->getMessageSelector(),
+                        message ) )
+                {
+                    ActiveMQMessage* msg = 
+                        dynamic_cast< ActiveMQMessage* >( message->clone() );
+                    messageListener->onConsumerMessage( consumerInfo, msg );
+                }
+            }
+            
+            // We got here which means that we sent copies, so remove
+            // the original.
+            delete command;
+        }
+    }
+    AMQ_CATCH_RETHROW( StompConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, StompConnectorException )
+    AMQ_CATCHALL_THROW( StompConnectorException )
+}

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



Mime
View raw message