From commitstranthomas@example.com Sat Nov 01 17:47:07 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 68964 invoked from network); 1 Nov 2008 17:47:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Nov 2008 17:47:06 -0000 Received: (qmail 74910 invoked by uid 500); 1 Nov 2008 17:47:12 -0000 Delivered-To: tranthomas@example.com Received: (qmail 74886 invoked by uid 500); 1 Nov 2008 17:47:12 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 74877 invoked by uid 99); 1 Nov 2008 17:47:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 10:47:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 17:46:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 34BF12388961; Sat, 1 Nov 2008 10:46:45 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709735 - in /activemq/trunk: activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java pom.xml Date: Sat, 01 Nov 2008 17:46:44 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: janstey Date: Sat Nov 1 10:46:44 2008 New Revision: 709735 URL: http://svn.apache.org/viewvc?rev=709735&view=rev Log: AMQ-1986 - Upgrade to Camel 1.5.0 Modified: activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java activemq/trunk/pom.xml Modified: activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java?rev=709735&r1=709734&r2=709735&view=diff ============================================================================== --- activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java (original) +++ activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/JournalEndpoint.java Sat Nov 1 10:46:44 2008 @@ -27,6 +27,7 @@ import org.apache.camel.CamelExchangeException; import org.apache.camel.Consumer; import org.apache.camel.Exchange; +import org.apache.camel.NoTypeConversionAvailableException; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; @@ -188,9 +189,10 @@ public void process(Exchange exchange) throws Exception { incrementReference(); try { - - ByteSequence body = exchange.getIn().getBody(ByteSequence.class); - if (body == null) { + ByteSequence body = null; + try { + body = exchange.getIn().getBody(ByteSequence.class); + } catch(NoTypeConversionAvailableException e) { byte[] bytes = exchange.getIn().getBody(byte[].class); if (bytes != null) { body = new ByteSequence(bytes); Modified: activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java?rev=709735&r1=709734&r2=709735&view=diff ============================================================================== --- activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java (original) +++ activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/AutoExposeQueuesInCamelTest.java Sat Nov 1 10:46:44 2008 @@ -16,15 +16,17 @@ */ package org.apache.activemq.camel.component; +import java.util.ArrayList; +import java.util.Collection; import java.util.List; -import org.apache.activemq.EmbeddedBrokerTestSupport; -import org.apache.activemq.broker.BrokerService; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; +import org.apache.activemq.EmbeddedBrokerTestSupport; +import org.apache.activemq.broker.BrokerService; import org.apache.camel.CamelContext; -import org.apache.camel.CamelTemplate; +import org.apache.camel.Endpoint; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.spi.BrowsableEndpoint; import org.apache.camel.util.CamelContextHelper; @@ -44,18 +46,31 @@ protected ActiveMQTopic sampleTopic = new ActiveMQTopic("cheese"); protected CamelContext camelContext = new DefaultCamelContext(); - protected CamelTemplate template; public void testWorks() throws Exception { Thread.sleep(2000); LOG.debug("Looking for endpoints..."); - List<BrowsableEndpoint> endpoints = CamelContextHelper.getSingletonEndpoints(camelContext, BrowsableEndpoint.class); + // Changed from using CamelContextHelper.getSingletonEndpoints here because JMS Endpoints in Camel + // are always non-singleton + List<BrowsableEndpoint> endpoints = getEndpoints(camelContext, BrowsableEndpoint.class); for (BrowsableEndpoint endpoint : endpoints) { LOG.debug("Endpoint: " + endpoint); } assertEquals("Should have found an endpoint: "+ endpoints, 1, endpoints.size()); } + public <T> List<T> getEndpoints(CamelContext camelContext, Class<T> type) { + List<T> answer = new ArrayList<T>(); + Collection<Endpoint> endpoints = camelContext.getEndpoints(); + for (Endpoint endpoint : endpoints) { + if (type.isInstance(endpoint)) { + T value = type.cast(endpoint); + answer.add(value); + } + } + return answer; + } + @Override protected void setUp() throws Exception { super.setUp(); Modified: activemq/trunk/pom.xml URL: http://svn.apache.org/viewvc/activemq/trunk/pom.xml?rev=709735&r1=709734&r2=709735&view=diff ============================================================================== --- activemq/trunk/pom.xml (original) +++ activemq/trunk/pom.xml Sat Nov 1 10:46:44 2008 @@ -42,7 +42,7 @@ <aopalliance-version>1.0</aopalliance-version> <axion-version>1.0-M3-dev</axion-version> <axis-version>1.2-RC1</axis-version> - <camel-version>1.4.0</camel-version> + <camel-version>1.5.0</camel-version> <cglib-version>2.0</cglib-version> <commons-beanutils-version>1.6.1</commons-beanutils-version> <commons-collections-version>3.1</commons-collections-version> From commitstranthomas@example.com Sat Nov 01 21:41:59 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 53185 invoked from network); 1 Nov 2008 21:41:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Nov 2008 21:41:59 -0000 Received: (qmail 3236 invoked by uid 500); 1 Nov 2008 21:42:05 -0000 Delivered-To: tranthomas@example.com Received: (qmail 3207 invoked by uid 500); 1 Nov 2008 21:42:05 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 3198 invoked by uid 99); 1 Nov 2008 21:42:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 14:42:05 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 21:40:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A972E2388975; Sat, 1 Nov 2008 14:41:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709783 - /activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp Date: Sat, 01 Nov 2008 21:41:08 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Nov 1 14:41:08 2008 New Revision: 709783 URL: http://svn.apache.org/viewvc?rev=709783&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp?rev=709783&r1=709782&r2=709783&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp (original) +++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp Sat Nov 1 14:41:08 2008 @@ -373,6 +373,8 @@ cms888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TextMessage* textMsg = session2->createTextMessage(); + Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4sleep(50); + // Send some text messages producer->send( textMsg ); From commitstranthomas@example.com Sun Nov 02 03:32:15 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 79343 invoked from network); 2 Nov 2008 03:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 03:32:15 -0000 Received: (qmail 49832 invoked by uid 500); 2 Nov 2008 03:32:21 -0000 Delivered-To: tranthomas@example.com Received: (qmail 49814 invoked by uid 500); 2 Nov 2008 03:32:21 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 49805 invoked by uid 99); 2 Nov 2008 03:32:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 20:32:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 03:31:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 49A5E238889E; Sat, 1 Nov 2008 20:31:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709836 - /activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp Date: Sun, 02 Nov 2008 03:31:24 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Nov 1 20:31:23 2008 New Revision: 709836 URL: http://svn.apache.org/viewvc?rev=709836&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Modified: activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp Modified: activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp?rev=709836&r1=709835&r2=709836&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp (original) +++ activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/MutexTest.cpp Sat Nov 1 20:31:23 2008 @@ -365,6 +365,7 @@ // Delete all the threads. for( int ix=0; ix<numThreads; ++ix ){ + threads[ix]->join(); delete threads[ix]; } @@ -542,6 +543,7 @@ // Delete all the threads. for( int ix=0; ix<numThreads; ++ix ){ + threads[ix]->join(); delete threads[ix]; } From commitstranthomas@example.com Sun Nov 02 03:36:28 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 79662 invoked from network); 2 Nov 2008 03:36:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 03:36:28 -0000 Received: (qmail 50136 invoked by uid 500); 2 Nov 2008 03:36:34 -0000 Delivered-To: tranthomas@example.com Received: (qmail 50114 invoked by uid 500); 2 Nov 2008 03:36:34 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 50105 invoked by uid 99); 2 Nov 2008 03:36:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 20:36:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 03:35:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 307F0238889E; Sat, 1 Nov 2008 20:36:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709837 - /activemq/activemq-cpp/trunk/src/test/main.cpp Date: Sun, 02 Nov 2008 03:36:06 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Nov 1 20:36:06 2008 New Revision: 709837 URL: http://svn.apache.org/viewvc?rev=709837&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Modified: activemq/activemq-cpp/trunk/src/test/main.cpp Modified: activemq/activemq-cpp/trunk/src/test/main.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/main.cpp?rev=709837&r1=709836&r2=709837&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test/main.cpp (original) +++ activemq/activemq-cpp/trunk/src/test/main.cpp Sat Nov 1 20:36:06 2008 @@ -21,21 +21,26 @@ #include <cppunit/TestResult.h> #include <activemq/util/Config.h> #include <decaf/lang/Runtime.h> +#include <iostream> int main( int argc AMQCPP_UNUSED, char **argv AMQCPP_UNUSED) { // ensure that we start the runtime. d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runtim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getRuntime(); + bool wasSuccessful = false; - CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TextUi888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestRunner runner; - CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestFactoryRegistry &registry = CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestFactoryRegistry888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getRegistry(); - runner.addTest( registry.makeTest() ); - - // Shows a message as each test starts - CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4riefTestProgressListener listener; - runner.eventManager().addListener( &listener ); + for( int i = 0; i < 1; ++i ) { + CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TextUi888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestRunner runner; + CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestFactoryRegistry &registry = CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TestFactoryRegistry888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getRegistry(); + runner.addTest( registry.makeTest() ); + + // Shows a message as each test starts + CppUnit888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4riefTestProgressListener listener; + runner.eventManager().addListener( &listener ); + + wasSuccessful = runner.run( "", false ); + } - bool wasSuccessful = runner.run( "", false ); return !wasSuccessful; } From commitstranthomas@example.com Sun Nov 02 13:14:26 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 54703 invoked from network); 2 Nov 2008 13:14:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 13:14:26 -0000 Received: (qmail 3053 invoked by uid 500); 2 Nov 2008 13:14:32 -0000 Delivered-To: tranthomas@example.com Received: (qmail 3029 invoked by uid 500); 2 Nov 2008 13:14:31 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 3020 invoked by uid 99); 2 Nov 2008 13:14:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 05:14:31 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 13:13:23 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CB45823888F4; Sun, 2 Nov 2008 05:13:34 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709878 - /activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Date: Sun, 02 Nov 2008 13:13:34 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 05:13:34 2008 New Revision: 709878 URL: http://svn.apache.org/viewvc?rev=709878&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leak Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp?rev=709878&r1=709877&r2=709878&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Sun Nov 2 05:13:34 2008 @@ -170,6 +170,11 @@ return; } + if( this->cause != NULL ) { + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cout << "Deleting old Cause" << st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4endl; + delete this->cause; + } + const Exception* ptrCause = dynamic_cast<const Exception*>( cause ); if( ptrCause == NULL ) { this->cause = new Exception( __FILE__, __LINE__, cause->what() ); From commitstranthomas@example.com Sun Nov 02 20:27:04 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 61889 invoked from network); 2 Nov 2008 20:27:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 20:27:04 -0000 Received: (qmail 23068 invoked by uid 500); 2 Nov 2008 20:27:10 -0000 Delivered-To: tranthomas@example.com Received: (qmail 23046 invoked by uid 500); 2 Nov 2008 20:27:10 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 23037 invoked by uid 99); 2 Nov 2008 20:27:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 12:27:10 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 20:26:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 747EB2388879; Sun, 2 Nov 2008 12:26:13 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709920 - /activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Date: Sun, 02 Nov 2008 20:26:13 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 12:26:12 2008 New Revision: 709920 URL: http://svn.apache.org/viewvc?rev=709920&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leak Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp?rev=709920&r1=709919&r2=709920&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Sun Nov 2 12:26:12 2008 @@ -188,9 +188,9 @@ // copy from the current pos to the beginning all the remaining bytes // the set pos to the - memcpy( this->array() + offset, - this->array() + offset + this->position(), - this->remaining() ); + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < this->remaining(); ++ix ) { + this->put( ix, this->get( this->position() + ix ) ); + } this->position( this->limit() - this->position() ); this->limit( this->capacity() ); From commitstranthomas@example.com Sun Nov 02 22:06:01 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 11204 invoked from network); 2 Nov 2008 22:05:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 22:05:59 -0000 Received: (qmail 80673 invoked by uid 500); 2 Nov 2008 22:06:05 -0000 Delivered-To: tranthomas@example.com Received: (qmail 80655 invoked by uid 500); 2 Nov 2008 22:06:05 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 80646 invoked by uid 99); 2 Nov 2008 22:06:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 14:06:05 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 22:04:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2933E2388879; Sun, 2 Nov 2008 14:05:08 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709950 - in /activemq/activemq-cpp/trunk/src/main/decaf: internal/nio/CharArrayBuffer.cpp nio/CharBuffer.cpp Date: Sun, 02 Nov 2008 22:05:07 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 14:05:07 2008 New Revision: 709950 URL: http://svn.apache.org/viewvc?rev=709950&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leak Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp activemq/activemq-cpp/trunk/src/main/decaf/nio/CharBuffer.cpp Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp?rev=709950&r1=709949&r2=709950&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/CharArrayBuffer.cpp Sun Nov 2 14:05:07 2008 @@ -17,6 +17,7 @@ #include "CharArrayBuffer.h" #include <string.h> +#include <memory> using namespace decaf; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang; @@ -305,6 +306,8 @@ CharSequence* CharArrayBuffer888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4subSequence( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t start, st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t end ) const throw ( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xceptions888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IndexOutOfBoundsException ) { + CharArrayBuffer* buffer = NULL; + try{ if( start > end ) { @@ -319,12 +322,11 @@ "CharArrayBuffer888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4subSequence - Sequence exceed limit" ); } - CharArrayBuffer* buffer = new CharArrayBuffer( *this ); - + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<CharArrayBuffer> buffer( new CharArrayBuffer( *this ) ); buffer->position( this->position() + start ); buffer->limit( this->position() + end ); - return buffer; + return buffer.release(); } DECAF_CATCH_RETHROW( IndexOutOfBoundsException ) DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException ) Modified: activemq/activemq-cpp/trunk/src/main/decaf/nio/CharBuffer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/nio/CharBuffer.cpp?rev=709950&r1=709949&r2=709950&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/nio/CharBuffer.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/nio/CharBuffer.cpp Sun Nov 2 14:05:07 2008 @@ -19,6 +19,7 @@ #include <decaf/lang/Character.h> #include <decaf/lang/Math.h> #include "decaf/internal/nio/BufferFactory.h" +#include <memory> using namespace std; using namespace decaf; @@ -135,9 +136,8 @@ try{ if( value != NULL ) { - CharSequence* temp = value->subSequence( start, end ); - this->append( temp ); - delete temp; + auto_ptr<CharSequence> temp( value->subSequence( start, end ) ); + this->append( temp.get() ); return *this; } @@ -391,10 +391,9 @@ st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t result = (st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t)Math888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4min( (int)target->remaining(), (int)this->remaining() ); - char* chars = new char[result]; - get( chars, 0, result ); - target->put( chars, 0, result ); - delete [] chars; + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4vector<char> chars( result, 0 ); + get( &chars[0], 0, result ); + target->put( &chars[0], 0, result ); return result; } From commitstranthomas@example.com Sun Nov 02 22:06:42 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 11899 invoked from network); 2 Nov 2008 22:06:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 22:06:42 -0000 Received: (qmail 81527 invoked by uid 500); 2 Nov 2008 22:06:48 -0000 Delivered-To: tranthomas@example.com Received: (qmail 81508 invoked by uid 500); 2 Nov 2008 22:06:48 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 81499 invoked by uid 99); 2 Nov 2008 22:06:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 14:06:48 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 22:05:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B270C23888EB; Sun, 2 Nov 2008 14:05:51 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709951 - /activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp Date: Sun, 02 Nov 2008 22:05:51 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 14:05:51 2008 New Revision: 709951 URL: http://svn.apache.org/viewvc?rev=709951&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leaks and resolving Valgrind warnings. Modified: activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp Modified: activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp?rev=709951&r1=709950&r2=709951&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp (original) +++ activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/CharArrayBufferTest.cpp Sun Nov 2 14:05:51 2008 @@ -460,6 +460,13 @@ char* array = new char[testBuffer1->capacity()]; char* array2 = new char[testBuffer1->capacity() + 1]; + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < testBuffer1->capacity(); ++ix ){ + array[ix] = 0; + } + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < testBuffer1->capacity() + 1; ++ix ){ + array2[ix] = 0; + } + CharBuffer* readOnly = testBuffer1->asReadOnlyBuffer(); readOnly->clear(); CPPUNIT_ASSERT_THROW_MESSAGE( From commitstranthomas@example.com Sun Nov 02 22:09:50 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 14388 invoked from network); 2 Nov 2008 22:09:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 22:09:50 -0000 Received: (qmail 83116 invoked by uid 500); 2 Nov 2008 22:09:56 -0000 Delivered-To: tranthomas@example.com Received: (qmail 83091 invoked by uid 500); 2 Nov 2008 22:09:56 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 83082 invoked by uid 99); 2 Nov 2008 22:09:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 14:09:56 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 22:08:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A3F972388879; Sun, 2 Nov 2008 14:08:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709953 - /activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp Date: Sun, 02 Nov 2008 22:08:59 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 14:08:59 2008 New Revision: 709953 URL: http://svn.apache.org/viewvc?rev=709953&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leaks and resolving Valgrind warnings. Modified: activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp Modified: activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp?rev=709953&r1=709952&r2=709953&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp (original) +++ activemq/activemq-cpp/trunk/src/test/decaf/internal/nio/ByteArrayBufferTest.cpp Sun Nov 2 14:08:59 2008 @@ -460,6 +460,13 @@ unsigned char* array = new unsigned char[testBuffer1->capacity()]; unsigned char* array2 = new unsigned char[testBuffer1->capacity() + 1]; + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < testBuffer1->capacity(); ++ix ){ + array[ix] = 0; + } + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < testBuffer1->capacity()+1; ++ix ){ + array2[ix] = 0; + } + ByteBuffer* readOnly = testBuffer1->asReadOnlyBuffer(); readOnly->clear(); CPPUNIT_ASSERT_THROW_MESSAGE( From commitstranthomas@example.com Sun Nov 02 22:11:45 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 15746 invoked from network); 2 Nov 2008 22:11:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 22:11:45 -0000 Received: (qmail 83603 invoked by uid 500); 2 Nov 2008 22:11:51 -0000 Delivered-To: tranthomas@example.com Received: (qmail 83581 invoked by uid 500); 2 Nov 2008 22:11:51 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 83572 invoked by uid 99); 2 Nov 2008 22:11:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 14:11:51 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 22:10:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B7B6F23888EB; Sun, 2 Nov 2008 14:11:24 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709954 - /activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp Date: Sun, 02 Nov 2008 22:11:24 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 14:11:24 2008 New Revision: 709954 URL: http://svn.apache.org/viewvc?rev=709954&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leaks and resolving Valgrind warnings. Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp?rev=709954&r1=709953&r2=709954&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/internal/nio/ByteArrayBuffer.cpp Sun Nov 2 14:11:24 2008 @@ -190,9 +190,9 @@ // copy from the current pos to the beginning all the remaining bytes // the set pos to the - memcpy( this->array() + offset, - this->array() + offset + this->position(), - this->remaining() ); + for( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4size_t ix = 0; ix < this->remaining(); ++ix ) { + this->put( ix, this->get( this->position() + ix ) ); + } this->position( this->limit() - this->position() ); this->limit( this->capacity() ); From commitstranthomas@example.com Sun Nov 02 22:28:58 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 23681 invoked from network); 2 Nov 2008 22:28:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2008 22:28:58 -0000 Received: (qmail 3096 invoked by uid 500); 2 Nov 2008 22:29:05 -0000 Delivered-To: tranthomas@example.com Received: (qmail 3038 invoked by uid 500); 2 Nov 2008 22:29:05 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 3029 invoked by uid 99); 2 Nov 2008 22:29:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 14:29:05 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2008 22:27:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 17AB223888EB; Sun, 2 Nov 2008 14:28:08 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709967 - /activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp Date: Sun, 02 Nov 2008 22:28:07 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Nov 2 14:28:07 2008 New Revision: 709967 URL: http://svn.apache.org/viewvc?rev=709967&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leaks and resolving Valgrind warnings. Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp?rev=709967&r1=709966&r2=709967&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp (original) +++ activemq/activemq-cpp/trunk/src/test/activemq/util/MemoryUsageTest.cpp Sun Nov 2 14:28:07 2008 @@ -107,4 +107,7 @@ usage.waitForSpace(); CPPUNIT_ASSERT( usage.getUsage() == 0 ); + + myThread.join(); + } From commitstranthomas@example.com Mon Nov 03 13:05:59 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 43320 invoked from network); 3 Nov 2008 13:05:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 13:05:59 -0000 Received: (qmail 24797 invoked by uid 500); 3 Nov 2008 13:06:05 -0000 Delivered-To: tranthomas@example.com Received: (qmail 24775 invoked by uid 500); 3 Nov 2008 13:06:05 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 24759 invoked by uid 99); 3 Nov 2008 13:06:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 05:06:05 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 13:04:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 94AB92388878; Mon, 3 Nov 2008 05:05:38 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710048 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java Date: Mon, 03 Nov 2008 13:05:38 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Mon Nov 3 05:05:37 2008 New Revision: 710048 URL: http://svn.apache.org/viewvc?rev=710048&view=rev Log: resolve AMQ-1191 - patch applied, thanks Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java?rev=710048&r1=710047&r2=710048&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java Mon Nov 3 05:05:37 2008 @@ -30,7 +30,7 @@ if (statements.isUseLockCreateWhereClause()) { lockCreateStatement += " WHERE ID = 1"; } - lockCreateStatement += " WITH XLOCK"; + lockCreateStatement += " WITH (UPDLOCK, ROWLOCK)"; statements.setLockCreateStatement(lockCreateStatement); super.setStatements(statements); From commitstranthomas@example.com Mon Nov 03 13:57:10 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 76247 invoked from network); 3 Nov 2008 13:57:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 13:57:10 -0000 Received: (qmail 146 invoked by uid 500); 3 Nov 2008 13:57:16 -0000 Delivered-To: tranthomas@example.com Received: (qmail 123 invoked by uid 500); 3 Nov 2008 13:57:16 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 114 invoked by uid 99); 3 Nov 2008 13:57:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 05:57:16 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 13:56:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EE927238889D; Mon, 3 Nov 2008 05:56:19 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710056 - /activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Date: Mon, 03 Nov 2008 13:56:19 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 05:56:19 2008 New Revision: 710056 URL: http://svn.apache.org/viewvc?rev=710056&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Fix possible memory leaks and resolving Valgrind warnings. Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp?rev=710056&r1=710055&r2=710056&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Mon Nov 3 05:56:19 2008 @@ -77,6 +77,7 @@ // Add a future response object to the map indexed by this // command id. + // TODO = This might not get deleted if an exception is thrown. FutureResponse* futureResponse = new FutureResponse(); synchronized( &mapMutex ){ @@ -134,6 +135,7 @@ // Add a future response object to the map indexed by this // command id. + // TODO = This might not get deleted if an exception is thrown. FutureResponse* futureResponse = new FutureResponse(); synchronized( &mapMutex ){ From commitstranthomas@example.com Mon Nov 03 14:02:03 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 78688 invoked from network); 3 Nov 2008 14:02:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 14:02:03 -0000 Received: (qmail 3927 invoked by uid 500); 3 Nov 2008 14:02:09 -0000 Delivered-To: tranthomas@example.com Received: (qmail 3872 invoked by uid 500); 3 Nov 2008 14:02:09 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 3863 invoked by uid 99); 3 Nov 2008 14:02:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 06:02:09 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 14:01:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4F22423888F1; Mon, 3 Nov 2008 06:01:42 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710058 - /activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h Date: Mon, 03 Nov 2008 14:01:42 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 06:01:41 2008 New Revision: 710058 URL: http://svn.apache.org/viewvc?rev=710058&view=rev Log: (empty) Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h?rev=710058&r1=710057&r2=710058&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h Mon Nov 3 06:01:41 2008 @@ -146,7 +146,7 @@ } } - void run(void) { + void run() { try { synchronized( &inboundQueue ) { From commitstranthomas@example.com Mon Nov 03 14:23:40 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 93074 invoked from network); 3 Nov 2008 14:23:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 14:23:40 -0000 Received: (qmail 35760 invoked by uid 500); 3 Nov 2008 14:23:47 -0000 Delivered-To: tranthomas@example.com Received: (qmail 35737 invoked by uid 500); 3 Nov 2008 14:23:46 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 35728 invoked by uid 99); 3 Nov 2008 14:23:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 06:23:46 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 14:22:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7CB96238889E; Mon, 3 Nov 2008 06:22:49 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710061 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport: ThreadNameFilter.java TransportFactory.java Date: Mon, 03 Nov 2008 14:22:49 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Mon Nov 3 06:22:48 2008 New Revision: 710061 URL: http://svn.apache.org/viewvc?rev=710061&view=rev Log: apply threadName filter feature patch for AMQ-1993 Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java (with props) Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java?rev=710061&view=auto ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java (added) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java Mon Nov 3 06:22:48 2008 @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.transport; + +import java.io.IOException; + +/** + * The thread name filter, modifies the name of the thread during the invocation to a transport. + * It appends the remote address, so that a call stuck in a transport method such as socketWrite0 + * will have the destination information in the thread name. + * This is extremely useful for thread dumps when debugging. + * To enable this transport, in the transport URI, simpley add<br/> + * <code>transport.threadName</code>.<br/> + * For example:</br> + * <pre><code> + * &lt;transportConnector + * name=&quot;tcp1&quot; + * uri=&quot;tcp://83.161.120.155:61616?transport.soTimeout=10000&amp;transport.threadName" + * /&gt; + * </code></pre> + * @author Filip Hanik + * + */ +public class ThreadNameFilter extends TransportFilter { + + public ThreadNameFilter(Transport next) { + super(next); + } + + @Override + public void oneway(Object command) throws IOException { + String address =(next!=null?next.getRemoteAddress():null); + if (address!=null) { + String name = Thread.currentThread().getName(); + try { + String sendname = name + " - SendTo:"+address; + Thread.currentThread().setName(sendname); + super.oneway(command); + }finally { + Thread.currentThread().setName(name); + } + } else { + super.oneway(command); + } + } + + + +} Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java?rev=710061&r1=710060&r2=710061&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java Mon Nov 3 06:22:48 2008 @@ -44,6 +44,8 @@ private static final FactoryFinder WIREFORMAT_FACTORY_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/wireformat/"); private static final ConcurrentHashMap<String, TransportFactory> TRANSPORT_FACTORYS = new ConcurrentHashMap<String, TransportFactory>(); + private static final String THREAD_NAME_FILTER = "threadName"; + public abstract TransportServer doBind(URI location) throws IOException; public Transport doConnect(URI location, Executor ex) throws Exception { @@ -263,6 +265,9 @@ * @throws Exception */ public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { + if (options.containsKey(THREAD_NAME_FILTER)) { + transport = new ThreadNameFilter(transport); + } transport = compositeConfigure(transport, format, options); transport = new MutexTransport(transport); return transport; From commitstranthomas@example.com Mon Nov 03 16:26:04 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 83773 invoked from network); 3 Nov 2008 16:26:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 16:26:04 -0000 Received: (qmail 99363 invoked by uid 500); 3 Nov 2008 16:26:10 -0000 Delivered-To: tranthomas@example.com Received: (qmail 99345 invoked by uid 500); 3 Nov 2008 16:26:10 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 99336 invoked by uid 99); 3 Nov 2008 16:26:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 08:26:10 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 16:25:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 71E7723888F1; Mon, 3 Nov 2008 08:25:13 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710094 - /activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Date: Mon, 03 Nov 2008 16:25:13 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 08:25:13 2008 New Revision: 710094 URL: http://svn.apache.org/viewvc?rev=710094&view=rev Log: (empty) Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp?rev=710094&r1=710093&r2=710094&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Mon Nov 3 08:25:13 2008 @@ -26,10 +26,8 @@ //////////////////////////////////////////////////////////////////////////////// ResponseCorrelator888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ResponseCorrelator( Transport* next, bool own ) -: - TransportFilter( next, own ) { + : TransportFilter( next, own ) { - //nextCommandId = 0; nextCommandId.set(1); // Start in the closed state. closed = true; From commitstranthomas@example.com Mon Nov 03 16:32:04 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 85079 invoked from network); 3 Nov 2008 16:32:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 16:32:04 -0000 Received: (qmail 7037 invoked by uid 500); 3 Nov 2008 16:32:11 -0000 Delivered-To: tranthomas@example.com Received: (qmail 7016 invoked by uid 500); 3 Nov 2008 16:32:11 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 7007 invoked by uid 99); 3 Nov 2008 16:32:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 08:32:10 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 16:31:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DE751238889E; Mon, 3 Nov 2008 08:31:13 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710096 - /activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Date: Mon, 03 Nov 2008 16:31:13 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 08:31:13 2008 New Revision: 710096 URL: http://svn.apache.org/viewvc?rev=710096&view=rev Log: Cleanup Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp?rev=710096&r1=710095&r2=710096&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Mon Nov 3 08:31:13 2008 @@ -171,7 +171,6 @@ } if( this->cause != NULL ) { - st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cout << "Deleting old Cause" << st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4endl; delete this->cause; } From commitstranthomas@example.com Mon Nov 03 16:40:38 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 2061 invoked from network); 3 Nov 2008 16:40:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 16:40:38 -0000 Received: (qmail 21617 invoked by uid 500); 3 Nov 2008 16:40:44 -0000 Delivered-To: tranthomas@example.com Received: (qmail 21591 invoked by uid 500); 3 Nov 2008 16:40:44 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 21582 invoked by uid 99); 3 Nov 2008 16:40:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 08:40:44 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 16:39:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DF558238889E; Mon, 3 Nov 2008 08:39:39 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710099 - in /activemq/activemq-cpp/trunk/tools: ./ run-tests.sh start_activemq.sh stop_activemq.sh Date: Mon, 03 Nov 2008 16:39:39 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 08:39:39 2008 New Revision: 710099 URL: http://svn.apache.org/viewvc?rev=710099&view=rev Log: Add a folder for tools with some initial scripts to run the integ tests in a long loop. Added: activemq/activemq-cpp/trunk/tools/ activemq/activemq-cpp/trunk/tools/run-tests.sh (with props) activemq/activemq-cpp/trunk/tools/start_activemq.sh (with props) activemq/activemq-cpp/trunk/tools/stop_activemq.sh (with props) Added: activemq/activemq-cpp/trunk/tools/run-tests.sh URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/tools/run-tests.sh?rev=710099&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/tools/run-tests.sh (added) +++ activemq/activemq-cpp/trunk/tools/run-tests.sh Mon Nov 3 08:39:39 2008 @@ -0,0 +1,14 @@ +#!/bin/bash +ulimit -s unlimited + +for ((i=0;i<100;i+=1)); do + + ./start_activemq.sh + sleep 12 + echo "Running Iteration =" $i + ../build/src/test-integration/activemq-test-integration + killall /opt/local/java/bin/java + #./stop_activemq.sh + sleep 4 +done + Propchange: activemq/activemq-cpp/trunk/tools/run-tests.sh ------------------------------------------------------------------------------ svn:executable = * Added: activemq/activemq-cpp/trunk/tools/start_activemq.sh URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/tools/start_activemq.sh?rev=710099&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/tools/start_activemq.sh (added) +++ activemq/activemq-cpp/trunk/tools/start_activemq.sh Mon Nov 3 08:39:39 2008 @@ -0,0 +1,6 @@ +# Launch Apache's ActiveMQ following their instructions + +cd /home/tabish/dev/apache-activemq-5.1.0 +nohup ./bin/activemq & + + Propchange: activemq/activemq-cpp/trunk/tools/start_activemq.sh ------------------------------------------------------------------------------ svn:executable = * Added: activemq/activemq-cpp/trunk/tools/stop_activemq.sh URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/tools/stop_activemq.sh?rev=710099&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/tools/stop_activemq.sh (added) +++ activemq/activemq-cpp/trunk/tools/stop_activemq.sh Mon Nov 3 08:39:39 2008 @@ -0,0 +1,5 @@ +#!/bin/bash +# Stop java and tail (if any) + +/home/tabish/dev/apache-activemq-5.1.0/bin/activemq-admin stop --all +rm -rf /home/tabish/dev/apache-activemq-5.1.0/data/* Propchange: activemq/activemq-cpp/trunk/tools/stop_activemq.sh ------------------------------------------------------------------------------ svn:executable = * From commitstranthomas@example.com Mon Nov 03 17:31:52 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 31335 invoked from network); 3 Nov 2008 17:31:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 17:31:52 -0000 Received: (qmail 97928 invoked by uid 500); 3 Nov 2008 17:31:58 -0000 Delivered-To: tranthomas@example.com Received: (qmail 97913 invoked by uid 500); 3 Nov 2008 17:31:58 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 97904 invoked by uid 99); 3 Nov 2008 17:31:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 09:31:58 -0800 X-ASF-Spam-Status: No, hits=-1999.3 required=10.0 tests=ALL_TRUSTED,FRT_LEVITRA X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 17:30:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 46047238889E; Mon, 3 Nov 2008 09:31:01 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710109 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport: TransportFactory.java WriteTimeoutFilter.java tcp/TcpBufferedOutputStream.java tcp/TcpTransport.java Date: Mon, 03 Nov 2008 17:31:00 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Mon Nov 3 09:30:59 2008 New Revision: 710109 URL: http://svn.apache.org/viewvc?rev=710109&view=rev Log: apply patch for AMQ-1993, thanks Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java (with props) Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpBufferedOutputStream.java activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java?rev=710109&r1=710108&r2=710109&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java Mon Nov 3 09:30:59 2008 @@ -26,8 +26,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; -import javax.net.ssl.SSLContext; - import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerServiceAware; import org.apache.activemq.broker.SslContext; @@ -44,6 +42,7 @@ private static final FactoryFinder WIREFORMAT_FACTORY_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/wireformat/"); private static final ConcurrentHashMap<String, TransportFactory> TRANSPORT_FACTORYS = new ConcurrentHashMap<String, TransportFactory>(); + private static final String WRITE_TIMEOUT_FILTER = "soWriteTimeout"; private static final String THREAD_NAME_FILTER = "threadName"; public abstract TransportServer doBind(URI location) throws IOException; @@ -265,6 +264,11 @@ * @throws Exception */ public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { + if (options.containsKey(WRITE_TIMEOUT_FILTER)) { + transport = new WriteTimeoutFilter(transport); + String soWriteTimeout = (String)options.get(WRITE_TIMEOUT_FILTER); + if (soWriteTimeout!=null) ((WriteTimeoutFilter)transport).setWriteTimeout(Long.parseLong(soWriteTimeout)); + } if (options.containsKey(THREAD_NAME_FILTER)) { transport = new ThreadNameFilter(transport); } Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java?rev=710109&view=auto ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java (added) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java Mon Nov 3 09:30:59 2008 @@ -0,0 +1,150 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.transport; + +import java.io.IOException; +import java.util.Iterator; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; + +import org.apache.activemq.transport.tcp.TcpBufferedOutputStream; +import org.apache.activemq.transport.tcp.TcpTransport; + +/** + * This filter implements write timeouts for socket write operations. + * When using blocking IO, the Java implementation doesn't have an explicit flag + * to set a timeout, and can cause operations to block forever (or until the TCP stack implementation times out the retransmissions, + * which is usually around 13-30 minutes).<br/> + * To enable this transport, in the transport URI, simpley add<br/> + * <code>transport.soWriteTimeout=<value in millis></code>.<br/> + * For example (15 second timeout on write operations to the socket):</br> + * <pre><code> + * &lt;transportConnector + * name=&quot;tcp1&quot; + * uri=&quot;tcp://83.161.120.155:61616?transport.soTimeout=10000&amp;transport.soWriteTimeout=15000" + * /&gt; + * </code></pre><br/> + * For example (enable default timeout on the socket):</br> + * <pre><code> + * &lt;transportConnector + * name=&quot;tcp1&quot; + * uri=&quot;tcp://83.161.120.155:61616?transport.soTimeout=10000&amp;transport.soWriteTimeout=15000" + * /&gt; + * </code></pre> + * @author Filip Hanik + * + */ +public class WriteTimeoutFilter extends TransportFilter { + + protected static ConcurrentLinkedQueue<WriteTimeoutFilter> writers = new ConcurrentLinkedQueue<WriteTimeoutFilter>(); + protected static AtomicInteger messageCounter = new AtomicInteger(0); + protected static TimeoutThread timeoutThread = new TimeoutThread(); + + protected long writeTimeout = -1; + + public WriteTimeoutFilter(Transport next) { + super(next); + } + + @Override + public void oneway(Object command) throws IOException { + try { + registerWrite(this); + super.oneway(command); + } catch (IOException x) { + deRegisterWrite(this,true,x); + throw x; + } finally { + deRegisterWrite(this,false,null); + } + } + + public long getWriteTimeout() { + return writeTimeout; + } + + public void setWriteTimeout(long writeTimeout) { + this.writeTimeout = writeTimeout; + } + + protected TcpBufferedOutputStream getWriter() { + return next.narrow(TcpBufferedOutputStream.class); + } + + protected static void registerWrite(WriteTimeoutFilter filter) { + writers.add(filter); + } + + protected static boolean deRegisterWrite(WriteTimeoutFilter filter, boolean fail, IOException iox) { + boolean result = writers.remove(filter); + if (result) { + if (fail) { + IOException ex = (iox!=null)?iox:new IOException("Forced write timeout for:"+filter.getNext().getRemoteAddress()); + filter.getTransportListener().onException(ex); + } + } + return result; + } + + @Override + public void start() throws Exception { + super.start(); + } + + @Override + public void stop() throws Exception { + super.stop(); + } + + protected static class TimeoutThread extends Thread { + static AtomicInteger instance = new AtomicInteger(0); + boolean run = true; + public TimeoutThread() { + setName("WriteTimeoutFilter-Timeout-"+instance.incrementAndGet()); + setDaemon(true); + setPriority(Thread.MIN_PRIORITY); + start(); + } + + + public void run() { + while (run) { + if (!interrupted()) { + Iterator<WriteTimeoutFilter> filters = writers.iterator(); + while (run && filters.hasNext()) { + WriteTimeoutFilter filter = filters.next(); + if (filter.getWriteTimeout()<=0) continue; //no timeout set + long writeStart = filter.getWriter().getWriteTimestamp(); + long delta = (filter.getWriter().isWriting() && writeStart>0)?System.currentTimeMillis() - writeStart:-1; + if (delta>filter.getWriteTimeout()) { + WriteTimeoutFilter.deRegisterWrite(filter, true,null); + }//if timeout + }//while + }//if interrupted + try { + Thread.sleep(5000); + } catch (InterruptedException x) { + //do nothing + } + } + } + } + +} Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpBufferedOutputStream.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpBufferedOutputStream.java?rev=710109&r1=710108&r2=710109&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpBufferedOutputStream.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpBufferedOutputStream.java Mon Nov 3 09:30:59 2008 @@ -32,6 +32,8 @@ private byte[] buffer; private int bufferlen; private int count; + private volatile long writeTimestamp = -1;//concurrent reads of this value + /** * Constructor @@ -89,7 +91,12 @@ System.arraycopy(b, off, buffer, count, len); count += len; } else { - out.write(b, off, len); + try { + writeTimestamp = System.currentTimeMillis(); + out.write(b, off, len); + } finally { + writeTimestamp = System.currentTimeMillis(); + } } } } @@ -103,7 +110,12 @@ */ public void flush() throws IOException { if (count > 0 && out != null) { - out.write(buffer, 0, count); + try { + writeTimestamp = System.currentTimeMillis(); + out.write(buffer, 0, count); + } finally { + writeTimestamp = -1; + } count = 0; } } @@ -117,4 +129,12 @@ super.close(); } + public boolean isWriting() { + return writeTimestamp > 0; + } + + public long getWriteTimestamp() { + return writeTimestamp; + } + } Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?rev=710109&r1=710108&r2=710109&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java Mon Nov 3 09:30:59 2008 @@ -69,6 +69,7 @@ protected Socket socket; protected DataOutputStream dataOut; protected DataInputStream dataIn; + protected TcpBufferedOutputStream buffOut = null; /** * trace=true -> the Transport stack where this TcpTransport * object will be, will have a TransportLogger layer @@ -505,7 +506,7 @@ protected void initializeStreams() throws Exception { TcpBufferedInputStream buffIn = new TcpBufferedInputStream(socket.getInputStream(), ioBufferSize); this.dataIn = new DataInputStream(buffIn); - TcpBufferedOutputStream buffOut = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); + buffOut = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(buffOut); } @@ -533,9 +534,12 @@ public <T> T narrow(Class<T> target) { if (target == Socket.class) { return target.cast(socket); + } else if ( target == TcpBufferedOutputStream.class) { + return target.cast(buffOut); } return super.narrow(target); } + static { SOCKET_CLOSE = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 10, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() { From commitstranthomas@example.com Mon Nov 03 17:59:44 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 51648 invoked from network); 3 Nov 2008 17:59:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 17:59:44 -0000 Received: (qmail 31271 invoked by uid 500); 3 Nov 2008 17:59:50 -0000 Delivered-To: tranthomas@example.com Received: (qmail 31214 invoked by uid 500); 3 Nov 2008 17:59:50 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 31205 invoked by uid 99); 3 Nov 2008 17:59:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 09:59:50 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 17:58:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C8782238889E; Mon, 3 Nov 2008 09:58:53 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710116 - /activemq/tags/activemq-5.2.0/ Date: Mon, 03 Nov 2008 17:58:53 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Mon Nov 3 09:58:53 2008 New Revision: 710116 URL: http://svn.apache.org/viewvc?rev=710116&view=rev Log: prepare for rc3 of 5.2 which will redo the tag Removed: activemq/tags/activemq-5.2.0/ From commitstranthomas@example.com Mon Nov 03 22:37:17 2008 Return-Path: <commitstranthomas@example.com> Delivered-To: tranthomas@example.com Received: (qmail 14031 invoked from network); 3 Nov 2008 22:37:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Nov 2008 22:37:17 -0000 Received: (qmail 43834 invoked by uid 500); 3 Nov 2008 22:37:23 -0000 Delivered-To: tranthomas@example.com Received: (qmail 43813 invoked by uid 500); 3 Nov 2008 22:37:23 -0000 Mailing-List: contact tranthomas@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tranthomas@example.com> List-Unsubscribe: <mailto:tranthomas@example.com> List-Post: <mailto:tranthomas@example.com> List-Id: <commits.activemq.apache.org> Reply-To: tranthomas@example.com Delivered-To: mailing list tranthomas@example.com Received: (qmail 43803 invoked by uid 99); 3 Nov 2008 22:37:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 14:37:23 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 22:36:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7A8D123889BA; Mon, 3 Nov 2008 14:36:56 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710198 - in /activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire: OpenWireConnector.cpp OpenWireConnector.h Date: Mon, 03 Nov 2008 22:36:56 -0000 To: tranthomas@example.com From: tranthomas@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <tranthomas@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Nov 3 14:36:56 2008 New Revision: 710198 URL: http://svn.apache.org/viewvc?rev=710198&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-200 Revamp allocation pattern to make any leaks from exceptions or otherwise less likely to occur. Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?rev=710198&r1=710197&r2=710198&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp Mon Nov 3 14:36:56 2008 @@ -18,6 +18,7 @@ #include <activemq/connector/openwire/OpenWireConnector.h> #include <typeinfo> +#include <memory> #include <decaf/util/concurrent/Concurrent.h> #include <activemq/transport/Transport.h> #include <decaf/lang/exceptions/UnsupportedOperationException.h> @@ -222,15 +223,12 @@ connectionInfo.setConnectionId( connectionId ); // Now we ping the broker and see if we get an ack / nack - Response* response = syncRequest( &connectionInfo ); + syncRequest( &connectionInfo ); synchronized( &mutex ) { // Tag us in the Connected State now. state = CONNECTION_STATE_CONNECTED; } - - // Clean up the ack - delete response; } AMQ_CATCH_RETHROW( ConnectorException ) AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException ) @@ -279,38 +277,23 @@ enforceConnected(); // Create and initialize a new SessionInfo object - commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionInfo* info = new commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionInfo(); - commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionId* sessionId = new commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionId(); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionInfo> info( new commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionInfo() ); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionId> sessionId( new commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SessionId() ); sessionId->setConnectionId( connectionInfo.getConnectionId()->getValue() ); sessionId->setValue( sessionIds.getNextSequenceId() ); - info->setSessionId( sessionId ); + info->setSessionId( sessionId.release() ); // Create and initialize the Connector's Session Info object, this will // cleanup the SessionInfo command when destroyed. - OpenWireSessionInfo* session = new OpenWireSessionInfo( this ); - session->setSessionInfo( info ); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<OpenWireSessionInfo> session( new OpenWireSessionInfo( this ) ); + session->setSessionInfo( info.release() ); session->setAckMode( ackMode ); - try{ - - // Send the subscription message to the broker. - Response* response = syncRequest( info ); - - // The broker did not return an error - this is good. - // Just discard the response. - delete response; - - // Return the session info. - return session; - - } catch( ConnectorException& ex ) { - - // Something bad happened - free the session info object. - delete session; + // Send the subscription message to the broker. + syncRequest( session->getSessionInfo() ); - ex.setMark(__FILE__, __LINE__); - throw ex; - } + // Return the session info. + return session.release(); } AMQ_CATCH_RETHROW( ConnectorException ) AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException ) @@ -325,17 +308,12 @@ bool noLocal ) throw ( ConnectorException ) { - OpenWireConsumerInfo* consumer = NULL; - commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4onsumerInfo* consumerInfo = NULL; - try{ enforceConnected(); - consumer = new OpenWireConsumerInfo( this ); - consumer->setSessionInfo( session ); - consumerInfo = createConsumerInfo( destination, session ); - consumer->setConsumerInfo( consumerInfo ); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4onsumerInfo> consumerInfo( + createConsumerInfo( destination, session ) ); consumerInfo->setSelector( selector ); consumerInfo->setNoLocal( noLocal ); @@ -343,33 +321,22 @@ /** * Override default options with uri-encoded parameters. */ - applyDestinationOptions( consumerInfo ); + applyDestinationOptions( consumerInfo.get() ); + + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr<OpenWireConsumerInfo> consumer( new OpenWireConsumerInfo( this ) ); + consumer->setSessionInfo( session ); + consumer->setConsumerInfo( consumerInfo.release() ); synchronized( &consumerInfoMap ) { // Optimistically place the Consumer into the Map. - consumerInfoMap.setValue( - consumerInfo->getConsumerId()->getValue(), - consumer ); + consumerInfoMap.setValue( consumer->getConsumerId(), consumer.get() ); } - return consumer; - - } catch( ConnectorException& ex ) { - delete consumer; - delete consumerInfo; - ex.setMark( __FILE__, __LINE__ ); - throw ex; - } catch( Exception& ex ) { - delete consumer; - delete consumerInfo; - ex.setMark( __FILE__, __LINE__ ); - throw OpenWireConnectorException( ex ); - } catch( ... ) { - delete consumer; - delete consumerInfo; - throw OpenWireConnectorException( __FILE__, __LINE__, - "caught unknown exception" ); + return consumer.release();; } + AMQ_CATCH_RETHROW( ConnectorException ) + AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException ) + AMQ_CATCHALL_THROW( OpenWireConnectorException ) } //////////////////////////////////////////////////////////////////////////////// @@ -380,18 +347,12 @@ const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& selector, bool noLocal ) throw ( ConnectorException ) { - - OpenWireConsumerInfo* consumer = NULL; - commands888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4onsumerInfo* consumerInfo = NULL; try{ enforceConnected(); - consumer = new OpenWireConsumerInfo( this ); - consumer->setSessionInfo( session ); - consumerInfo = createConsumerInfo( topic, session
{'source': 'Apache Software Foundation Public Mail Archives'}