From commits-larry25@example.org Wed Dec 01 12:30:32 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 75808 invoked from network); 1 Dec 2010 12:30:32 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Dec 2010 12:30:32 -0000 Received: (qmail 36162 invoked by uid 500); 1 Dec 2010 12:30:32 -0000 Delivered-To: larry25@example.org Received: (qmail 36094 invoked by uid 500); 1 Dec 2010 12:30:29 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 36078 invoked by uid 99); 1 Dec 2010 12:30:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Dec 2010 12:30:28 +0000 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; Wed, 01 Dec 2010 12:30:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C9094238899C; Wed, 1 Dec 2010 12:28:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1040978 - in /activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin: apollo apollo.cmd Date: Wed, 01 Dec 2010 12:28:53 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Wed Dec 1 12:28:53 2010 New Revision: 1040978 URL: http://svn.apache.org/viewvc?rev=1040978&view=rev Log: Simplifying the startup scripts a bit. Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo?rev=1040978&r1=1040977&r2=1040978&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo (original) +++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo Wed Dec 1 12:28:53 2010 @@ -16,22 +16,7 @@ # limitations under the License. # ------------------------------------------------------------------------ -# load system-wide apollo configuration -if [ -f "/etc/apollo.conf" ] ; then - . /etc/apollo.conf -fi - -# provide default values for people who don't use RPMs -if [ -z "$usejikes" ] ; then - usejikes=false; -fi - -# load user apollo configuration -if [ -f "$HOME/.apollorc" ] ; then - . "$HOME/.apollorc" -fi - -# OS specific support. $var _must_ be set to either true or false. +# OS specific support. cygwin=false; darwin=false; case "`uname`" in @@ -44,14 +29,6 @@ case "`uname`" in esac if [ -z "$APOLLO_HOME" ] ; then - # try to find APOLLO - if [ -d /opt/apollo ] ; then - APOLLO_HOME=/opt/apollo - fi - - if [ -d "${HOME}/opt/apollo" ] ; then - APOLLO_HOME="${HOME}/opt/apollo" - fi ## resolve links - $0 may be a link to apollo's home PRG="$0" @@ -73,7 +50,6 @@ if [ -z "$APOLLO_HOME" ] ; then done APOLLO_HOME=`dirname "$PRG"` - cd "$saveddir" # make it fully qualified @@ -138,10 +114,13 @@ if $cygwin; then JUL_CONFIG_FILE=`cygpath --windows "$JUL_CONFIG_FILE"` fi -if [ -z "$APOLLO_OPTS" ] ; then - APOLLO_OPTS="-server -Xmx1G" +if [ -z "$JVM_FLAGS" ] ; then + JVM_FLAGS="-server -Xmx1G" +fi + +if [ "x$APOLLO_OPTS" != "x" ] ; then + JVM_FLAGS="${JVM_FLAGS} ${APOLLO_OPTS}" fi -JVM_FLAGS="${APOLLO_OPTS}" # Optionally enable remote debugging if [ "x$APOLLO_DEBUG" != "x" ]; then Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd?rev=1040978&r1=1040977&r2=1040978&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd (original) +++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd Wed Dec 1 12:28:53 2010 @@ -53,9 +53,11 @@ rem :NO_LIB_PATCHES for %%i in ("%APOLLO_HOME%\lib\*.jar") do call :ADD_CLASSPATH %%i -if "%APOLLO_OPTS%" == "" set APOLLO_OPTS=-server -Xmx1G +if "%JVM_FLAGS%" == "" set JVM_FLAGS=-server -Xmx1G -set JVM_FLAGS=%APOLLO_OPTS% +if "x%APOLLO_OPTS%" == "x" goto noAPOLLO_OPTS + set JVM_FLAGS=%JVM_FLAGS% %APOLLO_OPTS% +:noAPOLLO_OPTS if "x%APOLLO_DEBUG%" == "x" goto noDEBUG set JVM_FLAGS=%JVM_FLAGS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspEND=n,address=5005 From commits-larry25@example.org Thu Dec 02 12:43:33 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 30656 invoked from network); 2 Dec 2010 12:43:33 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Dec 2010 12:43:33 -0000 Received: (qmail 26315 invoked by uid 500); 2 Dec 2010 12:43:33 -0000 Delivered-To: larry25@example.org Received: (qmail 26248 invoked by uid 500); 2 Dec 2010 12:43:31 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 26236 invoked by uid 99); 2 Dec 2010 12:43:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 12:43:30 +0000 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; Thu, 02 Dec 2010 12:43:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C38AF23888E8; Thu, 2 Dec 2010 12:41:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1041351 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/command/ActiveMQBlobMessage.java test/java/org/apache/activemq/blob/FTPBlobTest.java Date: Thu, 02 Dec 2010 12:41:58 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: gtully Date: Thu Dec 2 12:41:58 2010 New Revision: 1041351 URL: http://svn.apache.org/viewvc?rev=1041351&view=rev Log: apply patch from https://issues.apache.org/jira/browse/AMQ-3067 with thanks and additional test Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob/FTPBlobTest.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java?rev=1041351&r1=1041350&r2=1041351&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java Thu Dec 2 12:41:58 2010 @@ -60,6 +60,7 @@ public class ActiveMQBlobMessage extends copy.setMimeType(getMimeType()); copy.setDeletedByBroker(isDeletedByBroker()); copy.setBlobUploader(getBlobUploader()); + copy.setName(getName()); } public byte getDataStructureType() { Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob/FTPBlobTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob/FTPBlobTest.java?rev=1041351&r1=1041350&r2=1041351&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob/FTPBlobTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob/FTPBlobTest.java Thu Dec 2 12:41:58 2010 @@ -50,6 +50,7 @@ public class FTPBlobTest extends FTPTest MessageProducer producer = session.createProducer(destination); MessageConsumer consumer = session.createConsumer(destination); BlobMessage message = session.createBlobMessage(file); + message.setName("fileName"); producer.send(message); Thread.sleep(1000); @@ -58,6 +59,7 @@ public class FTPBlobTest extends FTPTest Message msg = consumer.receive(1000); Assert.assertTrue(msg instanceof ActiveMQBlobMessage); + assertEquals("name is correct", "fileName", ((ActiveMQBlobMessage)msg).getName()); InputStream input = ((ActiveMQBlobMessage) msg).getInputStream(); StringBuilder b = new StringBuilder(); int i = input.read(); From commits-larry25@example.org Thu Dec 02 18:42:03 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 33622 invoked from network); 2 Dec 2010 18:42:02 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Dec 2010 18:42:02 -0000 Received: (qmail 82328 invoked by uid 500); 2 Dec 2010 18:42:02 -0000 Delivered-To: larry25@example.org Received: (qmail 82264 invoked by uid 500); 2 Dec 2010 18:42:02 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 82257 invoked by uid 99); 2 Dec 2010 18:42:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 18:42:02 +0000 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; Thu, 02 Dec 2010 18:42:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E38E823889B3; Thu, 2 Dec 2010 18:40:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1041516 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala Date: Thu, 02 Dec 2010 18:40:29 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: chirino Date: Thu Dec 2 18:40:29 2010 New Revision: 1041516 URL: http://svn.apache.org/viewvc?rev=1041516&view=rev Log: Add a helper constructor. Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala?rev=1041516&r1=1041515&r2=1041516&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala (original) +++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Destinations.scala Thu Dec 2 18:40:29 2010 @@ -144,4 +144,6 @@ case class SingleDestination(override va /** * @author <a href="http://hiramchirino.com">Hiram Chirino</a> */ -case class MultiDestination(override val destinations: List[Destination]) extends Destination +case class MultiDestination(override val destinations: List[Destination]) extends Destination { + def this(d: Array[Destination]) = this(d.toList) +} From commits-larry25@example.org Sat Dec 04 20:05:52 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 39559 invoked from network); 4 Dec 2010 20:05:51 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 4 Dec 2010 20:05:51 -0000 Received: (qmail 25688 invoked by uid 500); 4 Dec 2010 20:05:51 -0000 Delivered-To: larry25@example.org Received: (qmail 25657 invoked by uid 500); 4 Dec 2010 20:05:51 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 25650 invoked by uid 99); 4 Dec 2010 20:05:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 20:05:51 +0000 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, 04 Dec 2010 20:05:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9271023888CF; Sat, 4 Dec 2010 20:04:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042231 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent: Mutex.cpp Mutex.h Date: Sat, 04 Dec 2010 20:04:18 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: tabish Date: Sat Dec 4 20:04:18 2010 New Revision: 1042231 URL: http://svn.apache.org/viewvc?rev=1042231&view=rev Log: Allow a Mutex to have a unique name. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.h Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.cpp?rev=1042231&r1=1042230&r2=1042231&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.cpp Sat Dec 4 20:04:18 2010 @@ -19,6 +19,7 @@ #include <decaf/internal/util/concurrent/MutexImpl.h> #include <decaf/internal/util/concurrent/ConditionImpl.h> +#include <decaf/lang/Integer.h> #include <list> @@ -28,6 +29,7 @@ using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent; +using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xceptions; //////////////////////////////////////////////////////////////////////////////// @@ -38,21 +40,40 @@ namespace concurrent{ class MutexProperties { public: - MutexProperties() {} + MutexProperties( const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& name ) : mutex( NULL ), condition( NULL ), name( name ) { + if( this->name.empty() ) { + this->name = st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string( "Mutex-" ) + Integer888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4toString( ++id ); + } + } // The Platform Mutex object and an associated Condition Object // for use in the wait / notify pattern. MutexHandle* mutex; ConditionHandle* condition; + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string name; + + static unsigned int id; }; + unsigned int MutexProperties888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4id = 0; + }}} //////////////////////////////////////////////////////////////////////////////// -Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex() { +Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex() : Synchronizable(), properties( NULL ) { + + this->properties = new MutexProperties(""); + + // Allocate the OS Mutex Implementation. + this->properties->mutex = MutexImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reate(); + this->properties->condition = ConditionImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reate( this->properties->mutex ); +} + +//////////////////////////////////////////////////////////////////////////////// +Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex( const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& name ) : Synchronizable(), properties( NULL ) { - this->properties = new MutexProperties(); + this->properties = new MutexProperties( name ); // Allocate the OS Mutex Implementation. this->properties->mutex = MutexImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reate(); @@ -61,6 +82,7 @@ Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex() { //////////////////////////////////////////////////////////////////////////////// Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4~Mutex() { + unlock(); ConditionImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stroy( this->properties->condition ); @@ -70,32 +92,37 @@ Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4~Mutex() { } //////////////////////////////////////////////////////////////////////////////// -void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lock() { +st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getName() const { + return this->properties->name; +} + +//////////////////////////////////////////////////////////////////////////////// +st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4toString() const { + return this->properties->name; +} +//////////////////////////////////////////////////////////////////////////////// +void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lock() { MutexImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lock( this->properties->mutex ); } //////////////////////////////////////////////////////////////////////////////// bool Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tryLock() { - return MutexImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4trylock( this->properties->mutex ); } //////////////////////////////////////////////////////////////////////////////// void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4unlock() { - MutexImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4unlock( this->properties->mutex ); } //////////////////////////////////////////////////////////////////////////////// void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4wait() { - ConditionImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4wait( this->properties->condition ); } //////////////////////////////////////////////////////////////////////////////// void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4wait( long long millisecs ) { - wait( millisecs, 0 ); } @@ -117,12 +144,10 @@ void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4wait( long long millisecs, i //////////////////////////////////////////////////////////////////////////////// void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4notify() { - ConditionImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4notify( this->properties->condition ); } //////////////////////////////////////////////////////////////////////////////// void Mutex888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4notifyAll() { - ConditionImpl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4notifyAll( this->properties->condition ); } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.h?rev=1042231&r1=1042230&r2=1042231&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/Mutex.h Sat Dec 4 20:04:18 2010 @@ -50,8 +50,16 @@ namespace concurrent{ Mutex(); + Mutex( const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& name ); + virtual ~Mutex(); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string getName() const; + + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string toString() const; + + public: // Synchronizable API Implementation + virtual void lock(); virtual bool tryLock(); From commits-larry25@example.org Sat Dec 04 20:14:57 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 40640 invoked from network); 4 Dec 2010 20:14:56 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 4 Dec 2010 20:14:56 -0000 Received: (qmail 29655 invoked by uid 500); 4 Dec 2010 20:14:56 -0000 Delivered-To: larry25@example.org Received: (qmail 29627 invoked by uid 500); 4 Dec 2010 20:14:56 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 29620 invoked by uid 99); 4 Dec 2010 20:14:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 20:14:56 +0000 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, 04 Dec 2010 20:14:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A18AE23888CF; Sat, 4 Dec 2010 20:13:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042233 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Date: Sat, 04 Dec 2010 20:13:24 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: tabish Date: Sat Dec 4 20:13:24 2010 New Revision: 1042233 URL: http://svn.apache.org/viewvc?rev=1042233&view=rev Log: Have each thread name its owned Mutex. Don't keep pthread attributes struct around since its not needed after the thread is created. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp?rev=1042233&r1=1042232&r2=1042233&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Sat Dec 4 20:13:24 2010 @@ -72,6 +72,7 @@ namespace lang{ class ThreadProperties { public: + d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex mutex; Runnable* task; /** @@ -79,7 +80,6 @@ namespace lang{ */ #ifdef HAVE_PTHREAD_H pthread_t handle; - pthread_attr_t attributes; #else HANDLE handle; #endif @@ -90,7 +90,6 @@ namespace lang{ bool interrupted; bool unparked; bool parked; - d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Mutex mutex; static unsigned int id; @@ -99,7 +98,7 @@ namespace lang{ public: - ThreadProperties() { + ThreadProperties( const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& name ) : mutex( name + "-mutex" ) { this->priority = Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NORM_PRIORITY; this->state = Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NEW; @@ -107,17 +106,10 @@ namespace lang{ this->parked = false; this->unparked = false; this->parent = NULL; - - #ifdef HAVE_PTHREAD_H - pthread_attr_init( &attributes ); - #endif } ~ThreadProperties() { - - #ifdef HAVE_PTHREAD_H - pthread_attr_destroy( &attributes ); - #else + #ifndef HAVE_PTHREAD_H 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4loseHandle( handle ); #endif } @@ -313,14 +305,16 @@ Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Thread( Runnable* task, const st //////////////////////////////////////////////////////////////////////////////// void Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4initialize( Runnable* task, const st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string& name ) { - this->properties = new ThreadProperties(); + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string threadName = name; - if( name == "" ) { - this->properties->name = st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string( "Thread-" ) + Integer888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4toString( ++ThreadProperties888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4id ); + if( threadName.empty() ) { + threadName = st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string( "Thread-" ) + Integer888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4toString( ++ThreadProperties888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4id ); } else { - this->properties->name = name; + threadName = name; } + this->properties = new ThreadProperties( threadName ); + this->properties->state = Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NEW; this->properties->priority = Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NORM_PRIORITY; this->properties->task = task; @@ -361,9 +355,15 @@ void Thr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4start() { synchronized( &this->properties->mutex ) { #ifdef HAVE_PTHREAD_H - int result = pthread_create( &( properties->handle ), - &( properties->attributes ), - threadWorker, properties ); + + pthread_attr_t attributes; + + pthread_attr_init( &attributes ); + pthread_attr_setdetachstate( &attributes, PTHREAD_CREATE_JOINABLE ); + + int result = pthread_create( &( properties->handle ), &attributes, threadWorker, properties ); + + pthread_attr_destroy( &attributes ); if( result != 0 ) { throw RuntimeException( From commits-larry25@example.org Sun Dec 05 00:17:52 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 27306 invoked from network); 5 Dec 2010 00:17:52 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 00:17:52 -0000 Received: (qmail 73014 invoked by uid 500); 5 Dec 2010 00:17:52 -0000 Delivered-To: larry25@example.org Received: (qmail 72983 invoked by uid 500); 5 Dec 2010 00:17:52 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 72976 invoked by uid 99); 5 Dec 2010 00:17:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 00:17:52 +0000 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, 05 Dec 2010 00:17:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 83E3023888D2; Sun, 5 Dec 2010 00:17:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042268 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Date: Sun, 05 Dec 2010 00:17:29 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 00:17:29 2010 New Revision: 1042268 URL: http://svn.apache.org/viewvc?rev=1042268&view=rev Log: Fix the Thread name not getting set. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp?rev=1042268&r1=1042267&r2=1042268&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Thread.cpp Sun Dec 5 00:17:29 2010 @@ -106,6 +106,7 @@ namespace lang{ this->parked = false; this->unparked = false; this->parent = NULL; + this->name = name; } ~ThreadProperties() { From commits-larry25@example.org Sun Dec 05 00:21:26 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 27719 invoked from network); 5 Dec 2010 00:21:26 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 00:21:26 -0000 Received: (qmail 75575 invoked by uid 500); 5 Dec 2010 00:21:26 -0000 Delivered-To: larry25@example.org Received: (qmail 75538 invoked by uid 500); 5 Dec 2010 00:21:26 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 75531 invoked by uid 99); 5 Dec 2010 00:21:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 00:21:26 +0000 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, 05 Dec 2010 00:21:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0157E23888D2; Sun, 5 Dec 2010 00:21:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042269 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util: MemoryUsageTest.cpp PrimitiveListTest.cpp PrimitiveMapTest.cpp PrimitiveValueNodeTest.cpp Date: Sun, 05 Dec 2010 00:21:04 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: tabish Date: Sun Dec 5 00:21:04 2010 New Revision: 1042269 URL: http://svn.apache.org/viewvc?rev=1042269&view=rev Log: Fix some code formatting issues. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/MemoryUsageTest.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/MemoryUsageTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/MemoryUsageTest.cpp?rev=1042269&r1=1042268&r2=1042269&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/MemoryUsageTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/MemoryUsageTest.cpp Sun Dec 5 00:21:04 2010 @@ -26,6 +26,7 @@ using namespace activemq; using namespace activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang; +//////////////////////////////////////////////////////////////////////////////// class UsageRunner : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { private: @@ -43,6 +44,7 @@ public: } }; +//////////////////////////////////////////////////////////////////////////////// void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCTors() { MemoryUsage usage1; @@ -55,6 +57,7 @@ void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCTors() { CPPUNIT_ASSERT( usage2.getUsage() == 0 ); } +//////////////////////////////////////////////////////////////////////////////// void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testUsage() { MemoryUsage usage1( 2048 ); @@ -82,6 +85,7 @@ void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testUsage() { CPPUNIT_ASSERT( usage1.getUsage() == 3072 ); } +//////////////////////////////////////////////////////////////////////////////// void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testTimedWait() { MemoryUsage usage( 2048 ); @@ -96,6 +100,7 @@ void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testTimedWait() { CPPUNIT_ASSERT( endTime - startTime >= 125 ); } +//////////////////////////////////////////////////////////////////////////////// void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testWait() { MemoryUsage usage( 2048 ); @@ -109,5 +114,4 @@ void MemoryUsageTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testWait() { CPPUNIT_ASSERT( usage.getUsage() == 0 ); myThread.join(); - } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp?rev=1042269&r1=1042268&r2=1042269&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp Sun Dec 5 00:21:04 2010 @@ -23,6 +23,7 @@ using namespace activemq; using namespace activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testSetGet(){ PrimitiveList plist; @@ -120,6 +121,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testSetGet(){ CPPUNIT_ASSERT( plist.getByteArray(0) == byteArray ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testAdd(){ bool boolValue = true; @@ -171,6 +173,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testAdd(){ CPPUNIT_ASSERT( plist.get(9).getType() == PrimitiveValueNo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4BYTE_ARRAY_TYPE ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testRemove(){ PrimitiveList plist; @@ -190,6 +193,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testRemove(){ CPPUNIT_ASSERT( plist.isEmpty() ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCount(){ PrimitiveList plist; @@ -206,6 +210,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCount(){ CPPUNIT_ASSERT( plist.toString() != "" ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCopy(){ PrimitiveList plist; @@ -221,6 +226,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCopy(){ CPPUNIT_ASSERT( plist.equals( copy1 ) ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testClear(){ PrimitiveList plist; @@ -247,6 +253,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testClear(){ d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xceptions888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IndexOutOfBoundsException ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testContains(){ PrimitiveList plist; @@ -266,6 +273,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testContains(){ CPPUNIT_ASSERT( plist.contains( 5 ) == false ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testListOfLists() { PrimitiveList list; @@ -287,6 +295,7 @@ void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testListOfLists( } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveListTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testListOfMaps() { PrimitiveList list; Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp?rev=1042269&r1=1042268&r2=1042269&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp Sun Dec 5 00:21:04 2010 @@ -22,6 +22,7 @@ using namespace activemq; using namespace activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testValueNode(){ PrimitiveValueNode node; @@ -85,6 +86,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testValueNode(){ CPPUNIT_ASSERT( node.getType() == PrimitiveValueNo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NULL_TYPE ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testSetGet(){ PrimitiveMap pmap; @@ -176,6 +178,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testSetGet(){ } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testRemove(){ PrimitiveMap pmap; @@ -189,6 +192,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testRemove(){ } catch( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xceptions888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NoSuchElementException& e ){} } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCount(){ PrimitiveMap pmap; @@ -205,6 +209,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCount(){ CPPUNIT_ASSERT( pmap.toString() != "" ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCopy(){ PrimitiveMap pmap; @@ -220,6 +225,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testCopy(){ CPPUNIT_ASSERT( pmap.equals( copy1 ) ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testClear(){ PrimitiveMap pmap; @@ -246,6 +252,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testClear(){ } catch( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xceptions888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NoSuchElementException& e ){} } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testContains(){ PrimitiveMap pmap; @@ -265,6 +272,7 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testContains(){ CPPUNIT_ASSERT( pmap.containsKey("int") == false ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testGetKeys(){ PrimitiveMap pmap; @@ -279,4 +287,3 @@ void PrimitiveMapTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testGetKeys(){ CPPUNIT_ASSERT( keys[1] == "int" || keys[1] == "float" || keys[1] == "int2" ); CPPUNIT_ASSERT( keys[2] == "int" || keys[2] == "float" || keys[2] == "int2" ); } - Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp?rev=1042269&r1=1042268&r2=1042269&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp Sun Dec 5 00:21:04 2010 @@ -22,6 +22,7 @@ using namespace activemq; using namespace activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util; +//////////////////////////////////////////////////////////////////////////////// void PrimitiveValueNodeTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testValueNode(){ PrimitiveValueNode node; @@ -85,6 +86,7 @@ void PrimitiveValueNodeTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testValueNo CPPUNIT_ASSERT( node.getType() == PrimitiveValueNo888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4NULL_TYPE ); } +//////////////////////////////////////////////////////////////////////////////// void PrimitiveValueNodeTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testValueNodeCtors(){ PrimitiveValueNode tfvalue = true; From commits-larry25@example.org Sun Dec 05 01:02:33 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 39187 invoked from network); 5 Dec 2010 01:02:33 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 01:02:33 -0000 Received: (qmail 83149 invoked by uid 500); 5 Dec 2010 01:02:33 -0000 Delivered-To: larry25@example.org Received: (qmail 83085 invoked by uid 500); 5 Dec 2010 01:02:33 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 83078 invoked by uid 99); 5 Dec 2010 01:02:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 01:02:33 +0000 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, 05 Dec 2010 01:02:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 899AA238890B; Sun, 5 Dec 2010 01:02:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042271 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Date: Sun, 05 Dec 2010 01:02:12 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> Author: tabish Date: Sun Dec 5 01:02:12 2010 New Revision: 1042271 URL: http://svn.apache.org/viewvc?rev=1042271&view=rev Log: Perform the dispatch outside the lock to avoid a deadlock on failover. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp?rev=1042271&r1=1042270&r2=1042271&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Sun Dec 5 01:02:12 2010 @@ -130,12 +130,12 @@ void ActiveMQSessionExecutor888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ispatch( if( this->session->consumers.containsKey( dispatch->getConsumerId() ) ) { consumer = this->session->consumers.get( dispatch->getConsumerId() ); } + } - // If the consumer is not available, just ignore the message. - // Otherwise, dispatch the message to the consumer. - if( consumer != NULL ) { - consumer->dispatch( dispatch ); - } + // If the consumer is not available, just ignore the message. + // Otherwise, dispatch the message to the consumer. + if( consumer != NULL ) { + consumer->dispatch( dispatch ); } } catch( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception& ex ) { From commits-larry25@example.org Sun Dec 05 01:04:28 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 39772 invoked from network); 5 Dec 2010 01:04:28 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 01:04:28 -0000 Received: (qmail 84121 invoked by uid 500); 5 Dec 2010 01:04:28 -0000 Delivered-To: larry25@example.org Received: (qmail 84086 invoked by uid 500); 5 Dec 2010 01:04:28 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 84079 invoked by uid 99); 5 Dec 2010 01:04:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 01:04:28 +0000 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, 05 Dec 2010 01:04:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5B637238890B; Sun, 5 Dec 2010 01:04:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042272 - /activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Date: Sun, 05 Dec 2010 01:04:05 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 01:04:05 2010 New Revision: 1042272 URL: http://svn.apache.org/viewvc?rev=1042272&view=rev Log: Perform the dispatch outside the lock to avoid a deadlock on failover. Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp?rev=1042272&r1=1042271&r2=1042272&view=diff ============================================================================== --- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp (original) +++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/core/ActiveMQSessionExecutor.cpp Sun Dec 5 01:04:05 2010 @@ -121,12 +121,12 @@ void ActiveMQSessionExecutor888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ispatch( if( this->session->consumers.containsKey( dispatch->getConsumerId() ) ) { consumer = this->session->consumers.get( dispatch->getConsumerId() ); } + } - // If the consumer is not available, just ignore the message. - // Otherwise, dispatch the message to the consumer. - if( consumer != NULL ) { - consumer->dispatch( dispatch ); - } + // If the consumer is not available, just ignore the message. + // Otherwise, dispatch the message to the consumer. + if( consumer != NULL ) { + consumer->dispatch( dispatch ); } } catch( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception& ex ) { From commits-larry25@example.org Sun Dec 05 17:02:46 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 2185 invoked from network); 5 Dec 2010 17:02:46 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 17:02:46 -0000 Received: (qmail 43088 invoked by uid 500); 5 Dec 2010 17:02:46 -0000 Delivered-To: larry25@example.org Received: (qmail 43023 invoked by uid 500); 5 Dec 2010 17:02:45 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 43015 invoked by uid 99); 5 Dec 2010 17:02:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 17:02:45 +0000 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, 05 Dec 2010 17:02:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7236823888BD; Sun, 5 Dec 2010 17:02:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042386 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf: internal/net/ internal/net/ssl/ net/ net/ssl/ Date: Sun, 05 Dec 2010 17:02:20 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 17:02:19 2010 New Revision: 1042386 URL: http://svn.apache.org/viewvc?rev=1042386&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQCPP-330 Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.h activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/DefaultSSLContext.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocketFactory.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketFactory.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLServerSocketFactory.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLSocketFactory.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.cpp Sun Dec 5 17:02:19 2010 @@ -17,8 +17,10 @@ #include "Network.h" +#include <decaf/lang/Runnable.h> #include <decaf/lang/Exception.h> #include <decaf/lang/exceptions/IllegalStateException.h> +#include <decaf/util/StlList.h> #include <decaf/util/concurrent/Mutex.h> #include <decaf/internal/util/ResourceLifecycleManager.h> @@ -46,7 +48,20 @@ namespace net{ ResourceLifecycleManager resources; Mutex lock; + StlList<Runnable*> shutdownTasks; + ~NetworkData() { + try{ + st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4auto_ptr< Iterator<Runnable*> > iter( shutdownTasks.iterator() ); + while( iter->hasNext() ) { + Runnable* task = iter->next(); + try{ + task->run(); + delete task; + } catch(...) {} + } + } catch(...) {} + } }; }}} @@ -105,3 +120,10 @@ void Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4shutdownNetworking() { // Destory the Network Runtime. delete Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4networkRuntime; } + +//////////////////////////////////////////////////////////////////////////////// +void Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ShutdownTask( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable* task ) { + if( task != NULL ) { + this->data->shutdownTasks.add( task ); + } +} Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.h?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/Network.h Sun Dec 5 17:02:19 2010 @@ -82,6 +82,24 @@ namespace net { this->addNetworkResource( resource ); } + /** + * Register a Runnable to be called when the Network Runtime is shutdown to provide + * a chance to cleanup any data or references that could cause problems should the + * Network Runtime be re-initialized. The Runnable pointer ownership is transfered + * to the NetworkRuntime to guarantee the timing of resource cleanup. + * + * The cleanup tasks are run at a critical time in the Shutdown process and should + * be as simple as possible and make every attempt to no throw any exceptions. If an + * exception is thrown it is ignored and processing of the next task is started. + * + * The tasks should not assume that any Network resources are still available and + * should execute as quickly as possible. + * + * @param task + * Pointer to a Runnable object that will now be owned by the Network Runtime. + */ + void addShutdownTask( d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable* task ); + public: // Static methods /** Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/DefaultSSLContext.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/DefaultSSLContext.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/DefaultSSLContext.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/DefaultSSLContext.cpp Sun Dec 5 17:02:19 2010 @@ -18,6 +18,7 @@ #include "DefaultSSLContext.h" #include <decaf/io/IOException.h> +#include <decaf/lang/Runnable.h> #include <decaf/security/SecureRandom.h> #include <decaf/internal/net/Network.h> @@ -36,6 +37,25 @@ using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ss using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ssl888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4openssl; //////////////////////////////////////////////////////////////////////////////// +namespace { + + class ShutdownTask : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { + private: + + SSLContext** defaultRef; + + public: + + ShutdownTask( SSLContext** defaultRef ) : defaultRef( defaultRef ) {} + virtual ~ShutdownTask() {} + + virtual void run() { + *defaultRef = NULL; + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// SSLContext* DefaultSSLContext888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ultSSLContext = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -65,6 +85,7 @@ SSLContext* DefaultSSLContext888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getContex // Store the default in the Network Runtime, it will be destroyed when the // Application calls the Decaf shutdownLibrary method. Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNetworkRuntime()->addAsResource( defaultSSLContext ); + Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNetworkRuntime()->addShutdownTask( new ShutdownTask( &defaultSSLContext ) ); } #endif Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocketFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocketFactory.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocketFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocketFactory.cpp Sun Dec 5 17:02:19 2010 @@ -17,6 +17,7 @@ #include "ServerSocketFactory.h" +#include <decaf/lang/Runnable.h> #include <decaf/net/ServerSocket.h> #include <decaf/internal/net/DefaultServerSocketFactory.h> #include <decaf/io/IOException.h> @@ -30,6 +31,25 @@ using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net; //////////////////////////////////////////////////////////////////////////////// +namespace { + + class ShutdownTask : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { + private: + + ServerSocketFactory** defaultRef; + + public: + + ShutdownTask( ServerSocketFactory** defaultRef ) : defaultRef( defaultRef ) {} + virtual ~ShutdownTask() {} + + virtual void run() { + *defaultRef = NULL; + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// ServerSocketFactory* ServerSocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ultFactory = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -57,6 +77,7 @@ ServerSocketFactory* ServerSocketFactory if( defaultFactory == NULL ) { defaultFactory = new DefaultServerSocketFactory(); networkRuntime->addAsResource( defaultFactory ); + networkRuntime->addShutdownTask( new ShutdownTask( &defaultFactory ) ); } } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketFactory.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketFactory.cpp Sun Dec 5 17:02:19 2010 @@ -16,6 +16,7 @@ */ #include <decaf/net/SocketFactory.h> +#include <decaf/lang/Runnable.h> #include <decaf/internal/net/DefaultSocketFactory.h> #include <decaf/internal/net/Network.h> @@ -27,6 +28,25 @@ using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4oncurrent; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net; //////////////////////////////////////////////////////////////////////////////// +namespace { + + class ShutdownTask : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { + private: + + SocketFactory** defaultRef; + + public: + + ShutdownTask( SocketFactory** defaultRef ) : defaultRef( defaultRef ) {} + virtual ~ShutdownTask() {} + + virtual void run() { + *defaultRef = NULL; + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// SocketFactory* SocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ultFactory = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -54,6 +74,7 @@ SocketFactory* SocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getDefault if( defaultFactory == NULL ) { defaultFactory = new DefaultSocketFactory(); networkRuntime->addAsResource( defaultFactory ); + networkRuntime->addShutdownTask( new ShutdownTask( &defaultFactory ) ); } } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLServerSocketFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLServerSocketFactory.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLServerSocketFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLServerSocketFactory.cpp Sun Dec 5 17:02:19 2010 @@ -18,9 +18,8 @@ #include "SSLServerSocketFactory.h" #include <decaf/io/IOException.h> - +#include <decaf/lang/Runnable.h> #include <decaf/internal/net/Network.h> - #include <decaf/internal/net/ssl/DefaultSSLContext.h> #include <decaf/internal/net/ssl/DefaultSSLServerSocketFactory.h> @@ -32,6 +31,25 @@ using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ssl; //////////////////////////////////////////////////////////////////////////////// +namespace { + + class ShutdownTask : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { + private: + + ServerSocketFactory** defaultRef; + + public: + + ShutdownTask( ServerSocketFactory** defaultRef ) : defaultRef( defaultRef ) {} + virtual ~ShutdownTask() {} + + virtual void run() { + *defaultRef = NULL; + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// ServerSocketFactory* SSLServerSocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ultFactory = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -69,6 +87,8 @@ ServerSocketFactory* SSLServerSocketFact // Runtime is shutdown. netRuntime->addAsResource( defaultFactory ); } + + netRuntime->addShutdownTask( new ShutdownTask( &defaultFactory ) ); } return defaultFactory; Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLSocketFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLSocketFactory.cpp?rev=1042386&r1=1042385&r2=1042386&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLSocketFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLSocketFactory.cpp Sun Dec 5 17:02:19 2010 @@ -17,18 +17,38 @@ #include "SSLSocketFactory.h" +#include <decaf/lang/Runnable.h> #include <decaf/internal/net/Network.h> - #include <decaf/internal/net/ssl/DefaultSSLContext.h> #include <decaf/internal/net/ssl/DefaultSSLSocketFactory.h> using namespace decaf; +using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ssl; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net; using namespace d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4internal888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4net888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ssl; //////////////////////////////////////////////////////////////////////////////// +namespace { + + class ShutdownTask : public d888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lang888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Runnable { + private: + + SocketFactory** defaultRef; + + public: + + ShutdownTask( SocketFactory** defaultRef ) : defaultRef( defaultRef ) {} + virtual ~ShutdownTask() {} + + virtual void run() { + *defaultRef = NULL; + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// SocketFactory* SSLSocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ultSocketFactory = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -64,8 +84,10 @@ SocketFactory* SSLSocketFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getDefa // Since we created this one we need to make sure it is destroyed when the Network // Runtime is shutdown. - Network888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNetworkRuntime()->addAsResource( defaultSocketFactory ); + netRuntime->addAsResource( defaultSocketFactory ); } + + netRuntime->addShutdownTask( new ShutdownTask( &defaultSocketFactory ) ); } return defaultSocketFactory; From commits-larry25@example.org Sun Dec 05 17:09:55 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 11141 invoked from network); 5 Dec 2010 17:09:55 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 17:09:55 -0000 Received: (qmail 45258 invoked by uid 500); 5 Dec 2010 17:09:55 -0000 Delivered-To: larry25@example.org Received: (qmail 45233 invoked by uid 500); 5 Dec 2010 17:09:55 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 45226 invoked by uid 99); 5 Dec 2010 17:09:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 17:09:55 +0000 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, 05 Dec 2010 17:09:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 731BB23888BD; Sun, 5 Dec 2010 17:09:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042388 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test: SimpleTest.cpp SimpleTest.h openwire/OpenwireSimpleTest.h Date: Sun, 05 Dec 2010 17:09:31 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 17:09:31 2010 New Revision: 1042388 URL: http://svn.apache.org/viewvc?rev=1042388&view=rev Log: test case for: https://issues.apache.org/jira/browse/AMQCPP-330 Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.h activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireSimpleTest.h Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.cpp?rev=1042388&r1=1042387&r2=1042388&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.cpp Sun Dec 5 17:09:31 2010 @@ -17,6 +17,7 @@ #include "SimpleTest.h" +#include <activemq/library/ActiveMQCPP.h> #include <activemq/util/CMSListener.h> #include <activemq/exceptions/ActiveMQException.h> @@ -438,3 +439,21 @@ void SimpleTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testBytesMessageSendRec AMQ_CATCH_RETHROW( ActiveMQException ) AMQ_CATCHALL_THROW( ActiveMQException ) } + +//////////////////////////////////////////////////////////////////////////////// +void SimpleTest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4testLibraryInitShutdownInit() { + + { + cmsProvider.release(); + + // Shutdown the ActiveMQ library + CPPUNIT_ASSERT_NO_THROW( activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4library888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tiveMQCPP888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4shutdownLibrary() ); + } + + { + // Initialize the ActiveMQ library + CPPUNIT_ASSERT_NO_THROW( activemq888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4library888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tiveMQCPP888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4initializeLibrary() ); + + cmsProvider.reset( new util888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4MSProvider( getBrokerURL() ) ); + } +} Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.h?rev=1042388&r1=1042387&r2=1042388&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SimpleTest.h Sun Dec 5 17:09:31 2010 @@ -42,6 +42,7 @@ namespace test{ virtual void testReceiveAlreadyInQueue(); virtual void testQuickCreateAndDestroy(); virtual void testBytesMessageSendRecv(); + virtual void testLibraryInitShutdownInit(); }; Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireSimpleTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireSimpleTest.h?rev=1042388&r1=1042387&r2=1042388&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireSimpleTest.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireSimpleTest.h Sun Dec 5 17:09:31 2010 @@ -44,6 +44,7 @@ namespace openwire{ CPPUNIT_TEST( testMapMessageSendToTopic ); CPPUNIT_TEST( testDestroyDestination ); CPPUNIT_TEST( tesstStreamMessage ); + CPPUNIT_TEST( testLibraryInitShutdownInit ); CPPUNIT_TEST_SUITE_END(); public: From commits-larry25@example.org Sun Dec 05 18:09:36 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 30145 invoked from network); 5 Dec 2010 18:09:35 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 18:09:35 -0000 Received: (qmail 73745 invoked by uid 500); 5 Dec 2010 18:09:35 -0000 Delivered-To: larry25@example.org Received: (qmail 73723 invoked by uid 500); 5 Dec 2010 18:09:35 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 73716 invoked by uid 99); 5 Dec 2010 18:09:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 18:09:35 +0000 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, 05 Dec 2010 18:09:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F15C923888EA; Sun, 5 Dec 2010 18:09:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042394 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/command/ActiveMQBytesMessage.java test/java/org/apache/activemq/command/MessageCompressionTest.java Date: Sun, 05 Dec 2010 18:09:09 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 18:09:09 2010 New Revision: 1042394 URL: http://svn.apache.org/viewvc?rev=1042394&view=rev Log: test case and fix for: https://issues.apache.org/jira/browse/AMQ-3062 Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java?rev=1042394&r1=1042393&r2=1042394&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java Sun Dec 5 18:09:09 2010 @@ -81,7 +81,7 @@ import org.apache.activemq.util.JMSExcep * <P> * If a client attempts to write a message in read-only mode, a * <CODE>MessageNotWriteableException</CODE> is thrown. - * + * * @openwire:marshaller code=24 * @see javax.jms.Session#createBytesMessage() * @see javax.jms.MapMessage @@ -153,7 +153,7 @@ public class ActiveMQBytesMessage extend * If this message body was read-only, calling this method leaves the * message body in the same state as an empty body in a newly created * message. - * + * * @throws JMSException if the JMS provider fails to clear the message body * due to some internal error. */ @@ -169,7 +169,7 @@ public class ActiveMQBytesMessage extend * read-only mode. The value returned can be used to allocate a byte array. * The value returned is the entire length of the message body, regardless * of where the pointer for reading the message is currently located. - * + * * @return number of bytes in the message * @throws JMSException if the JMS provider fails to read the message due to * some internal error. @@ -184,7 +184,7 @@ public class ActiveMQBytesMessage extend /** * Reads a <code>boolean</code> from the bytes message stream. - * + * * @return the <code>boolean</code> value read * @throws JMSException if the JMS provider fails to read the message due to * some internal error. @@ -205,7 +205,7 @@ public class ActiveMQBytesMessage extend /** * Reads a signed 8-bit value from the bytes message stream. - * + * * @return the next byte from the bytes message stream as a signed 8-bit * <code>byte</code> * @throws JMSException if the JMS provider fails to read the message due to @@ -227,7 +227,7 @@ public class ActiveMQBytesMessage extend /** * Reads an unsigned 8-bit number from the bytes message stream. - * + * * @return the next byte from the bytes message stream, interpreted as an * unsigned 8-bit number * @throws JMSException if the JMS provider fails to read the message due to @@ -249,7 +249,7 @@ public class ActiveMQBytesMessage extend /** * Reads a signed 16-bit number from the bytes message stream. - * + * * @return the next two bytes from the bytes message stream, interpreted as * a signed 16-bit number * @throws JMSException if the JMS provider fails to read the message due to @@ -271,7 +271,7 @@ public class ActiveMQBytesMessage extend /** * Reads an unsigned 16-bit number from the bytes message stream. - * + * * @return the next two bytes from the bytes message stream, interpreted as * an unsigned 16-bit integer * @throws JMSException if the JMS provider fails to read the message due to @@ -293,7 +293,7 @@ public class ActiveMQBytesMessage extend /** * Reads a Unicode character value from the bytes message stream. - * + * * @return the next two bytes from the bytes message stream as a Unicode * character * @throws JMSException if the JMS provider fails to read the message due to @@ -315,7 +315,7 @@ public class ActiveMQBytesMessage extend /** * Reads a signed 32-bit integer from the bytes message stream. - * + * * @return the next four bytes from the bytes message stream, interpreted as * an <code>int</code> * @throws JMSException if the JMS provider fails to read the message due to @@ -337,7 +337,7 @@ public class ActiveMQBytesMessage extend /** * Reads a signed 64-bit integer from the bytes message stream. - * + * * @return the next eight bytes from the bytes message stream, interpreted * as a <code>long</code> * @throws JMSException if the JMS provider fails to read the message due to @@ -359,7 +359,7 @@ public class ActiveMQBytesMessage extend /** * Reads a <code>float</code> from the bytes message stream. - * + * * @return the next four bytes from the bytes message stream, interpreted as * a <code>float</code> * @throws JMSException if the JMS provider fails to read the message due to @@ -381,7 +381,7 @@ public class ActiveMQBytesMessage extend /** * Reads a <code>double</code> from the bytes message stream. - * + * * @return the next eight bytes from the bytes message stream, interpreted * as a <code>double</code> * @throws JMSException if the JMS provider fails to read the message due to @@ -409,7 +409,7 @@ public class ActiveMQBytesMessage extend * Transformation Format (FSS_UTF)", X/Open Preliminary Specification, * X/Open Company Ltd., Document Number: P316. This information also appears * in ISO/IEC 10646, Annex P. - * + * * @return a Unicode string from the bytes message stream * @throws JMSException if the JMS provider fails to read the message due to * some internal error. @@ -440,7 +440,7 @@ public class ActiveMQBytesMessage extend * return value of the total number of bytes read will be less than the * length of the array, indicating that there are no more bytes left to be * read from the stream. The next read of the stream returns -1. - * + * * @param value the buffer into which the data is read * @return the total number of bytes read into the buffer, or -1 if there is * no more data because the end of the stream has been reached @@ -468,7 +468,7 @@ public class ActiveMQBytesMessage extend * than the length of the array <code>value</code>, then an * <code>IndexOutOfBoundsException</code> is thrown. No bytes will be read * from the stream for this exception case. - * + * * @param value the buffer into which the data is read * @param length the number of bytes to read; must be less than or equal to * <code>value.length</code> @@ -505,7 +505,7 @@ public class ActiveMQBytesMessage extend * value. The value <code>true</code> is written as the value * <code>(byte)1</code>; the value <code>false</code> is written as the * value <code>(byte)0</code>. - * + * * @param value the <code>boolean</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -523,7 +523,7 @@ public class ActiveMQBytesMessage extend /** * Writes a <code>byte</code> to the bytes message stream as a 1-byte * value. - * + * * @param value the <code>byte</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -541,7 +541,7 @@ public class ActiveMQBytesMessage extend /** * Writes a <code>short</code> to the bytes message stream as two bytes, * high byte first. - * + * * @param value the <code>short</code> to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -559,7 +559,7 @@ public class ActiveMQBytesMessage extend /** * Writes a <code>char</code> to the bytes message stream as a 2-byte * value, high byte first. - * + * * @param value the <code>char</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -577,7 +577,7 @@ public class ActiveMQBytesMessage extend /** * Writes an <code>int</code> to the bytes message stream as four bytes, * high byte first. - * + * * @param value the <code>int</code> to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -595,7 +595,7 @@ public class ActiveMQBytesMessage extend /** * Writes a <code>long</code> to the bytes message stream as eight bytes, * high byte first. - * + * * @param value the <code>long</code> to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -615,7 +615,7 @@ public class ActiveMQBytesMessage extend * the <code>floatToIntBits</code> method in class <code>Float</code>, * and then writes that <code>int</code> value to the bytes message stream * as a 4-byte quantity, high byte first. - * + * * @param value the <code>float</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -635,7 +635,7 @@ public class ActiveMQBytesMessage extend * using the <code>doubleToLongBits</code> method in class * <code>Double</code>, and then writes that <code>long</code> value to * the bytes message stream as an 8-byte quantity, high byte first. - * + * * @param value the <code>double</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -658,7 +658,7 @@ public class ActiveMQBytesMessage extend * Transformation Format (FSS_UTF)", X/Open Preliminary Specification, * X/Open Company Ltd., Document Number: P316. This information also appears * in ISO/IEC 10646, Annex P. - * + * * @param value the <code>String</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -675,7 +675,7 @@ public class ActiveMQBytesMessage extend /** * Writes a byte array to the bytes message stream. - * + * * @param value the byte array to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. @@ -692,7 +692,7 @@ public class ActiveMQBytesMessage extend /** * Writes a portion of a byte array to the bytes message stream. - * + * * @param value the byte array value to be written * @param offset the initial offset within the byte array * @param length the number of bytes to use @@ -715,7 +715,7 @@ public class ActiveMQBytesMessage extend * This method works only for the objectified primitive object types (<code>Integer</code>,<code>Double</code>, * <code>Long</code> &nbsp;...), <code>String</code> objects, and byte * arrays. - * + * * @param value the object in the Java programming language ("Java object") * to be written; it must not be null * @throws JMSException if the JMS provider fails to write the message due @@ -758,7 +758,7 @@ public class ActiveMQBytesMessage extend /** * Puts the message body in read-only mode and repositions the stream of * bytes to the beginning. - * + * * @throws JMSException if an internal error occurs */ public void reset() throws JMSException { @@ -804,8 +804,8 @@ public class ActiveMQBytesMessage extend @Override public void close() throws IOException { - deflater.end(); super.close(); + deflater.end(); } }; } Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java?rev=1042394&r1=1042393&r2=1042394&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java Sun Dec 5 18:09:09 2010 @@ -16,8 +16,10 @@ */ package org.apache.activemq.command; +import java.io.UnsupportedEncodingException; import java.net.URI; +import javax.jms.BytesMessage; import javax.jms.JMSException; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; @@ -31,7 +33,7 @@ import org.apache.activemq.broker.Broker import org.apache.activemq.broker.TransportConnector; public class MessageCompressionTest extends TestCase { - + private static final String BROKER_URL = "tcp://localhost:61216"; // The following text should compress well private static final String TEXT = "The quick red fox jumped over the lazy brown dog. " + "The quick red fox jumped over the lazy brown dog. " @@ -84,6 +86,28 @@ public class MessageCompressionTest exte assertTrue("expected: compressed Size '" + compressedSize + "' < unCompressedSize '" + unCompressedSize + "'", compressedSize < unCompressedSize); } + public void testBytesMessageCompression() throws Exception { + + ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(BROKER_URL); + factory.setUseCompression(true); + sendTestBytesMessage(factory, TEXT); + ActiveMQBytesMessage message = receiveTestBytesMessage(factory); + int compressedSize = message.getContent().getLength(); + byte[] bytes = new byte[TEXT.getBytes("UTF8").length]; + message.readBytes(bytes); + assertTrue(message.readBytes( new byte[255]) == -1); + String rcvString = new String(bytes, "UTF8"); + assertEquals(TEXT, rcvString); + + factory = new ActiveMQConnectionFactory(BROKER_URL); + factory.setUseCompression(false); + sendTestBytesMessage(factory, TEXT); + message = receiveTestBytesMessage(factory); + int unCompressedSize = message.getContent().getLength(); + + assertTrue("expected: compressed Size '" + compressedSize + "' < unCompressedSize '" + unCompressedSize + "'", compressedSize < unCompressedSize); + } + private void sendTestMessage(ActiveMQConnectionFactory factory, String message) throws JMSException { ActiveMQConnection connection = (ActiveMQConnection)factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -102,6 +126,26 @@ public class MessageCompressionTest exte return rc; } + private void sendTestBytesMessage(ActiveMQConnectionFactory factory, String message) throws JMSException, UnsupportedEncodingException { + ActiveMQConnection connection = (ActiveMQConnection)factory.createConnection(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + MessageProducer producer = session.createProducer(queue); + BytesMessage bytesMessage = session.createBytesMessage(); + bytesMessage.writeBytes(message.getBytes("UTF8")); + producer.send(bytesMessage); + connection.close(); + } + + private ActiveMQBytesMessage receiveTestBytesMessage(ActiveMQConnectionFactory factory) throws JMSException, UnsupportedEncodingException { + ActiveMQConnection connection = (ActiveMQConnection)factory.createConnection(); + connection.start(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + MessageConsumer consumer = session.createConsumer(queue); + ActiveMQBytesMessage rc = (ActiveMQBytesMessage)consumer.receive(); + connection.close(); + return rc; + } + // public void testJavaUtilZip() throws Exception { // String str = "When the going gets weird, the weird turn pro."; // byte[] bytes = str.getBytes(); From commits-larry25@example.org Sun Dec 05 23:02:42 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 56033 invoked from network); 5 Dec 2010 23:02:42 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 23:02:42 -0000 Received: (qmail 75039 invoked by uid 500); 5 Dec 2010 23:02:42 -0000 Delivered-To: larry25@example.org Received: (qmail 75011 invoked by uid 500); 5 Dec 2010 23:02:42 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 75004 invoked by uid 99); 5 Dec 2010 23:02:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 23:02:42 +0000 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, 05 Dec 2010 23:02:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E448E23889B2; Sun, 5 Dec 2010 23:02:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042484 - /activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt Date: Sun, 05 Dec 2010 23:02:18 -0000 To: larry25@example.org From: larry25@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <larry25@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sun Dec 5 23:02:18 2010 New Revision: 1042484 URL: http://svn.apache.org/viewvc?rev=1042484&view=rev Log: Update release notes for 3.2.4 release Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt?rev=1042484&r1=1042483&r2=1042484&view=diff ============================================================================== --- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt (original) +++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/RELEASE_NOTES.txt Sun Dec 5 23:02:18 2010 @@ -1,4 +1,24 @@ ========================================================================= +== Release Notes for ActiveMQ CPP 3.2.4 == +========================================================================= + +This release is a bugfix release that addresses a couple issues found since +the release of v3.2.3 + +bug: + + * [AMQCPP-316] - Unable to receive any messages after re-starting message broker + * [AMQCPP-317] - activemq-cpp 3.2.2 will not work with activemq 5.4.0 broker + using Stomp + * [AMQCPP-322] - Found memory leaks in ActiveMQCPP + * [AMQCPP-323] - The OnException method of registered Exception listener is not + called when broker is stopped. + * [AMQCPP-324] - Destination options are ignored + * [AMQCPP-331] - Small typo in TcpTransportFactory.cpp + * [AMQCPP-332] - First send after we restart broker seems to always get a CmsException + * [AMQCPP-335] - redeliveryPolicy: rollback always loops + +========================================================================= == Release Notes for ActiveMQ CPP 3.2.3 == ========================================================================= From commits-larry25@example.org Sun Dec 05 23:03:08 2010 Return-Path: <commits-larry25@example.org> Delivered-To: larry25@example.org Received: (qmail 56148 invoked from network); 5 Dec 2010 23:03:08 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Dec 2010 23:03:08 -0000 Received: (qmail 75163 invoked by uid 500); 5 Dec 2010 23:03:08 -0000 Delivered-To: larry25@example.org Received: (qmail 75135 invoked by uid 500); 5 Dec 2010 23:03:08 -0000 Mailing-List: contact larry25@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:larry25@example.org> List-Unsubscribe: <mailto:larry25@example.org> List-Post: <mailto:larry25@example.org> List-Id: <commits.activemq.apache.org> Reply-To: larry25@example.org Delivered-To: mailing list larry25@example.org Received: (qmail 75128 invoked by uid 99); 5 Dec 2010 23:03:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Dec 2010 23:03:08 +0000 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)
{'source': 'Apache Software Foundation Public Mail Archives'}