You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/04/14 20:00:33 UTC
svn commit: r764906 - in
/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire:
OpenWireFormatFactory.cpp OpenWireFormatFactory.h
commands/WireFormatInfo.cpp commands/WireFormatInfo.h
Author: tabish
Date: Tue Apr 14 18:00:32 2009
New Revision: 764906
URL: http://svn.apache.org/viewvc?rev=764906&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/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.h
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp?rev=764906&r1=764905&r2=764906&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp Tue Apr 14 18:00:32 2009
@@ -20,6 +20,7 @@
#include <decaf/lang/Boolean.h>
#include <decaf/lang/Integer.h>
+#include <decaf/lang/Long.h>
using namespace std;
using namespace activemq;
@@ -62,6 +63,12 @@
info->setSizePrefixDisabled( Boolean::parseBoolean(
properties.getProperty( "wireFormat.sizePrefixDisabled",
"false" ) ) );
+ info->setMaxInactivityDuration( Long::parseLong(
+ properties.getProperty( "wireFormat.MaxInactivityDuration",
+ "30000" ) ) );
+ info->setMaxInactivityDurationInitalDelay( Long::parseLong(
+ properties.getProperty( "wireFormat.MaxInactivityDurationInitalDelay",
+ "10000" ) ) );
// Create the Openwire Format Object
OpenWireFormat* f = new OpenWireFormat( properties );
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.h?rev=764906&r1=764905&r2=764906&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.h (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/OpenWireFormatFactory.h Tue Apr 14 18:00:32 2009
@@ -44,6 +44,7 @@
* wireFormat.tightEncodingEnabled
* wireFormat.sizePrefixDisabled
* wireFormat.maxInactivityDuration
+ * wireFormat.maxInactivityDurationInitialDelay
*/
OpenWireFormatFactory() {}
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp?rev=764906&r1=764905&r2=764906&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp Tue Apr 14 18:00:32 2009
@@ -289,3 +289,43 @@
AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
AMQ_CATCHALL_NOTHROW()
}
+
+////////////////////////////////////////////////////////////////////////////////
+long long WireFormatInfo::getMaxInactivityDuration() const {
+ try {
+ return properties.getLong( "MaxInactivityDuration" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return 0LL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setMaxInactivityDuration( long long maxInactivityDuration ) {
+ try {
+ properties.setLong( "MaxInactivityDuration", maxInactivityDuration );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+long long WireFormatInfo::getMaxInactivityDurationInitalDelay() const {
+ try {
+ return properties.getLong( "MaxInactivityDurationInitalDelay" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return 0LL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setMaxInactivityDurationInitalDelay( long long maxInactivityDurationInitalDelay ) {
+ try {
+ properties.setLong( "MaxInactivityDurationInitalDelay", maxInactivityDurationInitalDelay );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.h?rev=764906&r1=764905&r2=764906&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.h (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/connector/openwire/commands/WireFormatInfo.h Tue Apr 14 18:00:32 2009
@@ -104,6 +104,30 @@
}
/**
+ * Returns the currently configured Max Inactivity duration.
+ * @return the set inactivity duration value.
+ */
+ long long getMaxInactivityDuration() const;
+
+ /**
+ * Sets the Max inactivity duration value.
+ * @param maxInactivityDuration - max time a client can be inactive.
+ */
+ void setMaxInactivityDuration( long long maxInactivityDuration );
+
+ /**
+ * Returns the currently configured Max Inactivity Intial Delay duration.
+ * @return the set inactivity duration initial delay value.
+ */
+ long long getMaxInactivityDurationInitalDelay() const;
+
+ /**
+ * Sets the Max inactivity initial delay duration value.
+ * @param maxInactivityDurationInitalDelay - time before the inactivity delay is checked.
+ */
+ void setMaxInactivityDurationInitalDelay( long long maxInactivityDurationInitalDelay );
+
+ /**
* Checks if the stackTraceEnabled flag is on
* @return true if the flag is on.
*/