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 2007/02/14 18:41:21 UTC
svn commit: r507638 - in
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands:
WireFormatInfo.cpp WireFormatInfo.h
Author: tabish
Date: Wed Feb 14 09:41:20 2007
New Revision: 507638
URL: http://svn.apache.org/viewvc?view=rev&rev=507638
Log:
http://issues.apache.org/activemq/browse/AMQCPP-30
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp?view=diff&rev=507638&r1=507637&r2=507638
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp Wed Feb 14 09:41:20 2007
@@ -31,6 +31,9 @@
////////////////////////////////////////////////////////////////////////////////
WireFormatInfo::WireFormatInfo()
{
+ // Init to our prefered version
+ this->version = 2;
+
// Initialize the static MAGIC buffer.
if( MAGIC.empty() ) {
MAGIC.push_back( 'A' );
@@ -106,12 +109,11 @@
stream << " Value of properties = " << properties.toString() << std::endl;
stream << " Value of version = " << version << std::endl;
- stream << " Value of stackTraceEnabled = " << stackTraceEnabled << std::endl;
- stream << " Value of tcpNoDelayEnabled = " << tcpNoDelayEnabled << std::endl;
- stream << " Value of cacheEnabled = " << cacheEnabled << std::endl;
- stream << " Value of tightEncodingEnabled = " << tightEncodingEnabled << std::endl;
- stream << " Value of sizePrefixDisabled = " << sizePrefixDisabled << std::endl;
- stream << " Value of maxInactivityDuration = " << maxInactivityDuration << std::endl;
+ stream << " Value of stackTraceEnabled = " << isStackTraceEnabled() << std::endl;
+ stream << " Value of tcpNoDelayEnabled = " << isTcpNoDelayEnabled() << std::endl;
+ stream << " Value of cacheEnabled = " << isCacheEnabled() << std::endl;
+ stream << " Value of tightEncodingEnabled = " << isTightEncodingEnabled() << std::endl;
+ stream << " Value of sizePrefixDisabled = " << isSizePrefixDisabled() << std::endl;
stream << BaseCommand<transport::Command>::toString();
stream << "End Class = WireFormatInfo" << std::endl;
@@ -141,22 +143,19 @@
if( version != wireFormatInfo->getVersion() ) {
return false;
}
- if( stackTraceEnabled != wireFormatInfo->isStackTraceEnabled() ) {
- return false;
- }
- if( tcpNoDelayEnabled != wireFormatInfo->isTcpNoDelayEnabled() ) {
+ if( isStackTraceEnabled() != wireFormatInfo->isStackTraceEnabled() ) {
return false;
}
- if( cacheEnabled != wireFormatInfo->isCacheEnabled() ) {
+ if( isTcpNoDelayEnabled() != wireFormatInfo->isTcpNoDelayEnabled() ) {
return false;
}
- if( tightEncodingEnabled != wireFormatInfo->isTightEncodingEnabled() ) {
+ if( isCacheEnabled() != wireFormatInfo->isCacheEnabled() ) {
return false;
}
- if( sizePrefixDisabled != wireFormatInfo->isSizePrefixDisabled() ) {
+ if( isTightEncodingEnabled() != wireFormatInfo->isTightEncodingEnabled() ) {
return false;
}
- if( maxInactivityDuration != wireFormatInfo->getMaxInactivityDuration() ) {
+ if( isSizePrefixDisabled() != wireFormatInfo->isSizePrefixDisabled() ) {
return false;
}
if( !BaseCommand<transport::Command>::equals( value ) ) {
@@ -180,4 +179,114 @@
}
return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::isStackTraceEnabled() const {
+
+ try {
+ return properties.getBool( "StackTraceEnabled" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setStackTraceEnabled( bool stackTraceEnabled ) {
+
+ try {
+ properties.setBool( "StackTraceEnabled", stackTraceEnabled );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::isTcpNoDelayEnabled() const {
+
+ try {
+ return properties.getBool( "TcpNoDelayEnabled" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setTcpNoDelayEnabled( bool tcpNoDelayEnabled ) {
+
+ try {
+ properties.setBool( "TcpNoDelayEnabled", tcpNoDelayEnabled );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::isCacheEnabled() const {
+
+ try {
+ return properties.getBool( "CacheEnabled" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setCacheEnabled( bool cacheEnabled ) {
+
+ try {
+ properties.setBool( "CacheEnabled", cacheEnabled );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::isTightEncodingEnabled() const {
+
+ try {
+ return properties.getBool( "TightEncodingEnabled" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setTightEncodingEnabled( bool tightEncodingEnabled ) {
+
+ try {
+ properties.setBool( "TightEncodingEnabled", tightEncodingEnabled );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool WireFormatInfo::isSizePrefixDisabled() const {
+
+ try {
+ return properties.getBool( "SizePrefixDisabled" );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void WireFormatInfo::setSizePrefixDisabled( bool sizePrefixDisabled ) {
+
+ try {
+ properties.setBool( "SizePrefixDisabled", sizePrefixDisabled );
+ }
+ AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+ AMQ_CATCHALL_NOTHROW()
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h?view=diff&rev=507638&r1=507637&r2=507638
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.h Wed Feb 14 09:41:20 2007
@@ -87,116 +87,80 @@
}
/**
- * Checks if the stackTraceEnabled flag is on
- * @return true if the flag is on.
+ * Get the current Wireformat Version
+ * @return int that identifies the version
*/
- bool isStackTraceEnabled() const {
- return stackTraceEnabled;
+ int getVersion() const {
+ return version;
}
/**
- * Sets if the stackTraceEnabled flag is on
- * @param stackTraceEnabled - ture to turn flag is on
+ * Set the current Wireformat Version
+ * @param version - int that identifies the version
*/
- void setStackTraceEnabled( bool stackTraceEnabled ) {
- this->stackTraceEnabled = stackTraceEnabled;
+ void setVersion( int version ) {
+ this->version = version;
}
/**
- * Checks if the tcpNoDelayEnabled flag is on
+ * Checks if the stackTraceEnabled flag is on
* @return true if the flag is on.
*/
- bool isTcpNoDelayEnabled() const {
- return tcpNoDelayEnabled;
- }
+ bool isStackTraceEnabled() const;
/**
- * Sets if the tcpNoDelayEnabled flag is on
- * @param tcpNoDelayEnabled - ture to turn flag is on
+ * Sets if the stackTraceEnabled flag is on
+ * @param stackTraceEnabled - ture to turn flag is on
*/
- void setTcpNoDelayEnabled( bool tcpNoDelayEnabled ) {
- this->tcpNoDelayEnabled = tcpNoDelayEnabled;
- }
+ void setStackTraceEnabled( bool stackTraceEnabled );
/**
- * Get the current Wireformat Version
- * @return int that identifies the version
+ * Checks if the tcpNoDelayEnabled flag is on
+ * @return true if the flag is on.
*/
- int getVersion() const {
- return version;
- }
+ bool isTcpNoDelayEnabled() const;
/**
- * Set the current Wireformat Version
- * @param version - int that identifies the version
+ * Sets if the tcpNoDelayEnabled flag is on
+ * @param tcpNoDelayEnabled - ture to turn flag is on
*/
- void setVersion( int version ) {
- this->version = version;
- }
+ void setTcpNoDelayEnabled( bool tcpNoDelayEnabled );
/**
* Checks if the cacheEnabled flag is on
* @return true if the flag is on.
*/
- bool isCacheEnabled() const {
- return cacheEnabled;
- }
+ bool isCacheEnabled() const;
/**
* Sets if the cacheEnabled flag is on
* @param cacheEnabled - ture to turn flag is on
*/
- void setCacheEnabled( bool cacheEnabled ) {
- this->cacheEnabled = cacheEnabled;
- }
+ void setCacheEnabled( bool cacheEnabled );
/**
* Checks if the tightEncodingEnabled flag is on
* @return true if the flag is on.
*/
- bool isTightEncodingEnabled() const {
- return tightEncodingEnabled;
- }
+ bool isTightEncodingEnabled() const;
/**
* Sets if the tightEncodingEnabled flag is on
* @param tightEncodingEnabled - ture to turn flag is on
*/
- void setTightEncodingEnabled( bool tightEncodingEnabled ) {
- this->tightEncodingEnabled = tightEncodingEnabled;
- }
+ void setTightEncodingEnabled( bool tightEncodingEnabled );
/**
* Checks if the sizePrefixDisabled flag is on
* @return true if the flag is on.
*/
- bool isSizePrefixDisabled() const {
- return sizePrefixDisabled;
- }
+ bool isSizePrefixDisabled() const;
/**
* Sets if the sizePrefixDisabled flag is on
* @param sizePrefixDisabled - ture to turn flag is on
*/
- void setSizePrefixDisabled( bool sizePrefixDisabled ) {
- this->sizePrefixDisabled = sizePrefixDisabled;
- }
-
- /**
- * Get the current value of the maxInactivityDuration feild
- * @return the value of the maxInactivityDuration
- */
- long getMaxInactivityDuration() const {
- return maxInactivityDuration;
- }
-
- /**
- * Set the current Wireformat Version
- * @param version - int that identifies the version
- */
- void setMaxInactivityDuration( long maxInactivityDuration ) {
- this->maxInactivityDuration = maxInactivityDuration;
- }
+ void setSizePrefixDisabled( bool sizePrefixDisabled );
/**
* Get the Magic field
@@ -306,13 +270,10 @@
*/
util::PrimitiveMap properties;
+ /**
+ * OpenWire Protocal Version
+ */
int version;
- bool stackTraceEnabled;
- bool tcpNoDelayEnabled;
- bool cacheEnabled;
- bool tightEncodingEnabled;
- bool sizePrefixDisabled;
- long maxInactivityDuration;
};