activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r510313 [4/5] - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/
Date Wed, 21 Feb 2007 23:41:54 GMT
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageDispatchNotificationMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageDispatchNotificationMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageDispatchNotificationMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageDispatchNotificationMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,72 +48,102 @@
 ///////////////////////////////////////////////////////////////////////////////
 void MessageDispatchNotificationMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    MessageDispatchNotification* info =
-        dynamic_cast<MessageDispatchNotification*>( dataStructure );
-    info->setConsumerId( dynamic_cast< ConsumerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setDeliverySequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setMessageId( dynamic_cast< MessageId* >(
-        tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        MessageDispatchNotification* info =
+            dynamic_cast<MessageDispatchNotification*>( dataStructure );
+        info->setConsumerId( dynamic_cast< ConsumerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setDeliverySequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setMessageId( dynamic_cast< MessageId* >(
+            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int MessageDispatchNotificationMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    MessageDispatchNotification* info =
-        dynamic_cast<MessageDispatchNotification*>( dataStructure );
+    try {
 
-    int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getConsumerId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getDeliverySequenceId(), bs );
-    rc += tightMarshalNestedObject1( wireFormat, info->getMessageId(), bs );
+        MessageDispatchNotification* info =
+            dynamic_cast<MessageDispatchNotification*>( dataStructure );
 
-    return rc + 0;
+        int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getConsumerId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getDeliverySequenceId(), bs );
+        rc += tightMarshalNestedObject1( wireFormat, info->getMessageId(), bs );
+
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageDispatchNotificationMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
+
+        BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
 
-    MessageDispatchNotification* info =
-        dynamic_cast<MessageDispatchNotification*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getConsumerId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getDeliverySequenceId(), dataOut, bs );
-    tightMarshalNestedObject2( wireFormat, info->getMessageId(), dataOut, bs );
+        MessageDispatchNotification* info =
+            dynamic_cast<MessageDispatchNotification*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getConsumerId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getDeliverySequenceId(), dataOut, bs );
+        tightMarshalNestedObject2( wireFormat, info->getMessageId(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageDispatchNotificationMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    MessageDispatchNotification* info =
-        dynamic_cast<MessageDispatchNotification*>( dataStructure );
-    info->setConsumerId( dynamic_cast< ConsumerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setDeliverySequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setMessageId( dynamic_cast< MessageId* >( 
-        looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+    try {
+
+        BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        MessageDispatchNotification* info =
+            dynamic_cast<MessageDispatchNotification*>( dataStructure );
+        info->setConsumerId( dynamic_cast< ConsumerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setDeliverySequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setMessageId( dynamic_cast< MessageId* >( 
+            looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageDispatchNotificationMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    MessageDispatchNotification* info =
-        dynamic_cast<MessageDispatchNotification*>( dataStructure );
-    BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalCachedObject( wireFormat, info->getConsumerId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
-    looseMarshalLong( wireFormat, info->getDeliverySequenceId(), dataOut );
-    looseMarshalNestedObject( wireFormat, info->getMessageId(), dataOut );
+    try {
+
+        MessageDispatchNotification* info =
+            dynamic_cast<MessageDispatchNotification*>( dataStructure );
+         BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getConsumerId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
+        looseMarshalLong( wireFormat, info->getDeliverySequenceId(), dataOut );
+        looseMarshalNestedObject( wireFormat, info->getMessageId(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageIdMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageIdMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,63 +48,93 @@
 ///////////////////////////////////////////////////////////////////////////////
 void MessageIdMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    MessageId* info =
-        dynamic_cast<MessageId*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setProducerSequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setBrokerSequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        MessageId* info =
+            dynamic_cast<MessageId*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setProducerSequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setBrokerSequenceId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int MessageIdMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    MessageId* info =
-        dynamic_cast<MessageId*>( dataStructure );
+    try {
 
-    int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getProducerSequenceId(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getBrokerSequenceId(), bs );
+        MessageId* info =
+            dynamic_cast<MessageId*>( dataStructure );
 
-    return rc + 0;
+        int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getProducerSequenceId(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getBrokerSequenceId(), bs );
+
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageIdMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
+
+        BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
 
-    MessageId* info =
-        dynamic_cast<MessageId*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getProducerSequenceId(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getBrokerSequenceId(), dataOut, bs );
+        MessageId* info =
+            dynamic_cast<MessageId*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getProducerSequenceId(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getBrokerSequenceId(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageIdMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    MessageId* info =
-        dynamic_cast<MessageId*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setProducerSequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setBrokerSequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
+    try {
+
+        BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        MessageId* info =
+            dynamic_cast<MessageId*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setProducerSequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setBrokerSequenceId( looseUnmarshalLong( wireFormat, dataIn ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageIdMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    MessageId* info =
-        dynamic_cast<MessageId*>( dataStructure );
-    BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
-    looseMarshalLong( wireFormat, info->getProducerSequenceId(), dataOut );
-    looseMarshalLong( wireFormat, info->getBrokerSequenceId(), dataOut );
+    try {
+
+        MessageId* info =
+            dynamic_cast<MessageId*>( dataStructure );
+         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
+        looseMarshalLong( wireFormat, info->getProducerSequenceId(), dataOut );
+        looseMarshalLong( wireFormat, info->getBrokerSequenceId(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessageMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -38,229 +38,259 @@
 ///////////////////////////////////////////////////////////////////////////////
 void MessageMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    Message* info =
-        dynamic_cast<Message*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setTransactionId( dynamic_cast< TransactionId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setOriginalDestination( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setMessageId( dynamic_cast< MessageId* >(
-        tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
-    info->setOriginalTransactionId( dynamic_cast< TransactionId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setGroupID( tightUnmarshalString( dataIn, bs ) );
-    info->setGroupSequence( dataIn->readInt() );
-    info->setCorrelationId( tightUnmarshalString( dataIn, bs ) );
-    info->setPersistent( bs->readBoolean() );
-    info->setExpiration( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setPriority( dataIn->readByte() );
-    info->setReplyTo( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
-    info->setTimestamp( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setType( tightUnmarshalString( dataIn, bs ) );
-    info->setContent( tightUnmarshalByteArray( dataIn, bs ) );
-    info->setMarshalledProperties( tightUnmarshalByteArray( dataIn, bs ) );
-    info->setDataStructure( dynamic_cast< DataStructure* >(
-        tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
-    info->setTargetConsumerId( dynamic_cast< ConsumerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setCompressed( bs->readBoolean() );
-    info->setRedeliveryCounter( dataIn->readInt() );
-
-    if( bs->readBoolean() ) {
-        short size = dataIn->readShort();
-        info->getBrokerPath().reserve( size );
-        for( int i = 0; i < size; i++ ) {
-            info->getBrokerPath().push_back( dynamic_cast< BrokerId* >(
-                tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        Message* info =
+            dynamic_cast<Message*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setTransactionId( dynamic_cast< TransactionId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setOriginalDestination( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setMessageId( dynamic_cast< MessageId* >(
+            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        info->setOriginalTransactionId( dynamic_cast< TransactionId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setGroupID( tightUnmarshalString( dataIn, bs ) );
+        info->setGroupSequence( dataIn->readInt() );
+        info->setCorrelationId( tightUnmarshalString( dataIn, bs ) );
+        info->setPersistent( bs->readBoolean() );
+        info->setExpiration( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setPriority( dataIn->readByte() );
+        info->setReplyTo( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        info->setTimestamp( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setType( tightUnmarshalString( dataIn, bs ) );
+        info->setContent( tightUnmarshalByteArray( dataIn, bs ) );
+        info->setMarshalledProperties( tightUnmarshalByteArray( dataIn, bs ) );
+        info->setDataStructure( dynamic_cast< DataStructure* >(
+            tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        info->setTargetConsumerId( dynamic_cast< ConsumerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setCompressed( bs->readBoolean() );
+        info->setRedeliveryCounter( dataIn->readInt() );
+
+        if( bs->readBoolean() ) {
+            short size = dataIn->readShort();
+            info->getBrokerPath().reserve( size );
+            for( int i = 0; i < size; i++ ) {
+                info->getBrokerPath().push_back( dynamic_cast< BrokerId* >(
+                    tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+            }
         }
-    }
-    else {
-        info->getBrokerPath().clear();
-    }
-    info->setArrival( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setUserID( tightUnmarshalString( dataIn, bs ) );
-    info->setRecievedByDFBridge( bs->readBoolean() );
-    info->setDroppable( bs->readBoolean() );
+        else {
+            info->getBrokerPath().clear();
+        }
+        info->setArrival( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setUserID( tightUnmarshalString( dataIn, bs ) );
+        info->setRecievedByDFBridge( bs->readBoolean() );
+        info->setDroppable( bs->readBoolean() );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int MessageMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    Message* info =
-        dynamic_cast<Message*>( dataStructure );
+    try {
 
-    int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getTransactionId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getOriginalDestination(), bs );
-    rc += tightMarshalNestedObject1( wireFormat, info->getMessageId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getOriginalTransactionId(), bs );
-    rc += tightMarshalString1( info->getGroupID(), bs );
-    rc += tightMarshalString1( info->getCorrelationId(), bs );
-    bs->writeBoolean( info->isPersistent() );
-    rc += tightMarshalLong1( wireFormat, info->getExpiration(), bs );
-    rc += tightMarshalNestedObject1( wireFormat, info->getReplyTo(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getTimestamp(), bs );
-    rc += tightMarshalString1( info->getType(), bs );
-    bs->writeBoolean( info->getContent().size() != 0 );
-    rc += info->getContent().size() == 0 ? 0 : (int)info->getContent().size() + 4;
-    bs->writeBoolean( info->getMarshalledProperties().size() != 0 );
-    rc += info->getMarshalledProperties().size() == 0 ? 0 : (int)info->getMarshalledProperties().size() + 4;
-    rc += tightMarshalNestedObject1( wireFormat, info->getDataStructure(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getTargetConsumerId(), bs );
-    bs->writeBoolean( info->isCompressed() );
-    rc += tightMarshalObjectArray1( wireFormat, info->getBrokerPath(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getArrival(), bs );
-    rc += tightMarshalString1( info->getUserID(), bs );
-    bs->writeBoolean( info->isRecievedByDFBridge() );
-    bs->writeBoolean( info->isDroppable() );
+        Message* info =
+            dynamic_cast<Message*>( dataStructure );
 
-    return rc + 9;
+        int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getTransactionId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getOriginalDestination(), bs );
+        rc += tightMarshalNestedObject1( wireFormat, info->getMessageId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getOriginalTransactionId(), bs );
+        rc += tightMarshalString1( info->getGroupID(), bs );
+        rc += tightMarshalString1( info->getCorrelationId(), bs );
+        bs->writeBoolean( info->isPersistent() );
+        rc += tightMarshalLong1( wireFormat, info->getExpiration(), bs );
+        rc += tightMarshalNestedObject1( wireFormat, info->getReplyTo(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getTimestamp(), bs );
+        rc += tightMarshalString1( info->getType(), bs );
+        bs->writeBoolean( info->getContent().size() != 0 );
+        rc += info->getContent().size() == 0 ? 0 : (int)info->getContent().size() + 4;
+        bs->writeBoolean( info->getMarshalledProperties().size() != 0 );
+        rc += info->getMarshalledProperties().size() == 0 ? 0 : (int)info->getMarshalledProperties().size() + 4;
+        rc += tightMarshalNestedObject1( wireFormat, info->getDataStructure(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getTargetConsumerId(), bs );
+        bs->writeBoolean( info->isCompressed() );
+        rc += tightMarshalObjectArray1( wireFormat, info->getBrokerPath(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getArrival(), bs );
+        rc += tightMarshalString1( info->getUserID(), bs );
+        bs->writeBoolean( info->isRecievedByDFBridge() );
+        bs->writeBoolean( info->isDroppable() );
+
+        return rc + 9;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
 
-    Message* info =
-        dynamic_cast<Message*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getTransactionId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getOriginalDestination(), dataOut, bs );
-    tightMarshalNestedObject2( wireFormat, info->getMessageId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getOriginalTransactionId(), dataOut, bs );
-    tightMarshalString2( info->getGroupID(), dataOut, bs );
-    dataOut->writeInt( info->getGroupSequence() );
-    tightMarshalString2( info->getCorrelationId(), dataOut, bs );
-    bs->readBoolean();
-    tightMarshalLong2( wireFormat, info->getExpiration(), dataOut, bs );
-    dataOut->write( info->getPriority() );
-    tightMarshalNestedObject2( wireFormat, info->getReplyTo(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getTimestamp(), dataOut, bs );
-    tightMarshalString2( info->getType(), dataOut, bs );
-    if( bs->readBoolean() ) {
-        dataOut->writeInt( (int)info->getContent().size() );
-        dataOut->write( (const unsigned char*)(&info->getContent()[0]), (int)info->getContent().size() );
-    }
-    if( bs->readBoolean() ) {
-        dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-        dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size() );
-    }
-    tightMarshalNestedObject2( wireFormat, info->getDataStructure(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId(), dataOut, bs );
-    bs->readBoolean();
-    dataOut->writeInt( info->getRedeliveryCounter() );
-    tightMarshalObjectArray2( wireFormat, info->getBrokerPath(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getArrival(), dataOut, bs );
-    tightMarshalString2( info->getUserID(), dataOut, bs );
-    bs->readBoolean();
-    bs->readBoolean();
+        BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+        Message* info =
+            dynamic_cast<Message*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getTransactionId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getOriginalDestination(), dataOut, bs );
+        tightMarshalNestedObject2( wireFormat, info->getMessageId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getOriginalTransactionId(), dataOut, bs );
+        tightMarshalString2( info->getGroupID(), dataOut, bs );
+        dataOut->writeInt( info->getGroupSequence() );
+        tightMarshalString2( info->getCorrelationId(), dataOut, bs );
+        bs->readBoolean();
+        tightMarshalLong2( wireFormat, info->getExpiration(), dataOut, bs );
+        dataOut->write( info->getPriority() );
+        tightMarshalNestedObject2( wireFormat, info->getReplyTo(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getTimestamp(), dataOut, bs );
+        tightMarshalString2( info->getType(), dataOut, bs );
+        if( bs->readBoolean() ) {
+            dataOut->writeInt( (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), (int)info->getContent().size() );
+        }
+        if( bs->readBoolean() ) {
+            dataOut->writeInt( (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size() );
+        }
+        tightMarshalNestedObject2( wireFormat, info->getDataStructure(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId(), dataOut, bs );
+        bs->readBoolean();
+        dataOut->writeInt( info->getRedeliveryCounter() );
+        tightMarshalObjectArray2( wireFormat, info->getBrokerPath(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getArrival(), dataOut, bs );
+        tightMarshalString2( info->getUserID(), dataOut, bs );
+        bs->readBoolean();
+        bs->readBoolean();
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    Message* info =
-        dynamic_cast<Message*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setTransactionId( dynamic_cast< TransactionId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setOriginalDestination( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setMessageId( dynamic_cast< MessageId* >( 
-        looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
-    info->setOriginalTransactionId( dynamic_cast< TransactionId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setGroupID( looseUnmarshalString( dataIn ) );
-    info->setGroupSequence( dataIn->readInt() );
-    info->setCorrelationId( looseUnmarshalString( dataIn ) );
-    info->setPersistent( dataIn->readBoolean() );
-    info->setExpiration( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setPriority( dataIn->readByte() );
-    info->setReplyTo( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
-    info->setTimestamp( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setType( looseUnmarshalString( dataIn ) );
-    info->setContent( looseUnmarshalByteArray( dataIn ) );
-    info->setMarshalledProperties( looseUnmarshalByteArray( dataIn ) );
-    info->setDataStructure( dynamic_cast< DataStructure* >( 
-        looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
-    info->setTargetConsumerId( dynamic_cast< ConsumerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setCompressed( dataIn->readBoolean() );
-    info->setRedeliveryCounter( dataIn->readInt() );
-
-    if( dataIn->readBoolean() ) {
-        short size = dataIn->readShort();
-        info->getBrokerPath().reserve( size );
-        for( int i = 0; i < size; i++ ) {
-            info->getBrokerPath().push_back( dynamic_cast<BrokerId* >(
-                looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+    try {
+
+        BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        Message* info =
+            dynamic_cast<Message*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setTransactionId( dynamic_cast< TransactionId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setOriginalDestination( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setMessageId( dynamic_cast< MessageId* >( 
+            looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+        info->setOriginalTransactionId( dynamic_cast< TransactionId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setGroupID( looseUnmarshalString( dataIn ) );
+        info->setGroupSequence( dataIn->readInt() );
+        info->setCorrelationId( looseUnmarshalString( dataIn ) );
+        info->setPersistent( dataIn->readBoolean() );
+        info->setExpiration( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setPriority( dataIn->readByte() );
+        info->setReplyTo( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+        info->setTimestamp( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setType( looseUnmarshalString( dataIn ) );
+        info->setContent( looseUnmarshalByteArray( dataIn ) );
+        info->setMarshalledProperties( looseUnmarshalByteArray( dataIn ) );
+        info->setDataStructure( dynamic_cast< DataStructure* >( 
+            looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+        info->setTargetConsumerId( dynamic_cast< ConsumerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setCompressed( dataIn->readBoolean() );
+        info->setRedeliveryCounter( dataIn->readInt() );
+
+        if( dataIn->readBoolean() ) {
+            short size = dataIn->readShort();
+            info->getBrokerPath().reserve( size );
+            for( int i = 0; i < size; i++ ) {
+                info->getBrokerPath().push_back( dynamic_cast<BrokerId* >(
+                    looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+            }
         }
-    }
-    else {
-        info->getBrokerPath().clear();
-    }
-    info->setArrival( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setUserID( looseUnmarshalString( dataIn ) );
-    info->setRecievedByDFBridge( dataIn->readBoolean() );
-    info->setDroppable( dataIn->readBoolean() );
+        else {
+            info->getBrokerPath().clear();
+        }
+        info->setArrival( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setUserID( looseUnmarshalString( dataIn ) );
+        info->setRecievedByDFBridge( dataIn->readBoolean() );
+        info->setDroppable( dataIn->readBoolean() );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessageMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    Message* info =
-        dynamic_cast<Message*>( dataStructure );
-    BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getTransactionId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getOriginalDestination(), dataOut );
-    looseMarshalNestedObject( wireFormat, info->getMessageId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getOriginalTransactionId(), dataOut );
-    looseMarshalString( info->getGroupID(), dataOut );
-    dataOut->writeInt( info->getGroupSequence() );
-    looseMarshalString( info->getCorrelationId(), dataOut );
-    dataOut->writeBoolean( info->isPersistent() );
-    looseMarshalLong( wireFormat, info->getExpiration(), dataOut );
-    dataOut->write( info->getPriority() );
-    looseMarshalNestedObject( wireFormat, info->getReplyTo(), dataOut );
-    looseMarshalLong( wireFormat, info->getTimestamp(), dataOut );
-    looseMarshalString( info->getType(), dataOut );
-    dataOut->writeBoolean( info->getContent().size() != 0 );
-    if( info->getContent().size() != 0 ) {
-        dataOut->writeInt( (int)info->getContent().size() );
-        dataOut->write( (const unsigned char*)(&info->getContent()[0]), (int)info->getContent().size() );
-    }
-    dataOut->writeBoolean( info->getMarshalledProperties().size() != 0 );
-    if( info->getMarshalledProperties().size() != 0 ) {
-        dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-        dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size() );
-    }
-    looseMarshalNestedObject( wireFormat, info->getDataStructure(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getTargetConsumerId(), dataOut );
-    dataOut->writeBoolean( info->isCompressed() );
-    dataOut->writeInt( info->getRedeliveryCounter() );
-    looseMarshalObjectArray( wireFormat, info->getBrokerPath(), dataOut );
-    looseMarshalLong( wireFormat, info->getArrival(), dataOut );
-    looseMarshalString( info->getUserID(), dataOut );
-    dataOut->writeBoolean( info->isRecievedByDFBridge() );
-    dataOut->writeBoolean( info->isDroppable() );
+    try {
+
+        Message* info =
+            dynamic_cast<Message*>( dataStructure );
+         BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getTransactionId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getOriginalDestination(), dataOut );
+        looseMarshalNestedObject( wireFormat, info->getMessageId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getOriginalTransactionId(), dataOut );
+        looseMarshalString( info->getGroupID(), dataOut );
+        dataOut->writeInt( info->getGroupSequence() );
+        looseMarshalString( info->getCorrelationId(), dataOut );
+        dataOut->writeBoolean( info->isPersistent() );
+        looseMarshalLong( wireFormat, info->getExpiration(), dataOut );
+        dataOut->write( info->getPriority() );
+        looseMarshalNestedObject( wireFormat, info->getReplyTo(), dataOut );
+        looseMarshalLong( wireFormat, info->getTimestamp(), dataOut );
+        looseMarshalString( info->getType(), dataOut );
+        dataOut->write( info->getContent().size() != 0 );
+        if( info->getContent().size() != 0 ) {
+            dataOut->writeInt( (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), (int)info->getContent().size() );
+        }
+        dataOut->write( info->getMarshalledProperties().size() != 0 );
+        if( info->getMarshalledProperties().size() != 0 ) {
+            dataOut->writeInt( (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size() );
+        }
+        looseMarshalNestedObject( wireFormat, info->getDataStructure(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getTargetConsumerId(), dataOut );
+        dataOut->writeBoolean( info->isCompressed() );
+        dataOut->writeInt( info->getRedeliveryCounter() );
+        looseMarshalObjectArray( wireFormat, info->getBrokerPath(), dataOut );
+        looseMarshalLong( wireFormat, info->getArrival(), dataOut );
+        looseMarshalString( info->getUserID(), dataOut );
+        dataOut->writeBoolean( info->isRecievedByDFBridge() );
+        dataOut->writeBoolean( info->isDroppable() );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessagePullMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessagePullMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessagePullMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/MessagePullMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,65 +48,95 @@
 ///////////////////////////////////////////////////////////////////////////////
 void MessagePullMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    MessagePull* info =
-        dynamic_cast<MessagePull*>( dataStructure );
-    info->setConsumerId( dynamic_cast< ConsumerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setTimeout( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        MessagePull* info =
+            dynamic_cast<MessagePull*>( dataStructure );
+        info->setConsumerId( dynamic_cast< ConsumerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setTimeout( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int MessagePullMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    MessagePull* info =
-        dynamic_cast<MessagePull*>( dataStructure );
+    try {
 
-    int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getConsumerId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getTimeout(), bs );
+        MessagePull* info =
+            dynamic_cast<MessagePull*>( dataStructure );
 
-    return rc + 0;
+        int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getConsumerId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getTimeout(), bs );
+
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessagePullMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
+
+        BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
 
-    MessagePull* info =
-        dynamic_cast<MessagePull*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getConsumerId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getTimeout(), dataOut, bs );
+        MessagePull* info =
+            dynamic_cast<MessagePull*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getConsumerId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getTimeout(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessagePullMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    MessagePull* info =
-        dynamic_cast<MessagePull*>( dataStructure );
-    info->setConsumerId( dynamic_cast< ConsumerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setTimeout( looseUnmarshalLong( wireFormat, dataIn ) );
+    try {
+
+        BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        MessagePull* info =
+            dynamic_cast<MessagePull*>( dataStructure );
+        info->setConsumerId( dynamic_cast< ConsumerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setTimeout( looseUnmarshalLong( wireFormat, dataIn ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void MessagePullMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    MessagePull* info =
-        dynamic_cast<MessagePull*>( dataStructure );
-    BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalCachedObject( wireFormat, info->getConsumerId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
-    looseMarshalLong( wireFormat, info->getTimeout(), dataOut );
+    try {
+
+        MessagePull* info =
+            dynamic_cast<MessagePull*>( dataStructure );
+         BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getConsumerId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
+        looseMarshalLong( wireFormat, info->getTimeout(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/NetworkBridgeFilterMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/NetworkBridgeFilterMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/NetworkBridgeFilterMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/NetworkBridgeFilterMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,57 +48,87 @@
 ///////////////////////////////////////////////////////////////////////////////
 void NetworkBridgeFilterMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    NetworkBridgeFilter* info =
-        dynamic_cast<NetworkBridgeFilter*>( dataStructure );
-    info->setNetworkTTL( dataIn->readInt() );
-    info->setNetworkBrokerId( dynamic_cast< BrokerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        NetworkBridgeFilter* info =
+            dynamic_cast<NetworkBridgeFilter*>( dataStructure );
+        info->setNetworkTTL( dataIn->readInt() );
+        info->setNetworkBrokerId( dynamic_cast< BrokerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int NetworkBridgeFilterMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    NetworkBridgeFilter* info =
-        dynamic_cast<NetworkBridgeFilter*>( dataStructure );
+    try {
+
+        NetworkBridgeFilter* info =
+            dynamic_cast<NetworkBridgeFilter*>( dataStructure );
 
-    int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getNetworkBrokerId(), bs );
+        int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getNetworkBrokerId(), bs );
 
-    return rc + 4;
+        return rc + 4;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void NetworkBridgeFilterMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
 
-    NetworkBridgeFilter* info =
-        dynamic_cast<NetworkBridgeFilter*>( dataStructure );
-    dataOut->writeInt( info->getNetworkTTL() );
-    tightMarshalCachedObject2( wireFormat, info->getNetworkBrokerId(), dataOut, bs );
+        BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+        NetworkBridgeFilter* info =
+            dynamic_cast<NetworkBridgeFilter*>( dataStructure );
+        dataOut->writeInt( info->getNetworkTTL() );
+        tightMarshalCachedObject2( wireFormat, info->getNetworkBrokerId(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void NetworkBridgeFilterMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    NetworkBridgeFilter* info =
-        dynamic_cast<NetworkBridgeFilter*>( dataStructure );
-    info->setNetworkTTL( dataIn->readInt() );
-    info->setNetworkBrokerId( dynamic_cast< BrokerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+    try {
+
+        BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        NetworkBridgeFilter* info =
+            dynamic_cast<NetworkBridgeFilter*>( dataStructure );
+        info->setNetworkTTL( dataIn->readInt() );
+        info->setNetworkBrokerId( dynamic_cast< BrokerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void NetworkBridgeFilterMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    NetworkBridgeFilter* info =
-        dynamic_cast<NetworkBridgeFilter*>( dataStructure );
-    BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+    try {
 
-    dataOut->writeInt( info->getNetworkTTL() );
-    looseMarshalCachedObject( wireFormat, info->getNetworkBrokerId(), dataOut );
+        NetworkBridgeFilter* info =
+            dynamic_cast<NetworkBridgeFilter*>( dataStructure );
+         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        dataOut->writeInt( info->getNetworkTTL() );
+        looseMarshalCachedObject( wireFormat, info->getNetworkBrokerId(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/PartialCommandMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/PartialCommandMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,63 +48,93 @@
 ///////////////////////////////////////////////////////////////////////////////
 void PartialCommandMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    PartialCommand* info =
-        dynamic_cast<PartialCommand*>( dataStructure );
-    info->setCommandId( dataIn->readInt() );
-    info->setData( tightUnmarshalByteArray( dataIn, bs ) );
+        BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        PartialCommand* info =
+            dynamic_cast<PartialCommand*>( dataStructure );
+        info->setCommandId( dataIn->readInt() );
+        info->setData( tightUnmarshalByteArray( dataIn, bs ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int PartialCommandMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    PartialCommand* info =
-        dynamic_cast<PartialCommand*>( dataStructure );
+    try {
 
-    int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    bs->writeBoolean( info->getData().size() != 0 );
-    rc += info->getData().size() == 0 ? 0 : (int)info->getData().size() + 4;
+        PartialCommand* info =
+            dynamic_cast<PartialCommand*>( dataStructure );
 
-    return rc + 4;
+        int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        bs->writeBoolean( info->getData().size() != 0 );
+        rc += info->getData().size() == 0 ? 0 : (int)info->getData().size() + 4;
+
+        return rc + 4;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void PartialCommandMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
 
-    PartialCommand* info =
-        dynamic_cast<PartialCommand*>( dataStructure );
-    dataOut->writeInt( info->getCommandId() );
-    if( bs->readBoolean() ) {
-        dataOut->writeInt( (int)info->getData().size() );
-        dataOut->write( (const unsigned char*)(&info->getData()[0]), (int)info->getData().size() );
+        BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+        PartialCommand* info =
+            dynamic_cast<PartialCommand*>( dataStructure );
+        dataOut->writeInt( info->getCommandId() );
+        if( bs->readBoolean() ) {
+            dataOut->writeInt( (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), (int)info->getData().size() );
+        }
     }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void PartialCommandMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    PartialCommand* info =
-        dynamic_cast<PartialCommand*>( dataStructure );
-    info->setCommandId( dataIn->readInt() );
-    info->setData( looseUnmarshalByteArray( dataIn ) );
+    try {
+
+        BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        PartialCommand* info =
+            dynamic_cast<PartialCommand*>( dataStructure );
+        info->setCommandId( dataIn->readInt() );
+        info->setData( looseUnmarshalByteArray( dataIn ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void PartialCommandMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    PartialCommand* info =
-        dynamic_cast<PartialCommand*>( dataStructure );
-    BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    dataOut->writeInt( info->getCommandId() );
-    dataOut->write( info->getData().size() != 0 );
-    if( info->getData().size() != 0 ) {
-        dataOut->writeInt( (int)info->getData().size() );
-        dataOut->write( (const unsigned char*)(&info->getData()[0]), (int)info->getData().size() );
+    try {
+
+        PartialCommand* info =
+            dynamic_cast<PartialCommand*>( dataStructure );
+         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        dataOut->writeInt( info->getCommandId() );
+        dataOut->write( info->getData().size() != 0 );
+        if( info->getData().size() != 0 ) {
+            dataOut->writeInt( (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), (int)info->getData().size() );
+        }
     }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerIdMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerIdMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,61 +48,91 @@
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerIdMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    ProducerId* info =
-        dynamic_cast<ProducerId*>( dataStructure );
-    info->setConnectionId( tightUnmarshalString( dataIn, bs ) );
-    info->setValue( tightUnmarshalLong( wireFormat, dataIn, bs ) );
-    info->setSessionId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        ProducerId* info =
+            dynamic_cast<ProducerId*>( dataStructure );
+        info->setConnectionId( tightUnmarshalString( dataIn, bs ) );
+        info->setValue( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+        info->setSessionId( tightUnmarshalLong( wireFormat, dataIn, bs ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int ProducerIdMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    ProducerId* info =
-        dynamic_cast<ProducerId*>( dataStructure );
+    try {
 
-    int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalString1( info->getConnectionId(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getValue(), bs );
-    rc += tightMarshalLong1( wireFormat, info->getSessionId(), bs );
+        ProducerId* info =
+            dynamic_cast<ProducerId*>( dataStructure );
 
-    return rc + 0;
+        int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalString1( info->getConnectionId(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getValue(), bs );
+        rc += tightMarshalLong1( wireFormat, info->getSessionId(), bs );
+
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerIdMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
+
+        BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
 
-    ProducerId* info =
-        dynamic_cast<ProducerId*>( dataStructure );
-    tightMarshalString2( info->getConnectionId(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getValue(), dataOut, bs );
-    tightMarshalLong2( wireFormat, info->getSessionId(), dataOut, bs );
+        ProducerId* info =
+            dynamic_cast<ProducerId*>( dataStructure );
+        tightMarshalString2( info->getConnectionId(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getValue(), dataOut, bs );
+        tightMarshalLong2( wireFormat, info->getSessionId(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerIdMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    ProducerId* info =
-        dynamic_cast<ProducerId*>( dataStructure );
-    info->setConnectionId( looseUnmarshalString( dataIn ) );
-    info->setValue( looseUnmarshalLong( wireFormat, dataIn ) );
-    info->setSessionId( looseUnmarshalLong( wireFormat, dataIn ) );
+    try {
+
+        BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        ProducerId* info =
+            dynamic_cast<ProducerId*>( dataStructure );
+        info->setConnectionId( looseUnmarshalString( dataIn ) );
+        info->setValue( looseUnmarshalLong( wireFormat, dataIn ) );
+        info->setSessionId( looseUnmarshalLong( wireFormat, dataIn ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerIdMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    ProducerId* info =
-        dynamic_cast<ProducerId*>( dataStructure );
-    BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalString( info->getConnectionId(), dataOut );
-    looseMarshalLong( wireFormat, info->getValue(), dataOut );
-    looseMarshalLong( wireFormat, info->getSessionId(), dataOut );
+    try {
+
+        ProducerId* info =
+            dynamic_cast<ProducerId*>( dataStructure );
+         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalString( info->getConnectionId(), dataOut );
+        looseMarshalLong( wireFormat, info->getValue(), dataOut );
+        looseMarshalLong( wireFormat, info->getSessionId(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerInfoMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/ProducerInfoMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,92 +48,122 @@
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerInfoMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    ProducerInfo* info =
-        dynamic_cast<ProducerInfo*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
-
-    if( bs->readBoolean() ) {
-        short size = dataIn->readShort();
-        info->getBrokerPath().reserve( size );
-        for( int i = 0; i < size; i++ ) {
-            info->getBrokerPath().push_back( dynamic_cast< BrokerId* >(
-                tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+        BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        ProducerInfo* info =
+            dynamic_cast<ProducerInfo*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+
+        if( bs->readBoolean() ) {
+            short size = dataIn->readShort();
+            info->getBrokerPath().reserve( size );
+            for( int i = 0; i < size; i++ ) {
+                info->getBrokerPath().push_back( dynamic_cast< BrokerId* >(
+                    tightUnmarshalNestedObject( wireFormat, dataIn, bs ) ) );
+            }
         }
+        else {
+            info->getBrokerPath().clear();
+        }
+        info->setDispatchAsync( bs->readBoolean() );
     }
-    else {
-        info->getBrokerPath().clear();
-    }
-    info->setDispatchAsync( bs->readBoolean() );
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int ProducerInfoMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    ProducerInfo* info =
-        dynamic_cast<ProducerInfo*>( dataStructure );
+    try {
 
-    int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
-    rc += tightMarshalObjectArray1( wireFormat, info->getBrokerPath(), bs );
-    bs->writeBoolean( info->isDispatchAsync() );
+        ProducerInfo* info =
+            dynamic_cast<ProducerInfo*>( dataStructure );
 
-    return rc + 0;
+        int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getProducerId(), bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getDestination(), bs );
+        rc += tightMarshalObjectArray1( wireFormat, info->getBrokerPath(), bs );
+        bs->writeBoolean( info->isDispatchAsync() );
+
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerInfoMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
+
+        BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
 
-    ProducerInfo* info =
-        dynamic_cast<ProducerInfo*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
-    tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
-    tightMarshalObjectArray2( wireFormat, info->getBrokerPath(), dataOut, bs );
-    bs->readBoolean();
+        ProducerInfo* info =
+            dynamic_cast<ProducerInfo*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getProducerId(), dataOut, bs );
+        tightMarshalCachedObject2( wireFormat, info->getDestination(), dataOut, bs );
+        tightMarshalObjectArray2( wireFormat, info->getBrokerPath(), dataOut, bs );
+        bs->readBoolean();
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerInfoMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    ProducerInfo* info =
-        dynamic_cast<ProducerInfo*>( dataStructure );
-    info->setProducerId( dynamic_cast< ProducerId* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-    info->setDestination( dynamic_cast< ActiveMQDestination* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
-
-    if( dataIn->readBoolean() ) {
-        short size = dataIn->readShort();
-        info->getBrokerPath().reserve( size );
-        for( int i = 0; i < size; i++ ) {
-            info->getBrokerPath().push_back( dynamic_cast<BrokerId* >(
-                looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+    try {
+
+        BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        ProducerInfo* info =
+            dynamic_cast<ProducerInfo*>( dataStructure );
+        info->setProducerId( dynamic_cast< ProducerId* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+        info->setDestination( dynamic_cast< ActiveMQDestination* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+
+        if( dataIn->readBoolean() ) {
+            short size = dataIn->readShort();
+            info->getBrokerPath().reserve( size );
+            for( int i = 0; i < size; i++ ) {
+                info->getBrokerPath().push_back( dynamic_cast<BrokerId* >(
+                    looseUnmarshalNestedObject( wireFormat, dataIn ) ) );
+            }
         }
+        else {
+            info->getBrokerPath().clear();
+        }
+        info->setDispatchAsync( dataIn->readBoolean() );
     }
-    else {
-        info->getBrokerPath().clear();
-    }
-    info->setDispatchAsync( dataIn->readBoolean() );
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void ProducerInfoMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    ProducerInfo* info =
-        dynamic_cast<ProducerInfo*>( dataStructure );
-    BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
-
-    looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
-    looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
-    looseMarshalObjectArray( wireFormat, info->getBrokerPath(), dataOut );
-    dataOut->writeBoolean( info->isDispatchAsync() );
+    try {
+
+        ProducerInfo* info =
+            dynamic_cast<ProducerInfo*>( dataStructure );
+         BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getProducerId(), dataOut );
+        looseMarshalCachedObject( wireFormat, info->getDestination(), dataOut );
+        looseMarshalObjectArray( wireFormat, info->getBrokerPath(), dataOut );
+        dataOut->writeBoolean( info->isDispatchAsync() );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/RemoveInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/RemoveInfoMarshaller.cpp?view=diff&rev=510313&r1=510312&r2=510313
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/RemoveInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/marshal/v2/RemoveInfoMarshaller.cpp Wed Feb 21 15:41:51 2007
@@ -48,53 +48,83 @@
 ///////////////////////////////////////////////////////////////////////////////
 void RemoveInfoMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+    try {
 
-    RemoveInfo* info =
-        dynamic_cast<RemoveInfo*>( dataStructure );
-    info->setObjectId( dynamic_cast< DataStructure* >(
-        tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+        BaseCommandMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+        RemoveInfo* info =
+            dynamic_cast<RemoveInfo*>( dataStructure );
+        info->setObjectId( dynamic_cast< DataStructure* >(
+            tightUnmarshalCachedObject( wireFormat, dataIn, bs ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 int RemoveInfoMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( io::IOException ) {
 
-    RemoveInfo* info =
-        dynamic_cast<RemoveInfo*>( dataStructure );
+    try {
+
+        RemoveInfo* info =
+            dynamic_cast<RemoveInfo*>( dataStructure );
 
-    int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
-    rc += tightMarshalCachedObject1( wireFormat, info->getObjectId(), bs );
+        int rc = BaseCommandMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+        rc += tightMarshalCachedObject1( wireFormat, info->getObjectId(), bs );
 
-    return rc + 0;
+        return rc + 0;
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void RemoveInfoMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+    try {
 
-    RemoveInfo* info =
-        dynamic_cast<RemoveInfo*>( dataStructure );
-    tightMarshalCachedObject2( wireFormat, info->getObjectId(), dataOut, bs );
+        BaseCommandMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+        RemoveInfo* info =
+            dynamic_cast<RemoveInfo*>( dataStructure );
+        tightMarshalCachedObject2( wireFormat, info->getObjectId(), dataOut, bs );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void RemoveInfoMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( io::IOException ) {
 
-    BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
-    RemoveInfo* info =
-        dynamic_cast<RemoveInfo*>( dataStructure );
-    info->setObjectId( dynamic_cast< DataStructure* >( 
-        looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+    try {
+
+        BaseCommandMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+        RemoveInfo* info =
+            dynamic_cast<RemoveInfo*>( dataStructure );
+        info->setObjectId( dynamic_cast< DataStructure* >( 
+            looseUnmarshalCachedObject( wireFormat, dataIn ) ) );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 void RemoveInfoMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( io::IOException ) {
 
-    RemoveInfo* info =
-        dynamic_cast<RemoveInfo*>( dataStructure );
-    BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+    try {
 
-    looseMarshalCachedObject( wireFormat, info->getObjectId(), dataOut );
+        RemoveInfo* info =
+            dynamic_cast<RemoveInfo*>( dataStructure );
+         BaseCommandMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+
+        looseMarshalCachedObject( wireFormat, info->getObjectId(), dataOut );
+    }
+    AMQ_CATCH_RETHROW( io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, io::IOException )
+    AMQ_CATCHALL_THROW( io::IOException )
 }
 



Mime
View raw message