From commits-return-20809-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Wed Dec 12 00:31:11 2012 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A498D043 for ; Wed, 12 Dec 2012 00:31:11 +0000 (UTC) Received: (qmail 71610 invoked by uid 500); 12 Dec 2012 00:31:11 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 71573 invoked by uid 500); 12 Dec 2012 00:31:11 -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 71559 invoked by uid 99); 12 Dec 2012 00:31:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 00:31:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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, 12 Dec 2012 00:31:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E147523888CD; Wed, 12 Dec 2012 00:30:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1420499 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport: AbstractTransportFactory.cpp IOTransport.cpp TransportFilter.cpp Date: Wed, 12 Dec 2012 00:30:46 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121212003046.E147523888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Wed Dec 12 00:30:44 2012 New Revision: 1420499 URL: http://svn.apache.org/viewvc?rev=1420499&view=rev Log: Some small code cleanup Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/AbstractTransportFactory.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/AbstractTransportFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/AbstractTransportFactory.cpp?rev=1420499&r1=1420498&r2=1420499&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/AbstractTransportFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/AbstractTransportFactory.cpp Wed Dec 12 00:30:44 2012 @@ -38,23 +38,16 @@ using namespace decaf::util; //////////////////////////////////////////////////////////////////////////////// AbstractTransportFactory::~AbstractTransportFactory() { - } //////////////////////////////////////////////////////////////////////////////// -Pointer AbstractTransportFactory::createWireFormat( - const decaf::util::Properties& properties ) { - - try{ - - std::string wireFormat = properties.getProperty( "wireFormat", "openwire" ); - - WireFormatFactory* factory = - WireFormatRegistry::getInstance().findFactory( wireFormat ); - - return factory->createWireFormat( properties ); +Pointer AbstractTransportFactory::createWireFormat(const decaf::util::Properties& properties) { + try { + std::string wireFormat = properties.getProperty("wireFormat", "openwire"); + WireFormatFactory* factory = WireFormatRegistry::getInstance().findFactory(wireFormat); + return factory->createWireFormat(properties); } - AMQ_CATCH_RETHROW( NoSuchElementException ) - AMQ_CATCH_EXCEPTION_CONVERT( Exception, NoSuchElementException ) - AMQ_CATCHALL_THROW( NoSuchElementException ) + AMQ_CATCH_RETHROW(NoSuchElementException) + AMQ_CATCH_EXCEPTION_CONVERT(Exception, NoSuchElementException) + AMQ_CATCHALL_THROW(NoSuchElementException) } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp?rev=1420499&r1=1420498&r2=1420499&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp Wed Dec 12 00:30:44 2012 @@ -71,6 +71,7 @@ void IOTransport::fire(decaf::lang::Exce void IOTransport::fire(const Pointer command) { try { + // If we have been closed then we don't deliver any messages that // might have sneaked in while we where closing. if (this->listener == NULL || this->closed == true) { @@ -78,7 +79,6 @@ void IOTransport::fire(const Pointerlistener->onCommand(command); - } AMQ_CATCHALL_NOTHROW() } @@ -153,9 +153,9 @@ void IOTransport::stop() { try { } - AMQ_CATCH_RETHROW( IOException) - AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException) - AMQ_CATCHALL_THROW( IOException) + AMQ_CATCH_RETHROW(IOException) + AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException) + AMQ_CATCHALL_THROW(IOException) } //////////////////////////////////////////////////////////////////////////////// @@ -168,9 +168,8 @@ void IOTransport::close() { public: - Finalizer(Pointer target) : - target(target) { - } + Finalizer(Pointer target) : target(target) {} + ~Finalizer() { try { target->join(); @@ -232,9 +231,9 @@ void IOTransport::close() { throw error; } } - AMQ_CATCH_RETHROW( IOException) - AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException) - AMQ_CATCHALL_THROW( IOException) + AMQ_CATCH_RETHROW(IOException) + AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException) + AMQ_CATCHALL_THROW(IOException) } //////////////////////////////////////////////////////////////////////////////// Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp?rev=1420499&r1=1420498&r2=1420499&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp Wed Dec 12 00:30:44 2012 @@ -130,9 +130,9 @@ void TransportFilter::reconnect(const de try { next->reconnect(uri); } - AMQ_CATCH_RETHROW( IOException) - AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException) - AMQ_CATCHALL_THROW( IOException) + AMQ_CATCH_RETHROW(IOException) + AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException) + AMQ_CATCHALL_THROW(IOException) } ////////////////////////////////////////////////////////////////////////////////