Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 56834 invoked from network); 14 Apr 2009 20:07:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Apr 2009 20:07:30 -0000 Received: (qmail 77956 invoked by uid 500); 14 Apr 2009 20:07:30 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 77901 invoked by uid 500); 14 Apr 2009 20:07:30 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 77892 invoked by uid 99); 14 Apr 2009 20:07:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 20:07:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 20:07:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 301F0238896D; Tue, 14 Apr 2009 20:07:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r764942 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: commands/ wireformat/openwire/ Date: Tue, 14 Apr 2009 20:07:06 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090414200707.301F0238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Tue Apr 14 20:07:05 2009 New Revision: 764942 URL: http://svn.apache.org/viewvc?rev=764942&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-236 Adds max inactivity duration configuration to the wireformat URI for Openwire. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.h activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.h activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormatFactory.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp?rev=764942&r1=764941&r2=764942&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp Tue Apr 14 20:07:05 2009 @@ -109,8 +109,11 @@ stream << " Value of stackTraceEnabled = " << isStackTraceEnabled() << std::endl; stream << " Value of tcpNoDelayEnabled = " << isTcpNoDelayEnabled() << std::endl; stream << " Value of cacheEnabled = " << isCacheEnabled() << std::endl; + stream << " Value of cacheSize = " << getCacheSize() << std::endl; stream << " Value of tightEncodingEnabled = " << isTightEncodingEnabled() << std::endl; stream << " Value of sizePrefixDisabled = " << isSizePrefixDisabled() << std::endl; + stream << " Value of maxInactivityDuration = " << getMaxInactivityDuration() << std::endl; + stream << " Value of maxInactivityDuration = " << getMaxInactivityDurationInitalDelay() << std::endl; stream << BaseCommand::toString(); stream << "End Class = WireFormatInfo" << std::endl; @@ -149,6 +152,9 @@ if( isCacheEnabled() != wireFormatInfo->isCacheEnabled() ) { return false; } + if( getCacheSize() != wireFormatInfo->getCacheSize() ) { + return false; + } if( isTightEncodingEnabled() != wireFormatInfo->isTightEncodingEnabled() ) { return false; } @@ -158,6 +164,12 @@ if( !BaseCommand::equals( value ) ) { return false; } + if( getMaxInactivityDuration() != wireFormatInfo->getMaxInactivityDuration() ) { + return false; + } + if( getMaxInactivityDurationInitalDelay() != wireFormatInfo->getMaxInactivityDurationInitalDelay() ) { + return false; + } return true; } @@ -372,3 +384,23 @@ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_NOTHROW() } + +//////////////////////////////////////////////////////////////////////////////// +int WireFormatInfo::getCacheSize() const { + try { + return properties.getInt( "CacheSize" ); + } + AMQ_CATCH_NOTHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_NOTHROW() + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +void WireFormatInfo::setCacheSize( int value ) { + try { + properties.setInt( "CacheSize", value ); + } + AMQ_CATCH_NOTHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_NOTHROW() +} Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.h?rev=764942&r1=764941&r2=764942&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.h Tue Apr 14 20:07:05 2009 @@ -186,6 +186,18 @@ void setCacheEnabled( bool cacheEnabled ); /** + * Gets the Cache Size setting. + * @return currently set cache size. + */ + int getCacheSize() const; + + /** + * Sets the Cache Size setting. + * @param value - value to set to the cache size. + */ + void setCacheSize( int value ); + + /** * Checks if the tightEncodingEnabled flag is on * @return true if the flag is on. */ Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp?rev=764942&r1=764941&r2=764942&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp Tue Apr 14 20:07:05 2009 @@ -65,11 +65,14 @@ this->id = UUID::randomUUID().toString(); // Set defaults for initial WireFormat negotiation this->version = 0; - this->stackTraceEnabled = false; - this->cacheEnabled = false; - this->tcpNoDelayEnabled = false; + this->stackTraceEnabled = true; + this->cacheEnabled = true; + this->cacheSize = 1024; + this->tcpNoDelayEnabled = true; this->tightEncodingEnabled = false; this->sizePrefixDisabled = false; + this->maxInactivityDuration = 30000; + this->maxInactivityDurationInitialDelay = 10000; // Set to Default as lowest common denominator, then we will try // and move up to the preferred when the wireformat is negotiated. @@ -535,4 +538,9 @@ preferedWireFormatInfo->isTightEncodingEnabled(); this->sizePrefixDisabled = info.isSizePrefixDisabled() && preferedWireFormatInfo->isSizePrefixDisabled(); + this->cacheSize = min( info.getCacheSize(), preferedWireFormatInfo->getCacheSize() ); + this->maxInactivityDuration = min( info.getMaxInactivityDuration(), + preferedWireFormatInfo->getMaxInactivityDuration() ); + this->maxInactivityDurationInitialDelay = min( info.getMaxInactivityDurationInitalDelay(), + preferedWireFormatInfo->getMaxInactivityDurationInitalDelay() ); } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.h?rev=764942&r1=764941&r2=764942&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.h Tue Apr 14 20:07:05 2009 @@ -67,8 +67,11 @@ bool stackTraceEnabled; bool tcpNoDelayEnabled; bool cacheEnabled; + int cacheSize; bool tightEncodingEnabled; bool sizePrefixDisabled; + long long maxInactivityDuration; + long long maxInactivityDurationInitialDelay; public: @@ -274,6 +277,22 @@ } /** + * Returns the currently set Cache size. + * @return the current value of the broker's cache size. + */ + int getCacheSize() const { + return cacheSize; + } + + /** + * Sets the current Cache size. + * @param value - the value to send as the broker's cache size. + */ + void setCacheSize( int value ) { + this->cacheSize = value; + } + + /** * Checks if the tightEncodingEnabled flag is on * @return true if the flag is on. */ @@ -305,6 +324,38 @@ this->sizePrefixDisabled = sizePrefixDisabled; } + /** + * Gets the MaxInactivityDuration setting. + * @return maximum inactivity duration value in milliseconds. + */ + long long getMaxInactivityDuration() const { + return this->maxInactivityDuration; + } + + /** + * Sets the MaxInactivityDuration setting. + * @param value - the Max inactivity duration value in milliseconds. + */ + void setMaxInactivityDuration( long long value ) { + this->maxInactivityDuration = value; + } + + /** + * Gets the MaxInactivityDurationInitialDelay setting. + * @return maximum inactivity duration initial delay value in milliseconds. + */ + long long getMaxInactivityDurationInitialDelay() const { + return this->maxInactivityDurationInitialDelay; + } + + /** + * Sets the MaxInactivityDurationInitialDelay setting. + * @param value - the Max inactivity Initial Delay duration value in milliseconds. + */ + void setMaxInactivityDurationInitialDelay( long long value ) { + this->maxInactivityDurationInitialDelay = value; + } + protected: /** Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormatFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormatFactory.cpp?rev=764942&r1=764941&r2=764942&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormatFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormatFactory.cpp Tue Apr 14 20:07:05 2009 @@ -50,13 +50,16 @@ // parse params out of the properties info->setStackTraceEnabled( Boolean::parseBoolean( properties.getProperty( "wireFormat.stackTraceEnabled", - "false" ) ) ); + "true" ) ) ); info->setCacheEnabled( Boolean::parseBoolean( properties.getProperty( "wireFormat.cacheEnabled", "false" ) ) ); + info->setCacheSize( Integer::parseInt( + properties.getProperty( "wireFormat.cacheSize", + "1024" ) ) ); info->setTcpNoDelayEnabled( Boolean::parseBoolean( properties.getProperty( "wireFormat.tcpNoDelayEnabled", - "false" ) ) ); + "true" ) ) ); info->setTightEncodingEnabled( Boolean::parseBoolean( properties.getProperty( "wireFormat.tightEncodingEnabled", "false" ) ) );