Update Commands and State Tracker.
git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-cpp/trunk@961973 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/activemq-cpp/src/main/activemq/commands/ConnectionInfo.cpp b/activemq-cpp/src/main/activemq/commands/ConnectionInfo.cpp
index a81a41a..f7b4940 100644
--- a/activemq-cpp/src/main/activemq/commands/ConnectionInfo.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ConnectionInfo.cpp
@@ -40,7 +40,7 @@
////////////////////////////////////////////////////////////////////////////////
ConnectionInfo::ConnectionInfo()
: BaseCommand(), connectionId(NULL), clientId(""), password(""), userName(""), brokerPath(), brokerMasterConnector(false),
- manageable(false), clientMaster(false), faultTolerant(false) {
+ manageable(false), clientMaster(false), faultTolerant(false), failoverReconnect(false) {
}
@@ -86,6 +86,7 @@
this->setManageable( srcPtr->isManageable() );
this->setClientMaster( srcPtr->isClientMaster() );
this->setFaultTolerant( srcPtr->isFaultTolerant() );
+ this->setFailoverReconnect( srcPtr->isFailoverReconnect() );
}
////////////////////////////////////////////////////////////////////////////////
@@ -137,6 +138,8 @@
stream << "ClientMaster = " << this->isClientMaster();
stream << ", ";
stream << "FaultTolerant = " << this->isFaultTolerant();
+ stream << ", ";
+ stream << "FailoverReconnect = " << this->isFailoverReconnect();
stream << " }";
return stream.str();
@@ -192,6 +195,9 @@
if( this->isFaultTolerant() != valuePtr->isFaultTolerant() ) {
return false;
}
+ if( this->isFailoverReconnect() != valuePtr->isFailoverReconnect() ) {
+ return false;
+ }
if( !BaseCommand::equals( value ) ) {
return false;
}
@@ -314,6 +320,16 @@
}
////////////////////////////////////////////////////////////////////////////////
+bool ConnectionInfo::isFailoverReconnect() const {
+ return failoverReconnect;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ConnectionInfo::setFailoverReconnect( bool failoverReconnect ) {
+ this->failoverReconnect = failoverReconnect;
+}
+
+////////////////////////////////////////////////////////////////////////////////
decaf::lang::Pointer<commands::Command> ConnectionInfo::visit( activemq::state::CommandVisitor* visitor ) {
return visitor->processConnectionInfo( this );
diff --git a/activemq-cpp/src/main/activemq/commands/ConnectionInfo.h b/activemq-cpp/src/main/activemq/commands/ConnectionInfo.h
index 02f2f62..eb84ed0 100644
--- a/activemq-cpp/src/main/activemq/commands/ConnectionInfo.h
+++ b/activemq-cpp/src/main/activemq/commands/ConnectionInfo.h
@@ -58,6 +58,7 @@
bool manageable;
bool clientMaster;
bool faultTolerant;
+ bool failoverReconnect;
public:
@@ -118,6 +119,9 @@
virtual bool isFaultTolerant() const;
virtual void setFaultTolerant( bool faultTolerant );
+ virtual bool isFailoverReconnect() const;
+ virtual void setFailoverReconnect( bool failoverReconnect );
+
/**
* @return an answer of true to the isConnectionInfo() query.
*/
diff --git a/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp b/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp
index c6e61ea..d74e2ae 100644
--- a/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp
+++ b/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp
@@ -124,7 +124,11 @@
for( ; iter != connectionStates.end(); ++iter ) {
Pointer<ConnectionState> state = *iter;
- transport->oneway( state->getInfo() );
+
+ Pointer<ConnectionInfo> info = state->getInfo();
+ info->setFailoverReconnect( true );
+ transport->oneway( info );
+
doRestoreTempDestinations( transport, state );
if( restoreSessions ) {
diff --git a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionInfoMarshaller.cpp b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionInfoMarshaller.cpp
index 1b697ce..c2da7c4 100644
--- a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionInfoMarshaller.cpp
+++ b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionInfoMarshaller.cpp
@@ -86,6 +86,9 @@
if( wireVersion >= 6 ) {
info->setFaultTolerant( bs->readBoolean() );
}
+ if( wireVersion >= 6 ) {
+ info->setFailoverReconnect( bs->readBoolean() );
+ }
}
AMQ_CATCH_RETHROW( decaf::io::IOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -117,6 +120,9 @@
if( wireVersion >= 6 ) {
bs->writeBoolean( info->isFaultTolerant() );
}
+ if( wireVersion >= 6 ) {
+ bs->writeBoolean( info->isFailoverReconnect() );
+ }
return rc + 0;
}
@@ -150,6 +156,9 @@
if( wireVersion >= 6 ) {
bs->readBoolean();
}
+ if( wireVersion >= 6 ) {
+ bs->readBoolean();
+ }
}
AMQ_CATCH_RETHROW( decaf::io::IOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -191,6 +200,9 @@
if( wireVersion >= 6 ) {
info->setFaultTolerant( dataIn->readBoolean() );
}
+ if( wireVersion >= 6 ) {
+ info->setFailoverReconnect( dataIn->readBoolean() );
+ }
}
AMQ_CATCH_RETHROW( decaf::io::IOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -221,6 +233,9 @@
if( wireVersion >= 6 ) {
dataOut->writeBoolean( info->isFaultTolerant() );
}
+ if( wireVersion >= 6 ) {
+ dataOut->writeBoolean( info->isFailoverReconnect() );
+ }
}
AMQ_CATCH_RETHROW( decaf::io::IOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )