activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r593929 [5/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/connector/stomp/commands/BytesMessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h Sun Nov 11 08:52:45 2007
@@ -38,8 +38,7 @@
      * class StompMessage to implement all cms::Message type functionality
      * and implements the BytesMessage interface here.
      */
-    class BytesMessageCommand : public StompMessage< cms::BytesMessage >
-    {
+    class BytesMessageCommand : public StompMessage< cms::BytesMessage > {
     private:
 
         /**
@@ -79,8 +78,8 @@
         BytesMessageCommand() :
             StompMessage< cms::BytesMessage >(),
             dataInputStream(&inputStream),
-            dataOutputStream(&outputStream)
-        {
+            dataOutputStream(&outputStream) {
+
             initialize( getFrame() );
             clearBody();
         }
@@ -92,8 +91,8 @@
         BytesMessageCommand( StompFrame* frame ) :
             StompMessage< cms::BytesMessage >( frame ),
             dataInputStream(&inputStream),
-            dataOutputStream(&outputStream)
-        {
+            dataOutputStream(&outputStream) {
+
             validate( getFrame() );
             reset();
         }
@@ -130,18 +129,21 @@
          * @throws MarshalException if the command is not
          * in a state that can be marshaled.
          */
-        virtual const StompFrame& marshal()
-            throw (marshal::MarshalException)
-        {
-            // Before we send out the frame tag it with the content length
-            // as this is a bytes message and we can't ensure we have only
-            // a trailing NULL.
-            setPropertyValue(
-                CommandConstants::toString(
-                    CommandConstants::HEADER_CONTENTLENGTH),
-                    decaf::lang::Long::toString( getFrame().getBodyLength() ) );
+        virtual const StompFrame& marshal() throw ( marshal::MarshalException ) {
+
+            try{
+                // Before we send out the frame tag it with the content length
+                // as this is a bytes message and we can't ensure we have only
+                // a trailing NULL.
+                setPropertyValue(
+                    CommandConstants::toString(
+                        CommandConstants::HEADER_CONTENTLENGTH),
+                        decaf::lang::Long::toString( getFrame().getBodyLength() ) );
 
-            return StompMessage<cms::BytesMessage>::marshal();
+                return StompMessage<cms::BytesMessage>::marshal();
+            }
+            AMQ_CATCH_RETHROW( marshal::MarshalException )
+            AMQ_CATCHALL_THROW( marshal::MarshalException )
         }
 
         /**
@@ -212,8 +214,13 @@
          * @throws CMSException
          */
         virtual bool readBoolean() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readBoolean();
+            try{
+                checkReadOnly();
+                return dataInputStream.readBoolean();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -224,8 +231,13 @@
          * @throws CMSException
          */
         virtual void writeBoolean( bool value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeBoolean( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeBoolean( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -234,8 +246,13 @@
          * @throws CMSException
          */
         virtual unsigned char readByte() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readByte();
+            try{
+                checkReadOnly();
+                return dataInputStream.readByte();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -244,8 +261,13 @@
          * @throws CMSException
          */
         virtual void writeByte( unsigned char value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeByte( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeByte( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -269,8 +291,13 @@
          */
         virtual std::size_t readBytes( std::vector<unsigned char>& value ) const
             throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.read( value );
+            try{
+                checkReadOnly();
+                return dataInputStream.read( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -281,8 +308,13 @@
          */
         virtual void writeBytes( const std::vector<unsigned char>& value )
             throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.write( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.write( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -313,8 +345,13 @@
         virtual std::size_t readBytes( unsigned char*& buffer, std::size_t length ) const
             throw ( cms::CMSException )
         {
-            checkReadOnly();
-            return dataInputStream.read( buffer, 0, length );
+            try{
+                checkReadOnly();
+                return dataInputStream.read( buffer, 0, length );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -328,8 +365,13 @@
         virtual void writeBytes( const unsigned char* value,
                                  std::size_t offset,
                                  std::size_t length ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.write( value, offset, length );
+            try{
+                checkWriteOnly();
+                dataOutputStream.write( value, offset, length );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -338,8 +380,13 @@
          * @throws CMSException
          */
         virtual char readChar() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readChar();
+            try{
+                checkReadOnly();
+                return dataInputStream.readChar();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -348,8 +395,13 @@
          * @throws CMSException
          */
         virtual void writeChar( char value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeChar( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeChar( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -358,8 +410,13 @@
          * @throws CMSException
          */
         virtual float readFloat() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readFloat();
+            try{
+                checkReadOnly();
+                return dataInputStream.readFloat();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -368,8 +425,13 @@
          * @throws CMSException
          */
         virtual void writeFloat( float value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeFloat( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeFloat( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -378,8 +440,13 @@
          * @throws CMSException
          */
         virtual double readDouble() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readDouble();
+            try{
+                checkReadOnly();
+                return dataInputStream.readDouble();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -388,8 +455,13 @@
          * @throws CMSException
          */
         virtual void writeDouble( double value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeDouble( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeDouble( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -398,8 +470,13 @@
          * @throws CMSException
          */
         virtual short readShort() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readShort();
+            try{
+                checkReadOnly();
+                return dataInputStream.readShort();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -408,8 +485,13 @@
          * @throws CMSException
          */
         virtual void writeShort( short value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeShort( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeShort( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -418,8 +500,13 @@
          * @throws CMSException
          */
         virtual unsigned short readUnsignedShort() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readUnsignedShort();
+            try{
+                checkReadOnly();
+                return dataInputStream.readUnsignedShort();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -428,8 +515,13 @@
          * @throws CMSException
          */
         virtual void writeUnsignedShort( unsigned short value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeUnsignedShort( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeUnsignedShort( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -438,8 +530,13 @@
          * @throws CMSException
          */
         virtual int readInt() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readInt();
+            try{
+                checkReadOnly();
+                return dataInputStream.readInt();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -448,8 +545,13 @@
          * @throws CMSException
          */
         virtual void writeInt( int value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeInt( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeInt( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -458,8 +560,13 @@
          * @throws CMSException
          */
         virtual long long readLong() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readLong();
+            try{
+                checkReadOnly();
+                return dataInputStream.readLong();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -468,8 +575,13 @@
          * @throws CMSException
          */
         virtual void writeLong( long long value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeLong( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeLong( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -478,8 +590,13 @@
          * @throws CMSException
          */
         virtual std::string readString() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readString();
+            try{
+                checkReadOnly();
+                return dataInputStream.readString();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -488,8 +605,13 @@
          * @throws CMSException
          */
         virtual void writeString( const std::string& value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeChars( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeChars( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -498,8 +620,13 @@
          * @throws CMSException
          */
         virtual std::string readUTF() const throw ( cms::CMSException ){
-            checkReadOnly();
-            return dataInputStream.readUTF();
+            try{
+                checkReadOnly();
+                return dataInputStream.readUTF();
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -508,8 +635,13 @@
          * @throws CMSException
          */
         virtual void writeUTF( const std::string& value ) throw ( cms::CMSException ){
-            checkWriteOnly();
-            dataOutputStream.writeUTF( value );
+            try{
+                checkWriteOnly();
+                dataOutputStream.writeUTF( value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
     protected:
@@ -518,7 +650,7 @@
          * Throws an exception if not in write-only mode.
          * @throws CMSException.
          */
-        void checkWriteOnly() const throw (cms::CMSException){
+        void checkWriteOnly() const throw ( cms::CMSException ){
             if( readOnly ){
                 throw activemq::exceptions::ActiveMQException( __FILE__, __LINE__,
                     "message is in read-only mode and cannot be written to" );
@@ -529,7 +661,7 @@
          * Throws an exception if not in read-only mode.
          * @throws CMSException
          */
-        void checkReadOnly() const throw (cms::CMSException){
+        void checkReadOnly() const throw ( cms::CMSException ){
             if( !readOnly ){
                 throw activemq::exceptions::ActiveMQException( __FILE__, __LINE__,
                     "message is in write-only mode and cannot be read from" );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp Sun Nov 11 08:52:45 2007
@@ -120,19 +120,14 @@
 cms::Destination* CommandConstants::toDestination( const std::string& dest )
     throw ( decaf::lang::exceptions::IllegalArgumentException )
 {
-    std::size_t qpos = dest.find(queuePrefix);
-    std::size_t tpos = dest.find(topicPrefix);
+    std::size_t qpos = dest.find( queuePrefix );
+    std::size_t tpos = dest.find( topicPrefix );
 
-    if(tpos == 0)
-    {
+    if( tpos == 0 ) {
         return new StompTopic(dest.substr(strlen(topicPrefix)));
-    }
-    else if(qpos == 0)
-    {
+    } else if( qpos == 0 ) {
         return new StompQueue(dest.substr(strlen(queuePrefix)));
-    }
-    else
-    {
+    } else {
         throw IllegalArgumentException(
             __FILE__, __LINE__,
             "CommandConstants::toDestination - Not a valid Stomp Dest [%s]", dest.c_str());

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h Sun Nov 11 08:52:45 2007
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_
 
 #include <cms/Destination.h>
 #include <decaf/lang/exceptions/IllegalArgumentException.h>
@@ -202,4 +202,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommitCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommitCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommitCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommitCommand.h Sun Nov 11 08:52:45 2007
@@ -31,8 +31,7 @@
     /**
      * Commits a Transaction.
      */
-    class CommitCommand  : public AbstractCommand< transport::Command >
-    {
+    class CommitCommand  : public AbstractCommand< transport::Command > {
     public:
 
         CommitCommand() :
@@ -62,8 +61,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::COMMIT ) );
         }
@@ -74,14 +72,13 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
             if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::COMMIT )) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_TRANSACTIONID ) ) ) )
-            {
+                        CommandConstants::HEADER_TRANSACTIONID ) ) ) ) {
+
                 return true;
             }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -30,8 +30,7 @@
     /**
      * Message sent to the broker to connect.
      */
-    class ConnectCommand : public AbstractCommand< transport::Command >
-    {
+    class ConnectCommand : public AbstractCommand< transport::Command > {
     public:
 
         ConnectCommand() :
@@ -44,7 +43,7 @@
                 validate( getFrame() );
         }
 
-        virtual ~ConnectCommand() {};
+        virtual ~ConnectCommand() {}
 
         /**
          * Clone the StompCommand and return the new copy.
@@ -114,7 +113,7 @@
         virtual const char* getClientId() const{
             return getPropertyValue(
                 CommandConstants::toString(
-                    CommandConstants::HEADER_CLIENT_ID) );
+                    CommandConstants::HEADER_CLIENT_ID ) );
         }
 
         /**
@@ -124,7 +123,7 @@
         virtual void setClientId( const std::string& clientId ){
             setPropertyValue(
                 CommandConstants::toString(
-                    CommandConstants::HEADER_CLIENT_ID) ,
+                    CommandConstants::HEADER_CLIENT_ID ),
                 clientId );
         }
 
@@ -135,8 +134,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::CONNECT ) );
         }
@@ -147,11 +145,9 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if(frame.getCommand() ==
-               CommandConstants::toString( CommandConstants::CONNECT ) )
-            {
+        virtual bool validate( const StompFrame& frame ) const {
+            if( frame.getCommand() ==
+                CommandConstants::toString( CommandConstants::CONNECT ) ) {
                 return true;
             }
 
@@ -162,4 +158,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectedCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectedCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectedCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_
-#define ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_
+#ifndef _ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_
+#define _ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -31,8 +31,7 @@
      * The stomp command returned from the broker indicating
      * a connection has been established.
      */
-    class ConnectedCommand : public AbstractCommand< transport::Command >
-    {
+    class ConnectedCommand : public AbstractCommand< transport::Command > {
     public:
 
         ConnectedCommand() :
@@ -67,7 +66,7 @@
         virtual const char* getSessionId() const {
             return getPropertyValue(
                 CommandConstants::toString(
-                    CommandConstants::HEADER_SESSIONID) );
+                    CommandConstants::HEADER_SESSIONID ) );
         }
 
         /**
@@ -77,7 +76,7 @@
         virtual void setSessionId( const std::string& session ) {
             setPropertyValue(
                 CommandConstants::toString(
-                    CommandConstants::HEADER_SESSIONID),
+                    CommandConstants::HEADER_SESSIONID ),
                 session );
         }
 
@@ -88,8 +87,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::CONNECTED ) );
         }
@@ -100,11 +98,10 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if(frame.getCommand() ==
-               CommandConstants::toString( CommandConstants::CONNECTED ) )
-            {
+        virtual bool validate( const StompFrame& frame ) const {
+            if( frame.getCommand() ==
+                CommandConstants::toString( CommandConstants::CONNECTED ) ) {
+
                 return true;
             }
 
@@ -115,4 +112,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_*/
+#endif /*_ACTIVEMQ_COMMAND_STOMP_COMMANDS_CONNECTEDCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/DisconnectCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/DisconnectCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/DisconnectCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/DisconnectCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -31,8 +31,7 @@
      * Sent to the broker to disconnect gracefully before closing
      * the transport.
      */
-    class DisconnectCommand : public AbstractCommand< transport::Command >
-    {
+    class DisconnectCommand : public AbstractCommand< transport::Command > {
     public:
 
         DisconnectCommand() :
@@ -62,8 +61,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::DISCONNECT ) );
         }
@@ -74,11 +72,10 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
-            if(frame.getCommand() ==
-               CommandConstants::toString( CommandConstants::DISCONNECT ) )
-            {
+        virtual bool validate( const StompFrame& frame ) const {
+            if( frame.getCommand() ==
+                CommandConstants::toString( CommandConstants::DISCONNECT ) ) {
+
                 return true;
             }
 
@@ -89,6 +86,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_*/
-
-
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_DISCONNECTCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ErrorCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ErrorCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ErrorCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ErrorCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -45,7 +45,7 @@
                 validate( getFrame() );
         }
 
-        virtual ~ErrorCommand() {};
+        virtual ~ErrorCommand() {}
 
         /**
          * Clone the StompCommand and return the new copy.
@@ -105,8 +105,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::ERROR_CMD ) );
         }
@@ -117,15 +116,14 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
             if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::ERROR_CMD ) ) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_MESSAGE ) ) ) )
-            {
-                return true;
+                        CommandConstants::HEADER_MESSAGE ) ) ) ) {
+                
+            	return true;
             }
 
             return false;
@@ -135,4 +133,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ERRORCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/MessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/MessageCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/MessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/MessageCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
 
 #include <cms/Message.h>
 #include <activemq/connector/stomp/commands/StompMessage.h>
@@ -31,8 +31,7 @@
      * Message command which represents a ActiveMQMessage with no body
      * can be sent or recieved.
      */
-    class MessageCommand : public StompMessage< cms::Message >
-    {
+    class MessageCommand : public StompMessage< cms::Message > {
     public:
 
         MessageCommand() :
@@ -73,4 +72,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ReceiptCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ReceiptCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ReceiptCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ReceiptCommand.h Sun Nov 11 08:52:45 2007
@@ -31,8 +31,7 @@
      * Message sent from the Broker when a receipt is requested
      * for messages that are sent.
      */
-    class ReceiptCommand : public AbstractCommand< transport::Response >
-    {
+    class ReceiptCommand : public AbstractCommand< transport::Response > {
     public:
 
         ReceiptCommand() :
@@ -45,7 +44,7 @@
                 validate( getFrame() );
         }
 
-        virtual ~ReceiptCommand(void) {}
+        virtual ~ReceiptCommand() {}
 
         /**
          * Clone the StompCommand and return the new copy.
@@ -72,8 +71,7 @@
         virtual void setReceiptId( const std::string& id ){
             setPropertyValue(
                 CommandConstants::toString(
-                    CommandConstants::HEADER_RECEIPTID ),
-                id );
+                    CommandConstants::HEADER_RECEIPTID ), id );
         }
 
     protected:
@@ -83,8 +81,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::RECEIPT ) );
         }
@@ -95,14 +92,13 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
             if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::RECEIPT )) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_RECEIPTID ) ) ) )
-            {
+                        CommandConstants::HEADER_RECEIPTID ) ) ) ) {
+
                 return true;
             }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h Sun Nov 11 08:52:45 2007
@@ -27,8 +27,7 @@
 namespace stomp{
 namespace commands{
 
-    class StompCommand : public marshal::Marshalable
-    {
+    class StompCommand : public marshal::Marshalable {
     protected:
 
         /**

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h Sun Nov 11 08:52:45 2007
@@ -23,6 +23,7 @@
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/transport/Command.h>
 #include <activemq/connector/stomp/StompTopic.h>
+#include <activemq/exceptions/ActiveMQException.h>
 
 #include <decaf/lang/exceptions/IllegalArgumentException.h>
 #include <decaf/lang/exceptions/NoSuchElementException.h>
@@ -79,8 +80,8 @@
             AbstractCommand< transport::Command >( frame ),
             ackHandler( NULL ),
             dest( NULL ),
-            replyTo( NULL )
-        {
+            replyTo( NULL ) {
+
             const std::string& destHeader = CommandConstants::toString(
                 CommandConstants::HEADER_DESTINATION );
             const std::string& replyToHeader = CommandConstants::toString(
@@ -171,87 +172,171 @@
 
         virtual bool getBooleanProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            std::string value = getStrictPropertyValue<std::string>( name );
-            return value == "true";
+
+            try{
+                std::string value = getStrictPropertyValue<std::string>( name );
+                return value == "true";
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual unsigned char getByteProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<unsigned char>(name);
+
+            try{
+                return getStrictPropertyValue<unsigned char>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual double getDoubleProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<double>(name);
+            try{
+                return getStrictPropertyValue<double>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual float getFloatProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<float>(name);
+            try{
+                return getStrictPropertyValue<float>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual int getIntProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<int>(name);
+            try{
+                return getStrictPropertyValue<int>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual long long getLongProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<long long>(name);
+            try{
+                return getStrictPropertyValue<long long>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual short getShortProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<short>(name);
+            try{
+                return getStrictPropertyValue<short>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual std::string getStringProperty( const std::string& name ) const
             throw( cms::CMSException ){
-            return getStrictPropertyValue<std::string>(name);
+            try{
+                return getStrictPropertyValue<std::string>(name);
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setBooleanProperty( const std::string& name,
             bool value ) throw( cms::CMSException ){
-            testProperty( name );
 
-            std::string strvalue = value? "true" : "false";
-            setPropertyValue( name, strvalue );
+            try{
+                testProperty( name );
+
+                std::string strvalue = value? "true" : "false";
+                setPropertyValue( name, strvalue );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setByteProperty( const std::string& name,
             unsigned char value ) throw( cms::CMSException ){
-            setStrictPropertyValue<unsigned char>( name, value );
+
+            try{
+                setStrictPropertyValue<unsigned char>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setDoubleProperty( const std::string& name,
             double value ) throw( cms::CMSException ){
-            setStrictPropertyValue<double>( name, value );
+            try{
+                setStrictPropertyValue<double>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setFloatProperty( const std::string& name,
             float value ) throw( cms::CMSException ){
-            setStrictPropertyValue<float>( name, value );
+            try{
+                setStrictPropertyValue<float>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setIntProperty( const std::string& name,
             int value ) throw( cms::CMSException ){
-            setStrictPropertyValue<int>( name, value );
+            try{
+                setStrictPropertyValue<int>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setLongProperty( const std::string& name,
             long long value ) throw( cms::CMSException ){
-            setStrictPropertyValue<long long>( name, value );
+            try{
+                setStrictPropertyValue<long long>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setShortProperty( const std::string& name,
             short value ) throw( cms::CMSException ){
-            setStrictPropertyValue<short>( name, value );
+            try{
+                setStrictPropertyValue<short>( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         virtual void setStringProperty( const std::string& name,
             const std::string& value ) throw( cms::CMSException ){
-            testProperty( name );
-            setPropertyValue( name, value );
+            try{
+                testProperty( name );
+                setPropertyValue( name, value );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -285,7 +370,14 @@
          * @throws CMSException
          */
         virtual void acknowledge() const throw( cms::CMSException ) {
-            if(ackHandler != NULL) ackHandler->acknowledgeMessage( this );
+            try{
+                if( ackHandler != NULL ) {
+                    ackHandler->acknowledgeMessage( this );
+                }
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -293,6 +385,7 @@
          * @return DeliveryMode enumerated value.
          */
         virtual int getCMSDeliveryMode() const {
+
             if(!getFrame().getProperties().hasProperty(
                    CommandConstants::toString(
                        CommandConstants::HEADER_PERSISTENT ) ) ) {
@@ -338,8 +431,8 @@
          * @param destination Destination Object
          */
         virtual void setCMSDestination( const cms::Destination* destination ) {
-            if( destination != NULL )
-            {
+
+            if( destination != NULL ) {
                 delete dest;
                 dest = destination->clone();
                 setPropertyValue(
@@ -570,7 +663,8 @@
         virtual void testProperty( const std::string& name ) const
             throw( cms::CMSException ){
             if( CommandConstants::isStompHeader( name ) ){
-                throw decaf::lang::exceptions::IllegalArgumentException( __FILE__, __LINE__,
+                throw exceptions::ActiveMQException(
+                    __FILE__, __LINE__,
                     "searching for property with name of pre-defined header" );
             }
         }
@@ -583,26 +677,31 @@
         TYPE getStrictPropertyValue( const std::string& name ) const
             throw( cms::CMSException ){
 
-            testProperty( name );
+            try{
+                testProperty( name );
 
-            if( !getProperties().hasProperty( name ) ){
-                throw decaf::lang::exceptions::NoSuchElementException(
-                    __FILE__, __LINE__,
-                    "property not available in message" );
-            }
+                if( !getProperties().hasProperty( name ) ){
+                    throw exceptions::ActiveMQException(
+                        __FILE__, __LINE__,
+                        "property not available in message" );
+                }
 
-            const char* strProp = getPropertyValue( name );
-            std::istringstream stream( strProp );
-            TYPE value;
-            stream >> value;
+                const char* strProp = getPropertyValue( name );
+                std::istringstream stream( strProp );
+                TYPE value;
+                stream >> value;
+
+                if( stream.fail() ){
+                    throw exceptions::ActiveMQException(
+                        __FILE__, __LINE__,
+                        "Error extracting property from string" );
+                }
 
-            if( stream.fail() ){
-                throw decaf::lang::exceptions::RuntimeException(
-                    __FILE__, __LINE__,
-                    "Error extracting property from string" );
+                return value;
             }
-
-            return value;
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -613,12 +712,17 @@
         template <typename TYPE>
         void setStrictPropertyValue( const std::string& name, TYPE value )
             throw( cms::CMSException ){
-            testProperty( name );
+            try{
+                testProperty( name );
 
-            std::ostringstream stream;
-            stream << value;
+                std::ostringstream stream;
+                stream << value;
 
-            setPropertyValue( name, stream.str() );
+                setPropertyValue( name, stream.str() );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -626,8 +730,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::SEND ) );
         }
@@ -638,28 +741,27 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
+
             if(frame.getCommand() ==
-               CommandConstants::toString( CommandConstants::SEND ) )
-            {
+               CommandConstants::toString( CommandConstants::SEND ) ) {
+
                 if(frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_DESTINATION ) ) )
-                {
+                        CommandConstants::HEADER_DESTINATION ) ) ) {
+
                     return true;
                 }
-            }
-            else if( frame.getCommand() ==
-                     CommandConstants::toString( CommandConstants::MESSAGE ) )
-            {
+
+            } else if( frame.getCommand() ==
+                       CommandConstants::toString( CommandConstants::MESSAGE ) ) {
+
                 if(frame.getProperties().hasProperty(
                     CommandConstants::toString(
                         CommandConstants::HEADER_DESTINATION ) ) &&
                    frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_MESSAGEID ) ) )
-                {
+                        CommandConstants::HEADER_MESSAGEID ) ) ) {
                     return true;
                 }
             }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -32,8 +32,7 @@
      * Command sent to the broker to subscribe to a topic
      * or queue.
      */
-    class SubscribeCommand : public AbstractCommand< transport::Command >
-    {
+    class SubscribeCommand : public AbstractCommand< transport::Command > {
     public:
 
         SubscribeCommand() :
@@ -332,8 +331,8 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
+
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::SUBSCRIBE ) );
 
@@ -350,14 +349,14 @@
          * @param frame Frame to validate
          * @returns frame true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
+
             if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::SUBSCRIBE )) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_DESTINATION ) ) ) )
-            {
+                        CommandConstants::HEADER_DESTINATION ) ) ) ) {
+
                 return true;
             }
 
@@ -368,4 +367,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_SUBSCRIBECOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/TextMessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/TextMessageCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/TextMessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/TextMessageCommand.h Sun Nov 11 08:52:45 2007
@@ -28,8 +28,7 @@
 namespace stomp{
 namespace commands{
 
-    class TextMessageCommand : public StompMessage< cms::TextMessage >
-    {
+    class TextMessageCommand : public StompMessage< cms::TextMessage > {
     public:
 
         TextMessageCommand() :
@@ -72,12 +71,17 @@
          */
         virtual std::string getText() const throw( cms::CMSException ) {
 
-            const std::vector<unsigned char>& bytes = getBytes();
-            if( bytes.size() == 0 ){
-                return "";
-            }
+            try{
+                const std::vector<unsigned char>& bytes = getBytes();
+                if( bytes.size() == 0 ){
+                    return "";
+                }
 
-            return std::string( (char*)&bytes[0] );
+                return std::string( (char*)&bytes[0] );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -85,7 +89,12 @@
          * @param msg The message buffer.
          */
         virtual void setText( const char* msg ) throw( cms::CMSException ) {
-            setBytes( (unsigned char*)msg, strlen(msg) + 1 );
+            try{
+                setBytes( (unsigned char*)msg, strlen(msg) + 1 );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
         /**
@@ -93,7 +102,12 @@
          * @param msg The message buffer.
          */
         virtual void setText( const std::string& msg ) throw( cms::CMSException ) {
-            setBytes( (unsigned char*)msg.c_str(), msg.length() + 1 );
+            try{
+                setBytes( (unsigned char*)msg.c_str(), msg.length() + 1 );
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
 
     };

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_
 
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
@@ -31,8 +31,7 @@
      * Command sent to the broker to unsubscribe to a
      * topic or queue.
      */
-    class UnsubscribeCommand : public AbstractCommand< transport::Command >
-    {
+    class UnsubscribeCommand : public AbstractCommand< transport::Command > {
     public:
 
         UnsubscribeCommand() :
@@ -45,7 +44,7 @@
                 validate( getFrame() );
         }
 
-        virtual ~UnsubscribeCommand(void) {};
+        virtual ~UnsubscribeCommand(void) {}
 
         /**
          * Clone the StompCommand and return the new copy.
@@ -83,8 +82,7 @@
          * frame with data appropriate for the command type.
          * @param frame Frame to init
          */
-        virtual void initialize( StompFrame& frame )
-        {
+        virtual void initialize( StompFrame& frame ) {
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::UNSUBSCRIBE ) );
         }
@@ -95,14 +93,12 @@
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
-        virtual bool validate( const StompFrame& frame ) const
-        {
+        virtual bool validate( const StompFrame& frame ) const {
             if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::UNSUBSCRIBE )) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_DESTINATION ) ) ) )
-            {
+                        CommandConstants::HEADER_DESTINATION ) ) ) ) {
                 return true;
             }
 
@@ -113,4 +109,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_UNSUBSCRIBECOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/MarshalException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/MarshalException.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/MarshalException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/MarshalException.h Sun Nov 11 08:52:45 2007
@@ -14,8 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
 
 #include <activemq/exceptions/ActiveMQException.h>
 
@@ -24,12 +24,11 @@
 namespace stomp{
 namespace marshal{
 
-	/*
-	 * Signals that an problem occurred during marshalling.
-	 */
-	class MarshalException : public exceptions::ActiveMQException
-	{
-	public:
+    /*
+     * Signals that an problem occurred during marshalling.
+     */
+    class MarshalException : public exceptions::ActiveMQException {
+    public:
 
         /**
          * Default Constructor
@@ -41,9 +40,8 @@
          * @param ex the exception to copy
          */
         MarshalException( const exceptions::ActiveMQException& ex ) throw()
-        : exceptions::ActiveMQException()
-        {
-          *(ActiveMQException*)this = ex;
+        : exceptions::ActiveMQException() {
+            *(ActiveMQException*)this = ex;
         }
 
         /**
@@ -51,8 +49,7 @@
          * @param ex the exception to copy, which is an instance of this type
          */
         MarshalException( const MarshalException& ex ) throw()
-        : exceptions::ActiveMQException()
-        {
+        : exceptions::ActiveMQException() {
             *(exceptions::ActiveMQException*)this = ex;
         }
 
@@ -62,30 +59,32 @@
          * @param lineNumber line where the exception occured
          * @param msg the message that was generated
          */
-        MarshalException(const char* file, const int lineNumber, 
-            const char* msg, ...) throw()
-        : exceptions::ActiveMQException()
-        {
+        MarshalException( const char* file,
+                          const int lineNumber,
+                          const char* msg, ...) throw()
+         :  exceptions::ActiveMQException() {
+
             va_list vargs ;
             va_start(vargs, msg) ;
             buildMessage(msg, vargs) ;
-            
+
             // Set the first mark for this exception.
             setMark( file, lineNumber );
         }
-      
+
         /**
          * Clones this exception.  This is useful for cases where you need
          * to preserve the type of the original exception as well as the message.
          * All subclasses should override.
          */
-        virtual exceptions::ActiveMQException* clone() const{
+        virtual MarshalException* clone() const{
             return new MarshalException( *this );
         }
-        virtual ~MarshalException() throw(){}
-	    
-	};
+
+        virtual ~MarshalException() throw() {}
+
+    };
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALLEXCEPTION_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALLEXCEPTION_H_*/

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

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.cpp Sun Nov 11 08:52:45 2007
@@ -39,17 +39,18 @@
 using namespace activemq::connector::stomp;
 using namespace activemq::connector::stomp::commands;
 using namespace activemq::connector::stomp::marshal;
+using namespace decaf::lang;
 
-////////////////////////////////////////////////////////////////////////////////      
+////////////////////////////////////////////////////////////////////////////////
 transport::Command* Marshaler::marshal( StompFrame* frame )
-    throw ( MarshalException )
-{
-    try
-    {
-        CommandConstants::CommandId commandId = 
+    throw ( MarshalException ) {
+
+    try {
+
+        CommandConstants::CommandId commandId =
             CommandConstants::toCommandId(frame->getCommand().c_str());
         transport::Command* command = NULL;
-        
+
         if(commandId == CommandConstants::CONNECTED){
             command = new ConnectedCommand( frame );
         }
@@ -60,22 +61,19 @@
             command = new ReceiptCommand( frame );
         }
         else if(commandId == CommandConstants::MESSAGE){
+
             if( !frame->getProperties().hasProperty(
                     CommandConstants::toString(
-                        CommandConstants::HEADER_CONTENTLENGTH ) ) )
-            {
+                        CommandConstants::HEADER_CONTENTLENGTH ) ) ) {
                 command = new TextMessageCommand( frame );
-            }
-            else
-            {
+            } else {
                 command = new BytesMessageCommand( frame );
             }
         }
-    
+
         // We either got a command or a response, but if we got neither
         // then complain, something went wrong.
-        if(command == NULL)
-        {
+        if(command == NULL) {
             throw MarshalException(
                 __FILE__, __LINE__,
                 "Marshaler::marshal - No Command Created from frame");
@@ -85,25 +83,23 @@
     }
     AMQ_CATCH_RETHROW( MarshalException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, MarshalException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, MarshalException )
     AMQ_CATCHALL_THROW( MarshalException )
 }
 
-////////////////////////////////////////////////////////////////////////////////      
+////////////////////////////////////////////////////////////////////////////////
 const StompFrame& Marshaler::marshal( transport::Command* command )
-    throw ( MarshalException )
-{
-    try
-    {
-        Marshalable* marshalable = 
+    throw ( MarshalException ) {
+
+    try{
+
+        Marshalable* marshalable =
             dynamic_cast<Marshalable*>(command);
 
         // Easy, just get the frame from the command
-        if(marshalable != NULL)
-        {        
+        if( marshalable != NULL ) {
             return marshalable->marshal();
-        }
-        else
-        {
+        } else {
             throw MarshalException(
                 __FILE__, __LINE__,
                 "Marshaler::marshal - Invalid Command Type!");
@@ -111,5 +107,6 @@
     }
     AMQ_CATCH_RETHROW( MarshalException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, MarshalException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, MarshalException )
     AMQ_CATCHALL_THROW( MarshalException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
-#define ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
 
 #include <activemq/transport/Command.h>
 #include <activemq/connector/stomp/StompFrame.h>
@@ -26,18 +26,17 @@
 namespace connector{
 namespace stomp{
 namespace marshal{
-        
+
     /**
      * Interface for all marshallers between Commands and
      * stomp frames.
      */
-    class Marshaler
-    {
+    class Marshaler {
     public:
-   
+
         Marshaler(void) {}
         virtual ~Marshaler(void) {}
-        
+
         /**
          * Marshall a Stomp Frame to a Stomp Command, the frame is now
          * owned by this Command, caller should not use the frame again.
@@ -47,7 +46,7 @@
          */
         virtual transport::Command* marshal( StompFrame* frame )
             throw ( MarshalException );
-      
+
         /**
          * Marshal a Stomp Command to a Stom Frame, if the command that
          * is past is not castable to a Stomp Command an Exception will
@@ -56,7 +55,7 @@
          * @return newly Marshaled Stomp Frame
          * @throws MarshalException
          */
-        virtual const StompFrame& marshal( 
+        virtual const StompFrame& marshal(
             transport::Command* command )
                 throw ( MarshalException );
 
@@ -64,4 +63,4 @@
 
 }}}}
 
-#endif /*ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQTransaction.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQTransaction.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQTransaction.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQTransaction.cpp Sun Nov 11 08:52:45 2007
@@ -60,6 +60,7 @@
             getConnector()->startTransaction( session->getSessionInfo() );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -77,6 +78,7 @@
         clearTransaction();
     }
     AMQ_CATCH_NOTHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_NOTHROW( )
 }
 
@@ -110,6 +112,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -148,6 +151,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -174,6 +178,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -207,6 +212,7 @@
         session->start();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
@@ -258,6 +264,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.cpp Sun Nov 11 08:52:45 2007
@@ -38,10 +38,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 unsigned char LoggingInputStream::read() throw ( IOException ) {
     try {
-        unsigned char c = FilterInputStream::read();
 
+        unsigned char c = FilterInputStream::read();
         log( &c, 1 );
-
         return c;
     }
     AMQ_CATCH_RETHROW( IOException )

Modified: activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.h Sun Nov 11 08:52:45 2007
@@ -73,6 +73,7 @@
          * Logs the data in the buffer.
          */
         void log( const unsigned char* buffer, std::size_t len );
+
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingOutputStream.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingOutputStream.cpp Sun Nov 11 08:52:45 2007
@@ -40,7 +40,6 @@
     try {
 
         log( &c, 1 );
-
         FilterOutputStream::write( c );
     }
     AMQ_CATCH_RETHROW( IOException )

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_COMMAND_H_
-#define ACTIVEMQ_TRANSPORT_COMMAND_H_
+#ifndef _ACTIVEMQ_TRANSPORT_COMMAND_H_
+#define _ACTIVEMQ_TRANSPORT_COMMAND_H_
 
 #include <string>
 
@@ -26,7 +26,7 @@
     class Command{
     public:
 
-        virtual ~Command(){}
+        virtual ~Command() {}
 
         /**
          * Sets the Command Id of this Message
@@ -69,4 +69,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_COMMAND_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_COMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandIOException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandIOException.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandIOException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandIOException.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_
-#define ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_
+#ifndef _ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_
+#define _ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_
 
 #include <decaf/io/IOException.h>
 
@@ -29,15 +29,14 @@
         /**
          * Default Constructor
          */
-        CommandIOException() throw() {};
+        CommandIOException() throw() {}
 
         /**
          * Copy Constructor
          * @param ex the exception to copy
          */
         CommandIOException( const decaf::lang::Exception& ex ) throw()
-        : decaf::io::IOException()
-        {
+        : decaf::io::IOException() {
             *this = ex;
         }
 
@@ -56,10 +55,11 @@
          * @param lineNumber line where the exception occured
          * @param msg the message that was generated
          */
-        CommandIOException( const char* file, const int lineNumber,
+        CommandIOException( const char* file,
+                            const int lineNumber,
                             const char* msg, ... ) throw()
-        : decaf::io::IOException()
-        {
+        : decaf::io::IOException() {
+
             va_list vargs;
             va_start( vargs, msg );
             buildMessage( msg, vargs );
@@ -83,4 +83,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_COMMANDIOEXCEPTION_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandListener.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandListener.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandListener.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandListener.h Sun Nov 11 08:52:45 2007
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_
-#define ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_
-
-#include <activemq/transport/Command.h>
+#ifndef _ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_
+#define _ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_
 
 namespace activemq{
 namespace transport{
 
+    class Command;
+
     /**
      * Interface for an observer of broker commands.
      */
@@ -41,4 +41,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_COMMANDLISTENER_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandReader.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandReader.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandReader.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandReader.h Sun Nov 11 08:52:45 2007
@@ -32,15 +32,15 @@
     class CommandReader : public decaf::io::Reader {
     public:
 
-        virtual ~CommandReader(){}
+        virtual ~CommandReader() {}
 
         /**
-         * Reads a command from the given input stream.
+         * Reads a command from the given input stream.  Will block until
+         * a command is read or an error is thrown.
          * @return The next command available on the stream.
          * @throws CommandIOException if a problem occurs during the read.
          */
-        virtual Command* readCommand()
-            throw ( CommandIOException ) = 0;
+        virtual Command* readCommand() throw ( CommandIOException ) = 0;
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandWriter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandWriter.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandWriter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandWriter.h Sun Nov 11 08:52:45 2007
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_
-#define ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_
+#ifndef _ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_
+#define _ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_
 
 #include <decaf/io/OutputStream.h>
 #include <decaf/io/Writer.h>
 #include <activemq/transport/CommandIOException.h>
-#include <activemq/transport/Command.h>
 
 namespace activemq{
 namespace transport{
 
+    class Command;
+
     /**
      * Interface for an object responsible for writing a command
      * to an output stream.
      */
-    class CommandWriter : public decaf::io::Writer
-    {
+    class CommandWriter : public decaf::io::Writer {
     public:
 
         virtual ~CommandWriter() {}
@@ -48,4 +48,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_COMMANDWRITER_H_*/



Mime
View raw message