Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 87447 invoked from network); 23 Dec 2009 01:13:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Dec 2009 01:13:58 -0000 Received: (qmail 75515 invoked by uid 500); 23 Dec 2009 01:13:58 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 75465 invoked by uid 500); 23 Dec 2009 01:13:58 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 75456 invoked by uid 99); 23 Dec 2009 01:13:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2009 01:13:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2009 01:13:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9FB7523889B8; Wed, 23 Dec 2009 01:13:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r893371 - /activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp Date: Wed, 23 Dec 2009 01:13:35 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091223011335.9FB7523889B8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Wed Dec 23 01:13:35 2009 New Revision: 893371 URL: http://svn.apache.org/viewvc?rev=893371&view=rev Log: http://issues.apache.org/activemq/browse/AMQCPP-273 Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp?rev=893371&r1=893370&r2=893371&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp Wed Dec 23 01:13:35 2009 @@ -48,35 +48,37 @@ // std::string brokerURI = "failover:(tcp://127.0.0.1:61616)"; - // Create the Connection - auto_ptr connectionFactory( - cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) ); - - auto_ptr connection; - - // Create a Connection - try{ - connection.reset( connectionFactory->createConnection() ); - } catch( CMSException& e ) { - e.printStackTrace(); - return 1; - } - - // Create the Session - std::auto_ptr session( connection->createSession() ); - - // Create the Advisory Consumer and run it. - TempDestinationAdvisoryConsumer advisoryConsumer( session.get() ); + { + // Create the Connection + auto_ptr connectionFactory( + cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) ); + + auto_ptr connection; + + // Create a Connection + try{ + connection.reset( connectionFactory->createConnection() ); + } catch( CMSException& e ) { + e.printStackTrace(); + return 1; + } + + // Create the Session + std::auto_ptr 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;