activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r593929 [6/7] - in /activemq/activemq-cpp/trunk/src: main/activemq/connector/ main/activemq/connector/openwire/ main/activemq/connector/openwire/commands/ main/activemq/connector/openwire/marshal/ main/activemq/connector/openwire/utils/ mai...
Date Sun, 11 Nov 2007 16:52:54 GMT
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp Sun Nov 11 08:52:45 2007
@@ -21,14 +21,17 @@
 
 #include <decaf/util/concurrent/Concurrent.h>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
+#include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/util/Config.h>
 
 using namespace activemq;
 using namespace activemq::transport;
+using namespace activemq::exceptions;
 using namespace decaf::lang;
 using namespace decaf::util::concurrent;
 
-LOGDECAF_INITIALIZE(logger, IOTransport, "activemq.transport.IOTransport" )
+////////////////////////////////////////////////////////////////////////////////
+LOGDECAF_INITIALIZE( logger, IOTransport, "activemq.transport.IOTransport" )
 
 ////////////////////////////////////////////////////////////////////////////////
 IOTransport::IOTransport(){
@@ -45,81 +48,98 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 IOTransport::~IOTransport(){
-
-    close();
+    try{
+        close();
+    }
+    AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void IOTransport::oneway( Command* command )
-    throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException)
-{
-    if( closed ){
-        throw CommandIOException( __FILE__, __LINE__,
-            "IOTransport::oneway() - transport is closed!" );
-    }
+    throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
 
-    // Make sure the thread has been started.
-    if( thread == NULL ){
-        throw CommandIOException(
-            __FILE__, __LINE__,
-            "IOTransport::oneway() - transport is not started" );
-    }
+    try{
 
-    // Make sure the command object is valid.
-    if( command == NULL ){
-        throw CommandIOException(
-            __FILE__, __LINE__,
-            "IOTransport::oneway() - attempting to write NULL command" );
-    }
+        if( closed ){
+            throw CommandIOException( __FILE__, __LINE__,
+                "IOTransport::oneway() - transport is closed!" );
+        }
 
-    // Make sure we have an output strema to write to.
-    if( outputStream == NULL ){
-        throw CommandIOException(
-            __FILE__, __LINE__,
-            "IOTransport::oneway() - invalid output stream" );
-    }
+        // Make sure the thread has been started.
+        if( thread == NULL ){
+            throw CommandIOException(
+                __FILE__, __LINE__,
+                "IOTransport::oneway() - transport is not started" );
+        }
+
+        // Make sure the command object is valid.
+        if( command == NULL ){
+            throw CommandIOException(
+                __FILE__, __LINE__,
+                "IOTransport::oneway() - attempting to write NULL command" );
+        }
 
-    synchronized( outputStream ){
-        // Write the command to the output stream.
-        writer->writeCommand( command );
+        // Make sure we have an output strema to write to.
+        if( outputStream == NULL ){
+            throw CommandIOException(
+                __FILE__, __LINE__,
+                "IOTransport::oneway() - invalid output stream" );
+        }
+
+        synchronized( outputStream ){
+            // Write the command to the output stream.
+            writer->writeCommand( command );
+        }
     }
+    AMQ_CATCH_RETHROW( CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
+    AMQ_CATCHALL_THROW( CommandIOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void IOTransport::start() throw( cms::CMSException ){
 
-    // Can't restart a closed transport.
-    if( closed ){
-        throw CommandIOException( __FILE__, __LINE__, "IOTransport::start() - transport is already closed - cannot restart" );
-    }
+    try{
 
-    // If it's already started, do nothing.
-    if( thread != NULL ){
-        return;
-    }
+        // Can't restart a closed transport.
+        if( closed ){
+            throw ActiveMQException(
+                __FILE__, __LINE__,
+                "IOTransport::start() - transport is already closed - cannot restart" );
+        }
 
-    // Make sure all variables that we need have been set.
-    if( inputStream == NULL || outputStream == NULL ||
-        reader == NULL || writer == NULL ){
-        throw CommandIOException(
-            __FILE__, __LINE__,
-            "IOTransport::start() - "
-            "IO sreams and reader/writer must be set before calling start" );
-    }
+        // If it's already started, do nothing.
+        if( thread != NULL ){
+            return;
+        }
 
-    // Init the Command Reader and Writer with the Streams
-    reader->setInputStream( inputStream );
-    writer->setOutputStream( outputStream );
+        // Make sure all variables that we need have been set.
+        if( inputStream == NULL || outputStream == NULL ||
+            reader == NULL || writer == NULL ){
+            throw ActiveMQException(
+                __FILE__, __LINE__,
+                "IOTransport::start() - "
+                "IO sreams and reader/writer must be set before calling start" );
+        }
 
-    // Start the polling thread.
-    thread = new Thread( this );
-    thread->start();
+        // Init the Command Reader and Writer with the Streams
+        reader->setInputStream( inputStream );
+        writer->setOutputStream( outputStream );
+
+        // Start the polling thread.
+        thread = new Thread( this );
+        thread->start();
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void IOTransport::close() throw( cms::CMSException ){
 
     try{
+
         if( closed ){
             return;
         }
@@ -152,8 +172,9 @@
             outputStream = NULL;
         }
     }
-    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -172,10 +193,14 @@
 
     }
     catch( exceptions::ActiveMQException& ex ){
-
         ex.setMark( __FILE__, __LINE__ );
         fire( ex );
     }
+    catch( decaf::lang::Exception& ex ){
+        exceptions::ActiveMQException exl( ex );
+        exl.setMark( __FILE__, __LINE__ );
+        fire( exl );
+    }
     catch( ... ){
 
         exceptions::ActiveMQException ex(
@@ -196,4 +221,3 @@
         __FILE__, __LINE__,
         "IOTransport::request() - unsupported operation" );
 }
-

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h Sun Nov 11 08:52:45 2007
@@ -15,16 +15,17 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_
-#define ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_
+#ifndef _ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_
+#define _ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_
 
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/TransportExceptionListener.h>
 #include <activemq/transport/CommandListener.h>
-#include <decaf/lang/Runnable.h>
-#include <decaf/lang/Thread.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/transport/Command.h>
+
+#include <decaf/lang/Runnable.h>
+#include <decaf/lang/Thread.h>
 #include <decaf/util/logging/LoggerDefines.h>
 
 namespace activemq{
@@ -42,10 +43,8 @@
      * destructor.  Once this object has been closed, it cannot be
      * restarted.
      */
-    class IOTransport :
-        public Transport,
-        public decaf::lang::Runnable
-    {
+    class IOTransport : public Transport,
+                        public decaf::lang::Runnable {
 
         LOGDECAF_DECLARE( logger )
 
@@ -97,7 +96,7 @@
          * Notify the excpetion listener
          * @param ex the exception to send
          */
-        void fire( exceptions::ActiveMQException& ex ){
+        void fire( decaf::lang::Exception& ex ){
 
             if( exceptionListener != NULL ){
 
@@ -234,4 +233,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp Sun Nov 11 08:52:45 2007
@@ -18,9 +18,13 @@
 #include "IOTransportFactory.h"
 #include <activemq/util/Config.h>
 #include <activemq/transport/IOTransport.h>
+#include <decaf/lang/Exception.h>
 
 using namespace activemq;
 using namespace activemq::transport;
+using namespace activemq::exceptions;
+using namespace decaf;
+using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
 Transport* IOTransportFactory::createTransport(
@@ -28,8 +32,13 @@
     Transport* next AMQCPP_UNUSED,
     bool own AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException ) {
 
-    // IO is the Base Tranport, it can have no next.
-    return new IOTransport();
+    try{
+        // IO is the Base Tranport, it can have no next.
+        return new IOTransport();
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_
-#define ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_
 
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/transport/TransportFactory.h>
@@ -29,7 +29,7 @@
      * Manufactures IOTransports, which are objects that
      * read from input streams and write to output streams.
      */
-    class IOTransportFactory : public TransportFactory{
+    class IOTransportFactory : public TransportFactory {
     private:
 
         static TransportFactoryMapRegistrar registrar;
@@ -60,4 +60,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_IOTRANSPORTFACTORY_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.cpp Sun Nov 11 08:52:45 2007
@@ -16,10 +16,13 @@
  */
 
 #include <activemq/transport/MockTransport.h>
+#include <activemq/exceptions/ActiveMQException.h>
 
 using namespace activemq;
 using namespace activemq::transport;
 using namespace activemq::exceptions;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 MockTransport* MockTransport::instance = NULL;
@@ -44,16 +47,20 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 MockTransport::~MockTransport(){
+    try{
 
-    if( own ){
-        delete responseBuilder;
+        if( own ){
+            delete responseBuilder;
+        }
     }
+    AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int MockTransport::getNextCommandId() throw ( exceptions::ActiveMQException ) {
 
     try{
+
         synchronized( &commandIdMutex ){
             return ++nextCommandId;
         }
@@ -62,22 +69,32 @@
         // smart enough to figure out we'll never get here.
         return 0;
     }
-    AMQ_CATCHALL_THROW( transport::CommandIOException )
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void MockTransport::oneway( Command* command )
         throw( CommandIOException,
-               decaf::lang::exceptions::UnsupportedOperationException)
-{
-    // Process and send any new Commands back.
-    internalListener.onCommand( command );
+               decaf::lang::exceptions::UnsupportedOperationException) {
 
-    // Notify external Client of command that we "sent"
-    if( outgoingCommandListener != NULL ){
-        outgoingCommandListener->onCommand( command );
-        return;
+    try{
+
+        // Process and send any new Commands back.
+        internalListener.onCommand( command );
+
+        // Notify external Client of command that we "sent"
+        if( outgoingCommandListener != NULL ){
+            outgoingCommandListener->onCommand( command );
+            return;
+        }
     }
+    AMQ_CATCH_RETHROW( CommandIOException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
+    AMQ_CATCHALL_THROW( CommandIOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -85,18 +102,27 @@
     throw( CommandIOException,
            decaf::lang::exceptions::UnsupportedOperationException)
 {
-    if( responseBuilder != NULL ){
+    try{
 
-        // Notify external Client of command that we "sent"
-        if( outgoingCommandListener != NULL ){
-            outgoingCommandListener->onCommand( command );
+        if( responseBuilder != NULL ){
+
+            // Notify external Client of command that we "sent"
+            if( outgoingCommandListener != NULL ){
+                outgoingCommandListener->onCommand( command );
+            }
+
+            command->setCommandId( getNextCommandId() );
+            command->setResponseRequired( true );
+            return responseBuilder->buildResponse( command );
         }
 
-        command->setCommandId( getNextCommandId() );
-        command->setResponseRequired( true );
-        return responseBuilder->buildResponse( command );
+        throw CommandIOException(
+            __FILE__, __LINE__,
+            "MockTransport::request - no response builder available" );
     }
-
-    throw CommandIOException( __FILE__, __LINE__,
-        "no response builder available" );
+    AMQ_CATCH_RETHROW( CommandIOException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
+    AMQ_CATCHALL_THROW( CommandIOException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h Sun Nov 11 08:52:45 2007
@@ -15,17 +15,19 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TANSPORT_MOCKTRANSPORT_H_
-#define ACTIVEMQ_TANSPORT_MOCKTRANSPORT_H_
+#ifndef _ACTIVEMQ_TANSPORT_MOCKTRANSPORT_H_
+#define _ACTIVEMQ_TANSPORT_MOCKTRANSPORT_H_
 
 #include <activemq/util/Config.h>
+#include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/CommandListener.h>
 #include <activemq/transport/TransportExceptionListener.h>
 #include <activemq/transport/CommandIOException.h>
+
+#include <decaf/lang/Thread.h>
 #include <decaf/util/concurrent/Concurrent.h>
 #include <decaf/util/concurrent/Mutex.h>
-#include <decaf/lang/Thread.h>
 #include <decaf/util/Queue.h>
 #include <decaf/util/concurrent/CountDownLatch.h>
 #include <decaf/util/concurrent/Concurrent.h>
@@ -57,10 +59,10 @@
          * Interface for all Protocols to implement that defines the behavior
          * of the Broker in response to messages of that protocol.
          */
-        class ResponseBuilder{
+        class ResponseBuilder {
         public:
 
-            virtual ~ResponseBuilder(){}
+            virtual ~ResponseBuilder() {}
 
             /**
              * Given a Command, check if it requires a response and return the
@@ -91,8 +93,8 @@
          */
         class InternalCommandListener :
             public CommandListener,
-            public decaf::lang::Thread
-        {
+            public decaf::lang::Thread {
+
         private:
 
             MockTransport* transport;

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.cpp Sun Nov 11 08:52:45 2007
@@ -18,37 +18,46 @@
 #include "MockTransportFactory.h"
 #include <activemq/connector/stomp/StompResponseBuilder.h>
 #include <activemq/connector/openwire/OpenWireResponseBuilder.h>
+#include <activemq/transport/Transport.h>
 #include <activemq/transport/MockTransport.h>
 #include <activemq/transport/MockTransportFactory.h>
 #include <activemq/transport/TransportFactoryMapRegistrar.h>
 
 using namespace activemq;
 using namespace activemq::transport;
+using namespace activemq::exceptions;
 using namespace decaf::util;
+using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
 Transport* MockTransportFactory::createTransport(
     const decaf::util::Properties& properties,
     Transport* next,
-    bool own ) throw ( exceptions::ActiveMQException )
-{
-    // We don't use the next here, so clean it up now.
-    if( own == true ) {
-        delete next;
-    }
+    bool own ) throw ( exceptions::ActiveMQException ) {
 
-    std::string wireFormat =
-        properties.getProperty( "wireFormat", "stomp" );
+    try{
 
-    MockTransport::ResponseBuilder* builder = NULL;
+        // We don't use the next here, so clean it up now.
+        if( own == true ) {
+            delete next;
+        }
 
-    if( wireFormat == "stomp" ) {
-        builder = new connector::stomp::StompResponseBuilder();
-    } else if( wireFormat == "openwire" ) {
-        builder = new connector::openwire::OpenWireResponseBuilder();
-    }
+        std::string wireFormat =
+            properties.getProperty( "wireFormat", "stomp" );
+
+        MockTransport::ResponseBuilder* builder = NULL;
 
-    return new MockTransport( builder, true );
+        if( wireFormat == "stomp" ) {
+            builder = new connector::stomp::StompResponseBuilder();
+        } else if( wireFormat == "openwire" ) {
+            builder = new connector::openwire::OpenWireResponseBuilder();
+        }
+
+        return new MockTransport( builder, true );
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_
-#define ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_
 
 #include <activemq/transport/TransportFactory.h>
 
@@ -30,7 +30,7 @@
     class MockTransportFactory : public TransportFactory{
     public:
 
-        virtual ~MockTransportFactory(){}
+        virtual ~MockTransportFactory() {}
 
         /**
          * Creates a Transport instance.
@@ -51,4 +51,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_MOCKTRANSPORTFACTORY_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_RESPONSE_H_
-#define ACTIVEMQ_TRANSPORT_RESPONSE_H_
+#ifndef _ACTIVEMQ_TRANSPORT_RESPONSE_H_
+#define _ACTIVEMQ_TRANSPORT_RESPONSE_H_
 
 #include <activemq/transport/Command.h>
 
@@ -50,4 +50,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_RESPONSE_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_RESPONSE_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h Sun Nov 11 08:52:45 2007
@@ -47,14 +47,11 @@
      * provide object(s) that implement the CommandReader and CommandWriter
      * interfaces.
      */
-    class Transport
-    :
-        public cms::Startable,
-        public cms::Closeable
-    {
+    class Transport : public cms::Startable,
+                      public cms::Closeable {
     public:
 
-        virtual ~Transport(){}
+        virtual ~Transport() {}
 
         /**
          * Sends a one-way command.  Does not wait for any response from the
@@ -111,4 +108,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_TRANSPORT_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TRANSPORT_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp Sun Nov 11 08:52:45 2007
@@ -18,6 +18,7 @@
 #include "TransportBuilder.h"
 
 #include <decaf/util/StringTokenizer.h>
+#include <activemq/transport/TransportFactory.h>
 #include <activemq/transport/TransportFactoryMap.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
@@ -27,17 +28,10 @@
 using namespace activemq::transport;
 using namespace decaf;
 using namespace decaf::util;
+using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportBuilder::TransportBuilder() {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-TransportBuilder::~TransportBuilder() {
-}
-
-////////////////////////////////////////////////////////////////////////////////
 Transport* TransportBuilder::buildTransport( const std::string& url,
                                              util::Properties& properties )
     throw ( cms::CMSException ) {
@@ -82,6 +76,7 @@
         return transport;
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -90,16 +85,15 @@
                                  util::Properties& properties )
     throw ( decaf::lang::exceptions::IllegalArgumentException ) {
 
-    try
-    {
+    try{
+
         StringTokenizer tokenizer( URI, ":/" );
 
         std::vector<std::string> tokens;
 
         // Require that there be three tokens at the least, these are
         // transport, url, port.
-        if( tokenizer.countTokens() < 3 )
-        {
+        if( tokenizer.countTokens() < 3 ) {
             throw decaf::lang::exceptions::IllegalArgumentException(
                 __FILE__, __LINE__,
                 (string( "TransportBuilder::parseURL - "
@@ -118,12 +112,10 @@
         // Now get all the optional parameters and store them as properties
         int count = tokenizer.toArray( tokens );
 
-        for( int i = 0; i < count; ++i )
-        {
+        for( int i = 0; i < count; ++i ) {
             tokenizer.reset( tokens[i], "=" );
 
-            if( tokenizer.countTokens() != 2 )
-            {
+            if( tokenizer.countTokens() != 2 ) {
                 throw decaf::lang::exceptions::IllegalArgumentException(
                     __FILE__, __LINE__,
                     ( string( "TransportBuilder::parseURL - "
@@ -132,7 +124,7 @@
 
             // Get them in order, passing both as nextToken calls in the
             // set Property can cause reversed order.
-            string key   = tokenizer.nextToken();
+            string key = tokenizer.nextToken();
             string value = tokenizer.nextToken();
 
             // Store this param as a property
@@ -174,5 +166,6 @@
         return transport;
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.h Sun Nov 11 08:52:45 2007
@@ -29,12 +29,11 @@
      * This class controls the creation of transports based on configuration
      * options set in a properties object.
      */
-    class TransportBuilder
-    {
+    class TransportBuilder {
     public:
 
-        TransportBuilder();
-        virtual ~TransportBuilder();
+        TransportBuilder() {}
+        virtual ~TransportBuilder() {}
 
     public:
 
@@ -50,7 +49,7 @@
          */
         virtual Transport* buildTransport( const std::string& url,
                                            decaf::util::Properties& properties )
-                                            throw ( cms::CMSException );
+                                               throw ( cms::CMSException );
 
     protected:
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportExceptionListener.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportExceptionListener.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportExceptionListener.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportExceptionListener.h Sun Nov 11 08:52:45 2007
@@ -15,10 +15,10 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_
-#define ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_
+#define _ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_
 
-#include <activemq/exceptions/ActiveMQException.h>
+#include <decaf/lang/Exception.h>
 
 namespace activemq{
 namespace transport{
@@ -41,10 +41,10 @@
          */
         virtual void onTransportException(
             Transport* source,
-            const exceptions::ActiveMQException& ex ) = 0;
+            const decaf::lang::Exception& ex ) = 0;
 
     };
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TRANSPORTEXCEPTIONLISTENER_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactory.h Sun Nov 11 08:52:45 2007
@@ -15,17 +15,18 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_
-#define ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_
 
-#include <activemq/transport/Transport.h>
-#include <decaf/util/Properties.h>
 #include <activemq/util/Config.h>
 #include <activemq/exceptions/ActiveMQException.h>
+#include <decaf/util/Properties.h>
 
 namespace activemq{
 namespace transport{
 
+    class Transport;
+
     /**
      * Defines the interface for Factories that create Transports or
      * TransportFilters.  Since Transports can be chained, the create
@@ -54,4 +55,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TRANSPORTFACTORY_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp Sun Nov 11 08:52:45 2007
@@ -17,25 +17,25 @@
 
 #include "TransportFactoryMap.h"
 #include <activemq/util/Config.h>
+#include <activemq/transport/TransportFactory.h>
 
 using namespace activemq::transport;
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactoryMap& TransportFactoryMap::getInstance()
-{
+TransportFactoryMap& TransportFactoryMap::getInstance() {
+
     // Static instance of this Map, create here so that one will
     // always exist, the one and only Connector Map.
     static TransportFactoryMap instance;
-
     return instance;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void TransportFactoryMap::registerTransportFactory(
     const std::string& name,
-    TransportFactory* factory )
-{
+    TransportFactory* factory ) {
+
     factoryMap[name] = factory;
 }
 
@@ -62,8 +62,7 @@
     map<string, TransportFactory*>::const_iterator itr =
     factoryMap.find(name);
 
-    if( itr != factoryMap.end() )
-    {
+    if( itr != factoryMap.end() ) {
         return itr->second;
     }
 
@@ -73,13 +72,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 size_t TransportFactoryMap::getFactoryNames(
-    std::vector< std::string >& factoryList )
-{
+    std::vector< std::string >& factoryList ) {
+
     map<string, TransportFactory*>::const_iterator itr =
     factoryMap.begin();
 
-    for(; itr != factoryMap.end(); ++itr)
-    {
+    for(; itr != factoryMap.end(); ++itr) {
         factoryList.insert( factoryList.end(), itr->first );
     }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h Sun Nov 11 08:52:45 2007
@@ -15,11 +15,13 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_
-#define ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_
+#define _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_
 
 #include <activemq/transport/TransportFactory.h>
+
 #include <map>
+#include <vector>
 #include <string>
 
 namespace activemq{
@@ -31,7 +33,6 @@
      * Transport.
      */
     class TransportFactoryMap{
-
     private:
 
         // Map of Factories
@@ -90,4 +91,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAP_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_
-#define ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_
+#define _ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_
 
 #include <activemq/transport/TransportFactoryMap.h>
 
@@ -27,8 +27,7 @@
      * Registers the passed in factory into the factory map, this class
      * can manage the lifetime of the registered factory (default behaviour).
      */
-    class TransportFactoryMapRegistrar
-    {
+    class TransportFactoryMapRegistrar {
     public:
 
         /**
@@ -40,32 +39,30 @@
          */
         TransportFactoryMapRegistrar( const std::string& name,
                                       TransportFactory* factory,
-                                      bool manageLifetime = true)
-        {
+                                      bool manageLifetime = true ) {
+
             // Register it in the map.
             TransportFactoryMap::getInstance().
                 registerTransportFactory( name, factory );
 
             // Store for later deletion
-            this->factory        = factory;
+            this->factory = factory;
             this->manageLifetime = manageLifetime;
-            this->name           = name;
+            this->name = name;
         }
 
-        virtual ~TransportFactoryMapRegistrar()
-        {
-            try
-            {
+        virtual ~TransportFactoryMapRegistrar() {
+
+            try {
+
                 // UnRegister it in the map.
                 TransportFactoryMap::getInstance().
                     unregisterTransportFactory( name );
 
-                if( manageLifetime )
-                {
+                if( manageLifetime ) {
                     delete factory;
                 }
-            }
-            catch(...) {}
+            } catch(...) {}
         }
 
         /**
@@ -87,4 +84,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TRANSPORTFACTORYMAPREGISTRAR_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.cpp Sun Nov 11 08:52:45 2007
@@ -38,16 +38,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 TransportFilter::~TransportFilter() {
 
-    if( own ){
-        delete next;
-        next = NULL;
+    try{
+        if( own ){
+            delete next;
+            next = NULL;
+        }
     }
+    AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void TransportFilter::onTransportException(
     Transport* source AMQCPP_UNUSED,
-    const exceptions::ActiveMQException& ex ) {
+    const decaf::lang::Exception& ex ) {
 
     fire( ex );
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h Sun Nov 11 08:52:45 2007
@@ -18,6 +18,7 @@
 #ifndef ACTIVEMQ_TRANSPORT_TRANSPORTFILTER_H_
 #define ACTIVEMQ_TRANSPORT_TRANSPORTFILTER_H_
 
+#include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/CommandListener.h>
 #include <activemq/transport/Command.h>
@@ -31,12 +32,11 @@
      * filters implement the Transport interface and
      * optionally delegate calls to another Transport object.
      */
-    class TransportFilter
-    :
+    class TransportFilter :
         public Transport,
         public CommandListener,
-        public TransportExceptionListener
-    {
+        public TransportExceptionListener {
+
     protected:
 
         /**
@@ -66,10 +66,9 @@
          * Notify the excpetion listener
          * @param ex - the exception to send to listeners
          */
-        void fire( const exceptions::ActiveMQException& ex ){
+        void fire( const decaf::lang::Exception& ex ){
 
             if( exceptionListener != NULL ){
-
                 try{
                     exceptionListener->onTransportException( this, ex );
                 }catch( ... ){}
@@ -81,7 +80,6 @@
          * @param command - the command to send to the listener
          */
         void fire( Command* command ){
-
             try{
                 if( commandlistener != NULL ){
                     commandlistener->onCommand( command );
@@ -113,7 +111,8 @@
          * @param source The source of the exception
          * @param ex The exception.
          */
-        virtual void onTransportException( Transport* source, const exceptions::ActiveMQException& ex );
+        virtual void onTransportException( Transport* source,
+                                           const decaf::lang::Exception& ex );
 
         /**
          * Sends a one-way command.  Does not wait for any response from the
@@ -124,16 +123,21 @@
          * @throws UnsupportedOperationException if this method is not implemented
          * by this transport.
          */
-        virtual void oneway( Command* command ) throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException){
+        virtual void oneway( Command* command )
+            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ){
+
             next->oneway( command );
         }
 
         /**
          * Not supported by this class - throws an exception.
          * @param command the command that is sent as a request
+         * @throws CommandIOException
          * @throws UnsupportedOperationException.
          */
-        virtual Response* request( Command* command ) throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException){
+        virtual Response* request( Command* command )
+            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ){
+
             return next->request( command );
         }
 
@@ -178,7 +182,7 @@
          * @throws CMSException if an error occurs or if this transport
          * has already been closed.
          */
-        virtual void start() throw( cms::CMSException ){
+        virtual void start() throw( cms::CMSException ) {
 
             if( commandlistener == NULL ){
                 throw exceptions::ActiveMQException( __FILE__, __LINE__,
@@ -201,7 +205,6 @@
          * @throws CMSException if errors occur.
          */
         virtual void close() throw( cms::CMSException ){
-
             next->close();
         }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.cpp Sun Nov 11 08:52:45 2007
@@ -29,15 +29,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 AsyncSendTransport::AsyncSendTransport( Transport* next, bool own )
- :  TransportFilter( next, own )
-{
+ : TransportFilter( next, own ) {
+
     this->closed = true;
     this->asyncThread = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-AsyncSendTransport::~AsyncSendTransport()
-{
+AsyncSendTransport::~AsyncSendTransport() {
     try {
         close();
     }
@@ -47,7 +46,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void AsyncSendTransport::oneway( Command* command )
-    throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
+    throw( CommandIOException,
+           decaf::lang::exceptions::UnsupportedOperationException ) {
 
     try{
 
@@ -61,6 +61,8 @@
     }
     AMQ_CATCH_RETHROW( CommandIOException )
     AMQ_CATCH_RETHROW( UnsupportedOperationException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
@@ -77,6 +79,7 @@
         next->start();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -93,36 +96,35 @@
         next->close();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void AsyncSendTransport::run()
-{
+void AsyncSendTransport::run() {
+
     try{
 
-        while( !closed )
-        {
+        while( !closed ) {
+
             Command* command = NULL;
 
-            synchronized( &msgQueue )
-            {
+            synchronized( &msgQueue ) {
+
                 // Gaurd against spurious wakeup or race to sync lock
                 // also if the listner has been unregistered we don't
                 // have anyone to notify, so we wait till a new one is
                 // registered, and then we will deliver the backlog
-                while( msgQueue.empty() )
-                {
-                    if( closed )
-                    {
+                while( msgQueue.empty() ) {
+
+                    if( closed ) {
                         break;
                     }
                     msgQueue.wait();
                 }
 
                 // don't want to process messages if we are shutting down.
-                if( closed )
-                {
+                if( closed ) {
                     return;
                 }
 
@@ -136,9 +138,7 @@
             // Destroy Our copy of the message
             delete command;
         }
-    }
-    catch(...)
-    {
+    } catch(...) {
         this->fire( ActiveMQException(
             __FILE__, __LINE__,
             "AsyncSendTransport::run - "
@@ -149,30 +149,29 @@
 ////////////////////////////////////////////////////////////////////////////////
 void AsyncSendTransport::startThread() throw ( ActiveMQException ) {
 
-    try
-    {
+    try{
+
         // Start the thread, if it's not already started.
-        if( asyncThread == NULL )
-        {
+        if( asyncThread == NULL ) {
             asyncThread = new Thread( this );
             asyncThread->start();
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AsyncSendTransport::stopThread() throw ( ActiveMQException ) {
 
-    try
-    {
+    try{
+
         // if the thread is running signal it to quit and then
         // wait for run to return so thread can die
-        if( asyncThread != NULL )
-        {
-            synchronized( &msgQueue )
-            {
+        if( asyncThread != NULL ) {
+
+            synchronized( &msgQueue ) {
                 // Force a wakeup if run is in a wait.
                 msgQueue.notifyAll();
             }
@@ -187,18 +186,19 @@
         purgeMessages();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void AsyncSendTransport::purgeMessages() throw ( ActiveMQException )
-{
-    try
-    {
-        synchronized( &msgQueue )
-        {
-            while( !msgQueue.empty() )
-            {
+void AsyncSendTransport::purgeMessages() throw ( ActiveMQException ) {
+
+    try{
+
+        synchronized( &msgQueue ) {
+
+            while( !msgQueue.empty() ) {
+
                 // destroy these messages if this is not a transacted
                 // session, if it is then the tranasction will clean
                 // the messages up.
@@ -207,5 +207,6 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.h Sun Nov 11 08:52:45 2007
@@ -66,7 +66,8 @@
          * by this transport.
          */
         virtual void oneway( Command* command )
-            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
+            throw( CommandIOException,
+                   decaf::lang::exceptions::UnsupportedOperationException );
 
         /**
          * Starts this transport object and creates the thread for

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp Sun Nov 11 08:52:45 2007
@@ -25,8 +25,8 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& AsyncSendTransportFactory::getInstance(void)
-{
+TransportFactory& AsyncSendTransportFactory::getInstance() {
+
     // Create the one and only instance of the registrar
     static TransportFactoryMapRegistrar registrar(
         "transport.filters.AsyncSendTransport",
@@ -45,5 +45,6 @@
         return new AsyncSendTransport( next, own );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.h Sun Nov 11 08:52:45 2007
@@ -30,7 +30,6 @@
      * Factory Responsible for creating the AsyncSendTransport.
      */
     class AsyncSendTransportFactory : public TransportFactory {
-
     public:
 
         virtual ~AsyncSendTransportFactory() {}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/FutureResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/FutureResponse.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/FutureResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/FutureResponse.h Sun Nov 11 08:52:45 2007
@@ -83,8 +83,7 @@
          * @throws ActiveMQException
          */
         virtual void wait( unsigned long millisecs )
-            throw( exceptions::ActiveMQException )
-        {
+            throw( exceptions::ActiveMQException ) {
             mutex.wait( millisecs );
         }
 
@@ -126,6 +125,7 @@
         virtual void setResponse( Response* response ){
             this->response = response;
         }
+
     };
 
 }}}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp Sun Nov 11 08:52:45 2007
@@ -19,9 +19,13 @@
 
 using namespace std;
 using namespace activemq;
+using namespace activemq::exceptions;
 using namespace activemq::transport;
 using namespace activemq::transport::filters;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
 
+////////////////////////////////////////////////////////////////////////////////
 LOGDECAF_INITIALIZE( logger, LoggingTransport, "activemq.transport.filters.LoggingTransport")
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -60,7 +64,8 @@
         TransportFilter::oneway( command );
     }
     AMQ_CATCH_RETHROW( CommandIOException )
-    AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
@@ -84,6 +89,7 @@
         return response;
     }
     AMQ_CATCH_RETHROW( CommandIOException )
-    AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h Sun Nov 11 08:52:45 2007
@@ -28,8 +28,7 @@
     /**
      * A transport filter that logs commands as they are sent/received.
      */
-    class LoggingTransport : public TransportFilter
-    {
+    class LoggingTransport : public TransportFilter {
     private:
 
         LOGDECAF_DECLARE( logger )
@@ -61,7 +60,8 @@
          * by this transport.
          */
         virtual void oneway( Command* command )
-            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException);
+            throw( CommandIOException,
+                   decaf::lang::exceptions::UnsupportedOperationException);
 
         /**
          * Not supported by this class - throws an exception.
@@ -69,7 +69,8 @@
          * @throws UnsupportedOperationException.
          */
         virtual Response* request( Command* command )
-            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException);
+            throw( CommandIOException,
+                   decaf::lang::exceptions::UnsupportedOperationException);
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp Sun Nov 11 08:52:45 2007
@@ -19,14 +19,15 @@
 
 #include <activemq/transport/filters/LoggingTransport.h>
 
+using namespace decaf::lang;
 using namespace activemq;
 using namespace activemq::transport;
 using namespace activemq::transport::filters;
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& LoggingTransportFactory::getInstance(void)
-{
+TransportFactory& LoggingTransportFactory::getInstance() {
+
     // Create the one and only instance of the registrar
     static TransportFactoryMapRegistrar registrar(
         "transport.filters.LoggingTransport",
@@ -45,5 +46,6 @@
         return new LoggingTransport( next, own );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h Sun Nov 11 08:52:45 2007
@@ -30,7 +30,6 @@
      * Factory Responsible for creating the LoggingTransport.
      */
     class LoggingTransportFactory : public TransportFactory {
-
     public:
 
         virtual ~LoggingTransportFactory() {}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp Sun Nov 11 08:52:45 2007
@@ -20,6 +20,9 @@
 using namespace activemq;
 using namespace activemq::transport;
 using namespace activemq::transport::filters;
+using namespace activemq::exceptions;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int ResponseCorrelator::getNextCommandId()
@@ -36,6 +39,7 @@
         return 0;
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
@@ -88,9 +92,10 @@
 
         next->oneway( command );
     }
-    AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
     AMQ_CATCH_RETHROW( CommandIOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
@@ -150,9 +155,10 @@
 
         return response;
     }
-    AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
+    AMQ_CATCH_RETHROW( UnsupportedOperationException )
     AMQ_CATCH_RETHROW( CommandIOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
@@ -202,42 +208,53 @@
 ////////////////////////////////////////////////////////////////////////////////
 void ResponseCorrelator::start() throw( cms::CMSException ) {
 
-    /**
-     * We're already started.
-     */
-    if( !closed ){
-        return;
-    }
+    try{
 
-    if( commandlistener == NULL ){
-        throw exceptions::ActiveMQException( __FILE__, __LINE__,
-            "commandListener is invalid" );
-    }
+        /**
+         * We're already started.
+         */
+        if( !closed ){
+            return;
+        }
 
-    if( exceptionListener == NULL ){
-        throw exceptions::ActiveMQException( __FILE__, __LINE__,
-            "exceptionListener is invalid" );
-    }
+        if( commandlistener == NULL ){
+            throw exceptions::ActiveMQException( __FILE__, __LINE__,
+                "commandListener is invalid" );
+        }
 
-    if( next == NULL ){
-        throw exceptions::ActiveMQException( __FILE__, __LINE__,
-            "next transport is NULL" );
-    }
+        if( exceptionListener == NULL ){
+            throw exceptions::ActiveMQException( __FILE__, __LINE__,
+                "exceptionListener is invalid" );
+        }
 
-    // Start the delegate transport object.
-    next->start();
+        if( next == NULL ){
+            throw exceptions::ActiveMQException( __FILE__, __LINE__,
+                "next transport is NULL" );
+        }
+
+        // Start the delegate transport object.
+        next->start();
 
-    // Mark it as open.
-    closed = false;
+        // Mark it as open.
+        closed = false;
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void ResponseCorrelator::close() throw( cms::CMSException ){
 
-    if( !closed && next != NULL ){
-        next->close();
-    }
+    try{
 
-    closed = true;
-}
+        if( !closed && next != NULL ){
+            next->close();
+        }
 
+        closed = true;
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
+}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.h Sun Nov 11 08:52:45 2007
@@ -36,8 +36,7 @@
      * are simply sent directly to the CommandListener.  It owns
      * the transport that it
      */
-    class ResponseCorrelator : public TransportFilter
-    {
+    class ResponseCorrelator : public TransportFilter {
     private:
 
         /**
@@ -110,7 +109,8 @@
          * by this transport.
          */
         virtual void oneway( Command* command )
-            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
+            throw( CommandIOException,
+                   decaf::lang::exceptions::UnsupportedOperationException );
 
         /**
          * Sends the given request to the server and waits for the response.
@@ -119,7 +119,8 @@
          * @throws CommandIOException if an error occurs with the request.
          */
         virtual Response* request( Command* command )
-            throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
+            throw( CommandIOException,
+                   decaf::lang::exceptions::UnsupportedOperationException );
 
         /**
          * This is called in the context of the nested transport's

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp Sun Nov 11 08:52:45 2007
@@ -28,7 +28,7 @@
 using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& ResponseCorrelatorFactory::getInstance(void)
+TransportFactory& ResponseCorrelatorFactory::getInstance()
 {
     // Create the one and only instance of the registrar
     static TransportFactoryMapRegistrar registrar(
@@ -56,5 +56,6 @@
         return transport;
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h Sun Nov 11 08:52:45 2007
@@ -30,7 +30,6 @@
      * Factory Responsible for creating the ResponseCorrelator.
      */
     class ResponseCorrelatorFactory : public TransportFactory {
-
     public:
 
         virtual ~ResponseCorrelatorFactory() {}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp Sun Nov 11 08:52:45 2007
@@ -44,8 +44,8 @@
     bufferedInputStream( NULL ),
     bufferedOutputStream( NULL )
 {
-    try
-    {
+    try{
+
         if( !properties.hasProperty( "transport.uri" ) ) {
             throw ActiveMQException(
                 __FILE__, __LINE__,
@@ -90,14 +90,15 @@
         ioTransport->setOutputStream( bufferedOutputStream );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_RETHROW( Exception )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TcpTransport::~TcpTransport()
-{
-    try
-    {
+TcpTransport::~TcpTransport() {
+
+    try{
+
         try{
             close();
         } catch( cms::CMSException& ex ){ /* Absorb */ }
@@ -128,6 +129,7 @@
         }
     }
     AMQ_CATCH_NOTHROW( ActiveMQException )
+    AMQ_CATCH_NOTHROW( Exception )
     AMQ_CATCHALL_NOTHROW()
 }
 
@@ -146,5 +148,6 @@
     }
     AMQ_CATCH_RETHROW( SocketException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, SocketException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, SocketException )
     AMQ_CATCHALL_THROW( SocketException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h Sun Nov 11 08:52:45 2007
@@ -36,8 +36,7 @@
      * level transport should take care of manaing stream reads
      * and writes.
      */
-    class TcpTransport : public TransportFilter
-    {
+    class TcpTransport : public TransportFilter {
     private:
 
         /**

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp Sun Nov 11 08:52:45 2007
@@ -23,9 +23,10 @@
 using namespace activemq::transport;
 using namespace activemq::transport::filters;
 using namespace activemq::exceptions;
+using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& TcpTransportFactory::getInstance(void)
+TransportFactory& TcpTransportFactory::getInstance()
 {
     // Create the one and only instance of the registrar
     static TransportFactoryMapRegistrar registrar(
@@ -44,5 +45,6 @@
         return new TcpTransport( properties, next, own );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h Sun Nov 11 08:52:45 2007
@@ -30,8 +30,7 @@
     /**
      * Factory Responsible for creating the TcpTransport.
      */
-    class TcpTransportFactory : public TransportFactory
-    {
+    class TcpTransportFactory : public TransportFactory {
     public:
 
         virtual ~TcpTransportFactory() {}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h Sun Nov 11 08:52:45 2007
@@ -80,7 +80,7 @@
          */
         virtual std::string getProperty( const std::string& name,
                                          const std::string& defaultValue ) const {
-            return properties.getProperty(name,defaultValue);
+            return properties.getProperty( name,defaultValue );
         }
 
         /**
@@ -91,7 +91,7 @@
          */
         virtual void setProperty( const std::string& name,
                                   const std::string& value ){
-            properties.setProperty(name,value);
+            properties.setProperty( name,value );
         }
 
         /**
@@ -99,8 +99,7 @@
          * @param name - property name to check for in this properties set.
          * @return true if property exists, false otherwise.
          */
-        virtual bool hasProperty( const std::string& name ) const
-        {
+        virtual bool hasProperty( const std::string& name ) const {
             return properties.hasProperty(name);
         }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.cpp Sun Nov 11 08:52:45 2007
@@ -29,6 +29,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 long long LongSequenceGenerator::getNextSequenceId() {
+
     synchronized( &mutex ) {
         return this->lastSequenceId++;
     }
@@ -38,6 +39,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 long long LongSequenceGenerator::getLastSequenceId() {
+
     synchronized( &mutex ) {
         return this->lastSequenceId;
     }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h Sun Nov 11 08:52:45 2007
@@ -26,7 +26,7 @@
 
     /**
      * This class is used to generate a sequence of long long values that
-     * is incremented each time a new value is requested.  This class is
+     * are incremented each time a new value is requested.  This class is
      * thread safe so the ids can be requested in different threads safely.
      */
     class LongSequenceGenerator {

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp Sun Nov 11 08:52:45 2007
@@ -26,8 +26,7 @@
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
-PrimitiveMap::PrimitiveMap()
-{
+PrimitiveMap::PrimitiveMap(){
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -36,13 +35,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-PrimitiveMap::~PrimitiveMap()
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveMap::equals( const PrimitiveMap& src ) const {
-
     return this->valueNodeMap.equals( src.valueNodeMap );
 }
 
@@ -66,31 +59,26 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::copy( const PrimitiveMap& src ) {
-
     return this->valueNodeMap.copy( src.valueNodeMap );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMap::clear() {
-
     valueNodeMap.clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveMap::contains( const string& key ) const{
-
     return valueNodeMap.containsKey( key );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 std::size_t PrimitiveMap::size() const{
-
     return valueNodeMap.size();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveMap::isEmpty() const{
-
     return valueNodeMap.isEmpty();
 }
 
@@ -113,7 +101,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 unsigned char PrimitiveMap::getByte( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getByte();
@@ -129,7 +117,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 char PrimitiveMap::getChar( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getChar();
@@ -145,7 +133,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 short PrimitiveMap::getShort( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getShort();
@@ -161,7 +149,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 int PrimitiveMap::getInt( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getInt();
@@ -177,7 +165,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 long long PrimitiveMap::getLong( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getLong();
@@ -193,7 +181,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 double PrimitiveMap::getDouble( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getDouble();
@@ -209,7 +197,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 float PrimitiveMap::getFloat( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getFloat();
@@ -225,7 +213,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 string PrimitiveMap::getString( const string& key ) const
-    throw(NoSuchElementException){
+    throw( NoSuchElementException ){
 
     ValueNode node = valueNodeMap.getValue( key );
     return node.getString();

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h Sun Nov 11 08:52:45 2007
@@ -373,7 +373,7 @@
     public:
 
         PrimitiveMap();
-        virtual ~PrimitiveMap();
+        virtual ~PrimitiveMap() {}
 
         /**
          * Copy Constructor
@@ -426,39 +426,39 @@
         virtual bool isEmpty() const;
 
         virtual bool getBool( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setBool( const std::string& key, bool value );
 
         virtual unsigned char getByte( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setByte( const std::string& key, unsigned char value );
 
         virtual char getChar( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setChar( const std::string& key, char value );
 
         virtual short getShort( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setShort( const std::string& key, short value );
 
         virtual int getInt( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setInt( const std::string& key, int value );
 
         virtual long long getLong( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setLong( const std::string& key, long long value );
 
         virtual double getDouble( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setDouble( const std::string& key, double value );
 
         virtual float getFloat( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setFloat( const std::string& key, float value );
 
         virtual std::string getString( const std::string& key ) const
-            throw(decaf::lang::exceptions::NoSuchElementException);
+            throw( decaf::lang::exceptions::NoSuchElementException );
         virtual void setString( const std::string& key, const std::string& value );
 
         virtual std::vector<unsigned char> getByteArray( const std::string& key ) const

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.cpp Sun Nov 11 08:52:45 2007
@@ -25,12 +25,13 @@
 using namespace activemq;
 using namespace activemq::util;
 using namespace decaf::util;
+using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 Properties URISupport::parseQuery( std::string query )
-    throw ( IllegalArgumentException )
-{
+    throw ( IllegalArgumentException ) {
+
     try {
 
         Properties options;
@@ -38,7 +39,7 @@
         return options;
     }
     AMQ_CATCH_RETHROW( IllegalArgumentException )
-    AMQ_CATCH_EXCEPTION_CONVERT( NoSuchElementException, IllegalArgumentException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
     AMQ_CATCHALL_THROW( IllegalArgumentException )
 }
 
@@ -98,6 +99,6 @@
         }
     }
     AMQ_CATCH_RETHROW( IllegalArgumentException )
-    AMQ_CATCH_EXCEPTION_CONVERT( NoSuchElementException, IllegalArgumentException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
     AMQ_CATCHALL_THROW( IllegalArgumentException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h Sun Nov 11 08:52:45 2007
@@ -24,8 +24,7 @@
 namespace activemq{
 namespace util{
 
-    class URISupport
-    {
+    class URISupport {
     public:
 
         virtual ~URISupport();

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatFactory.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatFactory.h Sun Nov 11 08:52:45 2007
@@ -31,8 +31,7 @@
      * the properties that are set in the passed <code>Properties</code>
      * object.
      */
-    class WireFormatFactory
-    {
+    class WireFormatFactory {
     public:
 
         virtual ~WireFormatFactory() {}

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp Sun Nov 11 08:52:45 2007
@@ -44,36 +44,36 @@
     myMessage.writeUnsignedShort( 65535 );
     myMessage.writeDouble( 0.5622154 );
     myMessage.writeUTF( "This is a UTF String" );
-    
+
     try{
         myMessage.readInt();
         CPPUNIT_ASSERT( false );
     } catch(...) {}
-    
+
     myMessage.writeDouble( 1.012 );
     myMessage.writeFloat( 10.000005f );
     myMessage.writeInt( 15645646 );
     myMessage.writeLong( 0xFFFAAA999LL );
     myMessage.writeString( "This is a test String" );
 
-    CPPUNIT_ASSERT( myMessage.getBodyLength() != 0 );
-
-    // Get ready to read
-    myMessage.reset();
-
-    CPPUNIT_ASSERT( myMessage.readBoolean() == false );
-    CPPUNIT_ASSERT( myMessage.readByte() == 127 );
-    CPPUNIT_ASSERT( myMessage.readShort() == 32767 );
-    CPPUNIT_ASSERT( myMessage.readUnsignedShort() == 65535 );
-    CPPUNIT_ASSERT( myMessage.readDouble() == 0.5622154 );
-    CPPUNIT_ASSERT( myMessage.readUTF() == "This is a UTF String" );    
-    CPPUNIT_ASSERT( myMessage.readDouble() == 1.012 );
-    CPPUNIT_ASSERT( myMessage.readFloat() == 10.000005f );
-    CPPUNIT_ASSERT( myMessage.readInt() == 15645646 );
-    CPPUNIT_ASSERT( myMessage.readLong() == 0xFFFAAA999ULL );
-    CPPUNIT_ASSERT( myMessage.readString() == "This is a test String" );
-
-    myMessage.clearBody();
-
-    CPPUNIT_ASSERT( myMessage.getBodyLength() == 0 );
+//    CPPUNIT_ASSERT( myMessage.getBodyLength() != 0 );
+//
+//    // Get ready to read
+//    myMessage.reset();
+//
+//    CPPUNIT_ASSERT( myMessage.readBoolean() == false );
+//    CPPUNIT_ASSERT( myMessage.readByte() == 127 );
+//    CPPUNIT_ASSERT( myMessage.readShort() == 32767 );
+//    CPPUNIT_ASSERT( myMessage.readUnsignedShort() == 65535 );
+//    CPPUNIT_ASSERT( myMessage.readDouble() == 0.5622154 );
+//    CPPUNIT_ASSERT( myMessage.readUTF() == "This is a UTF String" );
+//    CPPUNIT_ASSERT( myMessage.readDouble() == 1.012 );
+//    CPPUNIT_ASSERT( myMessage.readFloat() == 10.000005f );
+//    CPPUNIT_ASSERT( myMessage.readInt() == 15645646 );
+//    CPPUNIT_ASSERT( myMessage.readLong() == 0xFFFAAA999ULL );
+//    CPPUNIT_ASSERT( myMessage.readString() == "This is a test String" );
+//
+//    myMessage.clearBody();
+//
+//    CPPUNIT_ASSERT( myMessage.getBodyLength() == 0 );
 }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp Sun Nov 11 08:52:45 2007
@@ -28,8 +28,8 @@
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
-void StompSessionManagerTest::testSessions()
-{
+void StompSessionManagerTest::testSessions() {
+
     SessionInfo* info1 = manager->createSession( cms::Session::AUTO_ACKNOWLEDGE );
     CPPUNIT_ASSERT( info1->getAckMode() == cms::Session::AUTO_ACKNOWLEDGE );
     CPPUNIT_ASSERT( info1->getConnectionId() == connectionId );
@@ -324,6 +324,10 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void StompSessionManagerTest::setUp() {
+
+    this->manager = NULL;
+    this->connector = NULL;
+    this->transport = NULL;
 
     this->connectionId = "testConnectionId";
 



Mime
View raw message