Author: tabish
Date: Mon Jan 26 20:03:29 2009
New Revision: 737807
URL: http://svn.apache.org/viewvc?rev=737807&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-100
More work on the Failover bits.
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp?rev=737807&r1=737806&r2=737807&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
Mon Jan 26 20:03:29 2009
@@ -45,3 +45,59 @@
////////////////////////////////////////////////////////////////////////////////
FailoverTransport::~FailoverTransport() {
}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::addURI( const decaf::net::URI& uri ) {
+
+ synchronized( &this->uris ) {
+ this->uris.add( uri );
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::removeURI( const decaf::net::URI& uri ) {
+
+ synchronized( &this->uris ) {
+ this->uris.remove( uri );
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::oneway( Command* command )
+ throw( CommandIOException,
+ decaf::lang::exceptions::UnsupportedOperationException ) {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Response* FailoverTransport::request( Command* command AMQCPP_UNUSED )
+ throw( CommandIOException,
+ decaf::lang::exceptions::UnsupportedOperationException ) {
+
+ throw decaf::lang::exceptions::UnsupportedOperationException(
+ __FILE__, __LINE__, "FailoverTransport::request - Not Supported" );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Response* FailoverTransport::request( Command* command AMQCPP_UNUSED, unsigned
int timeout AMQCPP_UNUSED )
+ throw( CommandIOException,
+ decaf::lang::exceptions::UnsupportedOperationException ) {
+
+ throw decaf::lang::exceptions::UnsupportedOperationException(
+ __FILE__, __LINE__, "FailoverTransport::request - Not Supported" );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::start() throw( cms::CMSException ) {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::close() throw( cms::CMSException ) {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void FailoverTransport::reconnect() {
+
+}
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h?rev=737807&r1=737806&r2=737807&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
Mon Jan 26 20:03:29 2009
@@ -39,7 +39,7 @@
bool connected;
bool started;
- //decaf::util::Set<decaf::net::URI> uris;
+ decaf::util::Set<decaf::net::URI> uris;
long long initialReconnectDelay;
long long maxReconnectDelay;
@@ -50,14 +50,15 @@
int maxReconnectAttempts;
int connectFailures;
long long reconnectDelay;
- decaf::lang::Exception connectionFailure;
bool firstConnection;
bool backup;
- //List<BackupTransport> backups=new
CopyOnWriteArrayList<BackupTransport>();
int backupPoolSize;
bool trackMessages;
int maxCacheSize;
+ //List<BackupTransport> backups=new
CopyOnWriteArrayList<BackupTransport>();
+ decaf::lang::Exception connectionFailure;
+
public:
FailoverTransport( const decaf::net::URI& location,
@@ -212,6 +213,96 @@
return NULL;
}
+ public: // FailoverTransport Property Getters / Setters
+
+ long long getInitialReconnectDelay() const {
+ return this->initialReconnectDelay;
+ }
+
+ void setInitialReconnectDelay( long long value ) {
+ this->initialReconnectDelay = value;
+ }
+
+ long long getMaxReconnectDelay() const {
+ return this->maxReconnectDelay;
+ }
+
+ void setMaxReconnectDelay( long long value ) {
+ this->maxReconnectDelay = value;
+ }
+
+ long long getBackOffMultiplier() const {
+ return this->backOffMultiplier;
+ }
+
+ void setBackOffMultiplier( long long value ) {
+ this->backOffMultiplier = value;
+ }
+
+ bool isUseExponentialBackOff() const {
+ return this->useExponentialBackOff;
+ }
+
+ void setUseExponentialBackOff( bool value ) {
+ this->useExponentialBackOff = value;
+ }
+
+ bool isRandomize() const {
+ return this->randomize;
+ }
+
+ void setRandomize( bool value ) {
+ this->randomize = value;
+ }
+
+ int getMaxReconnectAttempts() const {
+ return this->maxReconnectAttempts;
+ }
+
+ void setMaxReconnectAttempts( int value ) {
+ this->maxReconnectAttempts = value;
+ }
+
+ long long getReconnectDelay() const {
+ return this->reconnectDelay;
+ }
+
+ void setReconnectDelay( long long value ) {
+ this->reconnectDelay = value;
+ }
+
+ bool isBackup() const {
+ return this->backup;
+ }
+
+ void setBackup( bool value ) {
+ this->backup = value;
+ }
+
+ int getBackupPoolSize() const {
+ return this->backupPoolSize;
+ }
+
+ void setBackupPoolSize( int value ) {
+ this->backupPoolSize = value;
+ }
+
+ bool isTrackMessages() const {
+ return this->trackMessages;
+ }
+
+ void setTrackMessages( bool value ) {
+ this->trackMessages = value;
+ }
+
+ int getMaxCacheSize() const {
+ return this->maxCacheSize;
+ }
+
+ void setMaxCacheSize( int value ) {
+ this->maxCacheSize = value;
+ }
+
};
}}}