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 2006/11/17 19:26:44 UTC
svn commit: r476239 - in
/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire:
OpenWireFormat.cpp OpenWireFormat.h marshal/BaseDataStreamMarshaller.cpp
marshal/BaseDataStreamMarshaller.h
Author: tabish
Date: Fri Nov 17 10:26:43 2006
New Revision: 476239
URL: http://svn.apache.org/viewvc?view=rev&rev=476239
Log:
Changes to support new Openwire Functionality
Modified:
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp?view=diff&rev=476239&r1=476238&r2=476239
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp Fri Nov 17 10:26:43 2006
@@ -24,11 +24,6 @@
#include <activemq/util/Math.h>
#include <activemq/io/ByteArrayOutputStream.h>
#include <activemq/connector/openwire/utils/BooleanStream.h>
-#include <activemq/connector/openwire/commands/MessageId.h>
-#include <activemq/connector/openwire/commands/ProducerId.h>
-#include <activemq/connector/openwire/commands/TransactionId.h>
-#include <activemq/connector/openwire/commands/LocalTransactionId.h>
-#include <activemq/connector/openwire/commands/XATransactionId.h>
#include <activemq/connector/openwire/commands/WireFormatInfo.h>
#include <activemq/connector/openwire/commands/DataStructure.h>
#include <activemq/connector/openwire/marshal/MarshalAware.h>
@@ -472,41 +467,4 @@
this->sizePrefixDisabled = info->isSizePrefixDisabled() &&
preferedWireFormatInfo->isSizePrefixDisabled();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string OpenWireFormat::toString( commands::MessageId* id )
-{
- if( id == NULL ) return "";
-
- return OpenWireFormat::toString( id->getProducerId() ) + ":" +
- Long::toString( id->getProducerSequenceId() );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string OpenWireFormat::toString( commands::ProducerId* id )
-{
- return id->getConnectionId() + ":" +
- Long::toString( id->getSessionId() ) + ":" +
- Long::toString( id->getValue() );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string OpenWireFormat::toString( commands::TransactionId* txnId )
-{
- LocalTransactionId* ltxnId = dynamic_cast<LocalTransactionId*>( txnId );
- XATransactionId* xaTxnId = dynamic_cast<XATransactionId*>( txnId );
-
- if( ltxnId != NULL )
- {
- return Long::toString( ltxnId->getValue() );
- }
- else if( xaTxnId != NULL )
- {
-// return string("XID:") + Integer::toString( xaTxnId->getFormatId() ) + ":" +
-// toHexFromBytes( xaTxnId->getGlobalTransactionId() ) + ":" +
-// toHexFromBytes( xaTxnId->getBranchQualifier() );
- }
-
- return "";
}
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h?view=diff&rev=476239&r1=476238&r2=476239
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.h Fri Nov 17 10:26:43 2006
@@ -24,10 +24,6 @@
#include <activemq/connector/openwire/utils/BooleanStream.h>
#include <activemq/util/SimpleProperties.h>
#include <activemq/exceptions/IllegalStateException.h>
-#include <activemq/connector/openwire/commands/MessageId.h>
-#include <activemq/connector/openwire/commands/ProducerId.h>
-#include <activemq/connector/openwire/commands/TransactionId.h>
-
namespace activemq{
namespace connector{
@@ -250,29 +246,6 @@
void setMaxInactivityDuration( long maxInactivityDuration ) {
this->maxInactivityDuration = maxInactivityDuration;
}
-
- public: // Statics
-
- /**
- * Converts the object to a String
- * @param id - MessageId pointer
- * @returns string representing the id
- */
- static std::string toString( commands::MessageId* id );
-
- /**
- * Converts the object to a String
- * @param id - ProducerId pointer
- * @returns string representing the id
- */
- static std::string toString( commands::ProducerId* id );
-
- /**
- * Converts the given transaction ID into a String
- * @param txnId - TransactionId poitner
- * @returns string representation of the id
- */
- static std::string toString( commands::TransactionId* txnId );
protected:
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp?view=diff&rev=476239&r1=476238&r2=476239
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp Fri Nov 17 10:26:43 2006
@@ -16,12 +16,20 @@
*/
#include <activemq/connector/openwire/marhsal/BaseDataStreamMarshaller.h>
+#include <activemq/connector/openwire/commands/MessageId.h>
+#include <activemq/connector/openwire/commands/ProducerId.h>
+#include <activemq/connector/openwire/commands/TransactionId.h>
+#include <activemq/connector/openwire/commands/LocalTransactionId.h>
+#include <activemq/connector/openwire/commands/XATransactionId.h>
+#include <activemq/connector/openwire/utils/HexTable.h>
using namespace std;
using namespace activemq;
using namespace activemq::connector;
using namespace activemq::connector::openwire;
using namespace activemq::connector::openwire::marshal;
+using namespace activemq::connector::openwire::commands;
+using namespace activemq::connector::openwire::utils;
////////////////////////////////////////////////////////////////////////////////
BaseDataStreamMarshaller::BaseDataStreamMarshaller() {
@@ -29,4 +37,41 @@
////////////////////////////////////////////////////////////////////////////////
BaseDataStreamMarshaller::~BaseDataStreamMarshaller() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string BaseDataStreamMarshaller::toString( commands::MessageId* id )
+{
+ if( id == NULL ) return "";
+
+ return OpenWireFormat::toString( id->getProducerId() ) + ":" +
+ Long::toString( id->getProducerSequenceId() );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string BaseDataStreamMarshaller::toString( commands::ProducerId* id )
+{
+ return id->getConnectionId() + ":" +
+ Long::toString( id->getSessionId() ) + ":" +
+ Long::toString( id->getValue() );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string BaseDataStreamMarshaller::toString( commands::TransactionId* txnId )
+{
+ LocalTransactionId* ltxnId = dynamic_cast<LocalTransactionId*>( txnId );
+ XATransactionId* xaTxnId = dynamic_cast<XATransactionId*>( txnId );
+
+ if( ltxnId != NULL )
+ {
+ return Long::toString( ltxnId->getValue() );
+ }
+ else if( xaTxnId != NULL )
+ {
+// return string("XID:") + Integer::toString( xaTxnId->getFormatId() ) + ":" +
+// toHexFromBytes( xaTxnId->getGlobalTransactionId() ) + ":" +
+// toHexFromBytes( xaTxnId->getBranchQualifier() );
+ }
+
+ return "";
}
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h?view=diff&rev=476239&r1=476238&r2=476239
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h Fri Nov 17 10:26:43 2006
@@ -19,6 +19,9 @@
#define _ACTIVEMQ_CONNECTOR_OPENWIRE_MARSHAL_BASEDATASTREAMMARSHALLER_H_
#include <activemq/connector/openwire/DataStreamMarshaller.h>
+#include <activemq/connector/openwire/commands/MessageId.h>
+#include <activemq/connector/openwire/commands/ProducerId.h>
+#include <activemq/connector/openwire/commands/TransactionId.h>
namespace activemq{
namespace connector{
@@ -95,6 +98,29 @@
commands::DataStructure* command,
io::DataInputStream* dis )
throw ( io::IOException ) {};
+
+ public: // Statics
+
+ /**
+ * Converts the object to a String
+ * @param id - MessageId pointer
+ * @returns string representing the id
+ */
+ static std::string toString( commands::MessageId* id );
+
+ /**
+ * Converts the object to a String
+ * @param id - ProducerId pointer
+ * @returns string representing the id
+ */
+ static std::string toString( commands::ProducerId* id );
+
+ /**
+ * Converts the given transaction ID into a String
+ * @param txnId - TransactionId poitner
+ * @returns string representation of the id
+ */
+ static std::string toString( commands::TransactionId* txnId );
protected: