activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r737918 - in /activemq/activemq-cpp/trunk/src/main/activemq/transport/failover: FailoverTransport.cpp FailoverTransport.h FailoverTransportFactory.cpp
Date Mon, 26 Jan 2009 23:01:40 GMT
Author: tabish
Date: Mon Jan 26 23:01:39 2009
New Revision: 737918

URL: http://svn.apache.org/viewvc?rev=737918&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
    activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransportFactory.cpp

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=737918&r1=737917&r2=737918&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 23:01:39 2009
@@ -22,10 +22,9 @@
 using namespace activemq::transport::failover;
 
 ////////////////////////////////////////////////////////////////////////////////
-FailoverTransport::FailoverTransport( const decaf::net::URI& location,
-                                      wireformat::WireFormat* wireformat,
-                                      const decaf::util::Properties& properties ) {
+FailoverTransport::FailoverTransport() {
 
+    this->timeout = -1;
     this->initialReconnectDelay = 10;
     this->maxReconnectDelay = 1000 * 30;
     this->backOffMultiplier = 2;

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=737918&r1=737917&r2=737918&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 23:01:39 2009
@@ -41,6 +41,7 @@
 
         decaf::util::Set<decaf::net::URI> uris;
 
+        long long timeout;
         long long initialReconnectDelay;
         long long maxReconnectDelay;
         long long backOffMultiplier;
@@ -61,9 +62,7 @@
 
     public:
 
-        FailoverTransport( const decaf::net::URI& location,
-                           wireformat::WireFormat* wireformat,
-                           const decaf::util::Properties& properties );
+        FailoverTransport();
 
         virtual ~FailoverTransport();
 
@@ -215,6 +214,14 @@
 
     public: // FailoverTransport Property Getters / Setters
 
+        long long getTimeout() const {
+            return this->timeout;
+        }
+
+        void setTimeout( long long value ) {
+            this->timeout = value;
+        }
+
         long long getInitialReconnectDelay() const {
             return this->initialReconnectDelay;
         }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransportFactory.cpp?rev=737918&r1=737917&r2=737918&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransportFactory.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransportFactory.cpp
Mon Jan 26 23:01:39 2009
@@ -19,6 +19,11 @@
 
 #include <activemq/transport/failover/FailoverTransport.h>
 
+#include <decaf/lang/Boolean.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/lang/Long.h>
+#include <memory>
+
 using namespace activemq;
 using namespace activemq::transport;
 using namespace activemq::transport::failover;
@@ -35,7 +40,30 @@
 
     try {
 
-        return new FailoverTransport( location, wireFormat, properties );
+        std::auto_ptr<FailoverTransport> transport( new FailoverTransport() );
+
+        transport->setInitialReconnectDelay(
+            Long::parseLong( properties.getProperty( "initialReconnectDelay", "10" ) ) );
+        transport->setMaxReconnectDelay(
+            Long::parseLong( properties.getProperty( "maxReconnectDelay", "30000" ) ) );
+        transport->setUseExponentialBackOff(
+            Boolean::parseBoolean( properties.getProperty( "useExponentialBackOff", "true"
) ) );
+        transport->setMaxReconnectAttempts(
+            Integer::parseInt( properties.getProperty( "maxReconnectAttempts", "0" ) ) );
+        transport->setRandomize(
+            Boolean::parseBoolean( properties.getProperty( "randomize", "true" ) ) );
+        transport->setBackup(
+            Boolean::parseBoolean( properties.getProperty( "backup", "false" ) ) );
+        transport->setBackupPoolSize(
+            Integer::parseInt( properties.getProperty( "backupPoolSize", "1" ) ) );
+        transport->setTimeout(
+            Long::parseLong( properties.getProperty( "timeout", "-1" ) ) );
+        transport->setTrackMessages(
+            Boolean::parseBoolean( properties.getProperty( "trackMessages", "false" ) ) );
+        transport->setMaxCacheSize(
+            Integer::parseInt( properties.getProperty( "maxCacheSize", "131072" ) ) );
+
+        return transport.release();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )



Mime
View raw message