activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r893370 - /activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
Date Wed, 23 Dec 2009 01:12:26 GMT
Author: tabish
Date: Wed Dec 23 01:12:25 2009
New Revision: 893370

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

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp?rev=893370&r1=893369&r2=893370&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
Wed Dec 23 01:12:25 2009
@@ -48,35 +48,37 @@
     //
     std::string brokerURI = "failover:(tcp://127.0.0.1:61616)";
 
-    // Create the Connection
-    auto_ptr<cms::ConnectionFactory> connectionFactory(
-        cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
-
-    auto_ptr<cms::Connection> connection;
-
-    // Create a Connection
-    try{
-        connection.reset( connectionFactory->createConnection() );
-    } catch( CMSException& e ) {
-        e.printStackTrace();
-        return 1;
-    }
-
-    // Create the Session
-    std::auto_ptr<cms::Session> session( connection->createSession() );
-
-    // Create the Advisory Consumer and run it.
-    TempDestinationAdvisoryConsumer advisoryConsumer( session.get() );
+    {
+        // Create the Connection
+        auto_ptr<cms::ConnectionFactory> connectionFactory(
+            cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
+
+        auto_ptr<cms::Connection> connection;
+
+        // Create a Connection
+        try{
+            connection.reset( connectionFactory->createConnection() );
+        } catch( CMSException& e ) {
+            e.printStackTrace();
+            return 1;
+        }
+
+        // Create the Session
+        std::auto_ptr<cms::Session> session( connection->createSession() );
+
+        // Create the Advisory Consumer and run it.
+        TempDestinationAdvisoryConsumer advisoryConsumer( session.get() );
+
+        // Start the Connection now.
+        connection->start();
+
+        // Wait until we are told to quit.
+        std::cout << "Press 'q' to quit" << std::endl;
+        while( std::cin.get() != 'q') {}
 
-    // Start the Connection now.
-    connection->start();
-
-    // Wait until we are told to quit.
-    std::cout << "Press 'q' to quit" << std::endl;
-    while( std::cin.get() != 'q') {}
-
-    // Shutdown now
-    connection->stop();
+        // Shutdown now
+        connection->stop();
+    }
 
     std::cout << "-----------------------------------------------------\n";
     std::cout << "Finished with the example." << std::endl;



Mime
View raw message