You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/03/18 14:12:14 UTC

svn commit: r519609 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp

Author: tabish
Date: Sun Mar 18 06:12:13 2007
New Revision: 519609

URL: http://svn.apache.org/viewvc?view=rev&rev=519609
Log:
https://issues.apache.org/activemq/browse/AMQCPP-92

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?view=diff&rev=519609&r1=519608&r2=519609
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp Sun Mar 18 06:12:13 2007
@@ -38,7 +38,7 @@
     this->started = false;
     this->closed = false;
     this->exceptionListener = NULL;
-    
+
     alwaysSessionAsync = Boolean::parseBoolean(
         connectionData->getProperties().getProperty( "alwaysSessionAsync", "true" ) );
 
@@ -60,7 +60,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConnection::addDispatcher( connector::ConsumerInfo* consumer, 
+void ActiveMQConnection::addDispatcher( connector::ConsumerInfo* consumer,
     Dispatcher* dispatcher )
 {
     // Add the consumer to the map.
@@ -69,10 +69,10 @@
         dispatchers.setValue( consumer->getConsumerId(), dispatcher );
     }
 }
-        
+
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQConnection::removeDispatcher( const connector::ConsumerInfo* consumer ) {
-    
+
     // Remove the consumer from the map.
     synchronized( &dispatchers )
     {
@@ -92,15 +92,15 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-cms::Session* ActiveMQConnection::createSession( 
+cms::Session* ActiveMQConnection::createSession(
     cms::Session::AcknowledgeMode ackMode ) throw ( cms::CMSException )
 {
     try
     {
-        // Determine whether or not to make dispatch for this session asynchronous        
-        bool doSessionAsync = alwaysSessionAsync || !activeSessions.isEmpty() || 
+        // Determine whether or not to make dispatch for this session asynchronous
+        bool doSessionAsync = alwaysSessionAsync || !activeSessions.isEmpty() ||
             ackMode==Session::SESSION_TRANSACTED || ackMode==Session::CLIENT_ACKNOWLEDGE;
-                        
+
         // Create the session instance.
         ActiveMQSession* session = new ActiveMQSession(
             connectionData->getConnector()->createSession( ackMode ),
@@ -112,7 +112,7 @@
         synchronized( &activeSessions ) {
             activeSessions.add( session );
         }
-        
+
         // If we're already started, start the session.
         if( started ) {
             session->start();
@@ -179,7 +179,7 @@
     // messages delivered while this connection is stopped are dropped
     // and not acknowledged.
     started = true;
-    
+
     // Start all the sessions.
     std::vector<ActiveMQSession*> sessions = activeSessions.toArray();
     for( unsigned int ix=0; ix<sessions.size(); ++ix ) {
@@ -193,8 +193,8 @@
     // Once current deliveries are done this stops the delivery of any
     // new messages.
     started = false;
-    
-    // Start all the sessions.
+
+    // Stop all the sessions.
     std::vector<ActiveMQSession*> sessions = activeSessions.toArray();
     for( unsigned int ix=0; ix<sessions.size(); ++ix ) {
         sessions[ix]->stop();
@@ -242,7 +242,7 @@
         {
             dispatcher = dispatchers.getValue(consumer->getConsumerId());
         }
-        
+
         // Dispatch the message.
         if( dispatcher != NULL ) {
             DispatchData data( consumer, message );