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 2008/11/12 15:21:51 UTC

svn commit: r713376 [2/2] - /activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.cpp?rev=713376&r1=713375&r2=713376&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.cpp Wed Nov 12 06:21:50 2008
@@ -23,8 +23,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionPool::SessionPool( cms::Connection* connection,
-    cms::Session::AcknowledgeMode ackMode,
-    ResourceLifecycleManager* resourceLifecycleManager) {
+                          cms::Session::AcknowledgeMode ackMode,
+                          ResourceLifecycleManager* resourceLifecycleManager) {
 
     this->connection = connection;
     this->acknowledgeMode = ackMode;
@@ -44,7 +44,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-PooledSession* SessionPool::takeSession() throw (cms::CMSException){
+PooledSession* SessionPool::takeSession() throw ( cms::CMSException ){
 
     synchronized(&mutex) {
 
@@ -54,17 +54,17 @@
         if( available.size() == 0 ) {
 
             // No sessions were available - create a new one.
-            cms::Session* session = connection->createSession(acknowledgeMode);
+            cms::Session* session = connection->createSession( acknowledgeMode );
 
-            // Give this resource to the lifecycle manager to manage. The pool
+            // Give this resource to the life-cycle manager to manage. The pool
             // will not be in charge of destroying this resource.
-            resourceLifecycleManager->addSession(session);
+            resourceLifecycleManager->addSession( session );
 
             // Now wrap the session with a pooled session.
-            pooledSession = new PooledSession(this, session);
+            pooledSession = new PooledSession( this, session );
 
             // Add to the sessions list.
-            sessions.push_back(pooledSession);
+            sessions.push_back( pooledSession );
 
         } else {
 
@@ -85,9 +85,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 void SessionPool::returnSession( PooledSession* session ) {
 
-    synchronized(&mutex) {
+    synchronized( &mutex ) {
 
         // Add to the available list.
-        available.push_back(session);
+        available.push_back( session );
     }
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.h?rev=713376&r1=713375&r2=713376&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/SessionPool.h Wed Nov 12 06:21:50 2008
@@ -63,9 +63,9 @@
          *          the object responsible for managing the lifecycle of
          *          any allocated cms::Session resources.
          */
-        SessionPool(cms::Connection* connection,
-                cms::Session::AcknowledgeMode ackMode,
-                ResourceLifecycleManager* resourceLifecycleManager );
+        SessionPool( cms::Connection* connection,
+                     cms::Session::AcknowledgeMode ackMode,
+                     ResourceLifecycleManager* resourceLifecycleManager );
 
         /**
          * Destroys the pooled session objects, but not the underlying session
@@ -80,14 +80,14 @@
          *
          * @throws cms::CMSException if an error occurred
          */
-        virtual PooledSession* takeSession() throw (cms::CMSException);
+        virtual PooledSession* takeSession() throw ( cms::CMSException );
 
         /**
          * Returns a session to the pool.
          * @param session
          *         the session to be returned.
          */
-        virtual void returnSession(PooledSession* session);
+        virtual void returnSession( PooledSession* session );
 
         ResourceLifecycleManager* getResourceLifecycleManager() {
             return resourceLifecycleManager;