activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r593929 [1/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
Author: tabish
Date: Sun Nov 11 08:52:45 2007
New Revision: 593929

URL: http://svn.apache.org/viewvc?rev=593929&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorException.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMapRegistrar.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResource.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResourceListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerMessageListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/ProducerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/SessionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/TransactionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/BrokerException.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorException.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormat.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormat.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormatFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormatFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireResponseBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireResponseBuilder.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireSessionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQQueue.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQQueue.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQStreamMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQStreamMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempDestination.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempQueue.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTempTopic.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTopic.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTopic.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/BrokerError.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/DataStreamMarshaller.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/MarshalAware.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/HexTable.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/HexTable.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandReader.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandReader.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorException.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConsumerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompDestination.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompFrame.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompProducerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompQueue.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSelector.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSelector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompTopic.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompTransactionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbortCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbstractCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AckCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BeginCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommitCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/DisconnectCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ErrorCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/MessageCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ReceiptCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/TextMessageCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/MarshalException.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshalable.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/marshal/Marshaler.h
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQTransaction.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingInputStream.h
    activemq/activemq-cpp/trunk/src/main/activemq/io/LoggingOutputStream.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandIOException.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandReader.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/CommandWriter.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/MockTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportExceptionListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/AsyncSendTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/FutureResponse.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelator.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h
    activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
    activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h
    activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatFactory.h
    activemq/activemq-cpp/trunk/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h
    activemq/activemq-cpp/trunk/src/test/activemq/transport/filters/ResponseCorrelatorTest.h

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.cpp Sun Nov 11 08:52:45 2007
@@ -24,27 +24,25 @@
 using namespace activemq::connector;
 using namespace activemq::exceptions;
 
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
 ///////////////////////////////////////////////////////////////////////////////
-BaseConnectorResource::BaseConnectorResource()
-{
+BaseConnectorResource::BaseConnectorResource() {
     this->connector = NULL;
     this->closed = false;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-BaseConnectorResource::BaseConnectorResource( Connector* connector )
-{
+BaseConnectorResource::BaseConnectorResource( Connector* connector ) {
     this->connector = connector;
     this->closed = false;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-BaseConnectorResource::~BaseConnectorResource()
-{}
+void BaseConnectorResource::close() throw ( cms::CMSException ) {
 
-///////////////////////////////////////////////////////////////////////////////
-void BaseConnectorResource::close() throw ( cms::CMSException )
-{
     try {
 
         if( closed == true ) {
@@ -72,6 +70,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/BaseConnectorResource.h Sun Nov 11 08:52:45 2007
@@ -40,7 +40,7 @@
         Connector* connector;
 
         /** Set of ConnectorResourceListeners to call back */
-        std::set< ConnectorResourceListener* > listeners;
+        std::set<ConnectorResourceListener*> listeners;
 
         /** Have we been closed already */
         bool closed;
@@ -59,7 +59,7 @@
          */
         BaseConnectorResource( Connector* connector );
 
-        virtual ~BaseConnectorResource();
+        virtual ~BaseConnectorResource() {}
 
         /**
          * Handles the close of the Resource which calls back to the

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h Sun Nov 11 08:52:45 2007
@@ -47,11 +47,8 @@
 namespace connector{
 
     // Forward declarations.
-    class Connector
-    :
-        public cms::Startable,
-        public cms::Closeable
-    {
+    class Connector : public cms::Startable,
+                      public cms::Closeable {
     protected:
 
         // Flags the state we are in for connection to broker.
@@ -75,7 +72,7 @@
 
     public:
 
-        virtual ~Connector() {};
+        virtual ~Connector() {}
 
         /**
          * Gets the Client Id for this connection, if this

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorException.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorException.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 CONNECTOREXCEPTION_H_
-#define CONNECTOREXCEPTION_H_
+#ifndef _ACTIVEMQ_CONNECTOR_CONNECTOREXCEPTION_H_
+#define _ACTIVEMQ_CONNECTOR_CONNECTOREXCEPTION_H_
 
 #include <activemq/exceptions/ActiveMQException.h>
 
@@ -25,10 +25,9 @@
     /*
      * Signals that an Connector exception of some sort has occurred.
      */
-    class ConnectorException : public exceptions::ActiveMQException
-    {
+    class ConnectorException : public exceptions::ActiveMQException {
     public:
-   
+
         /**
          * Default Constructor
          */
@@ -39,8 +38,7 @@
          * @param ex the exception to copy
          */
         ConnectorException( const exceptions::ActiveMQException& ex ) throw()
-        : exceptions::ActiveMQException()
-        {
+        : exceptions::ActiveMQException() {
             *(ActiveMQException*)this = ex;
         }
 
@@ -49,8 +47,7 @@
          * @param ex the exception to copy, which is an instance of this type
          */
         ConnectorException( const ConnectorException& ex ) throw()
-        : exceptions::ActiveMQException()
-        {
+        : exceptions::ActiveMQException() {
             *(exceptions::ActiveMQException*)this = ex;
         }
 
@@ -60,32 +57,32 @@
          * @param lineNumber line where the exception occured
          * @param msg the message that was generated
          */
-        ConnectorException( const char* file, 
-                            const int lineNumber, 
+        ConnectorException( const char* file,
+                            const int lineNumber,
                             const char* msg, ... ) throw()
-        : exceptions::ActiveMQException()
-        {
+        : 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 ConnectorException* clone() const{
             return new ConnectorException( *this );
         }
-        
-   	    virtual ~ConnectorException() throw() {}
-   
+
+        virtual ~ConnectorException() throw() {}
+
     };
 
 }}
 
-#endif /*CONNECTOREXCEPTION_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_CONNECTOREXCEPTION_H_*/

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

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.cpp Sun Nov 11 08:52:45 2007
@@ -21,36 +21,32 @@
 using namespace activemq::connector;
 
 ////////////////////////////////////////////////////////////////////////////////
-ConnectorFactoryMap* ConnectorFactoryMap::getInstance(void)
-{
+ConnectorFactoryMap* ConnectorFactoryMap::getInstance() {
+
     // Static instance of this Map, create here so that one will
-    // always exist, the one and only Connector Map.      
+    // always exist, the one and only Connector Map.
     static ConnectorFactoryMap instance;
-    
+
     return &instance;
-} 
+}
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectorFactoryMap::registerConnectorFactory( const std::string& name, 
-                                                    ConnectorFactory* factory )
-{
+void ConnectorFactoryMap::registerConnectorFactory( const std::string& name,
+                                                    ConnectorFactory* factory ) {
     factoryMap[name] = factory;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectorFactoryMap::unregisterConnectorFactory( const std::string& name )
-{
+void ConnectorFactoryMap::unregisterConnectorFactory( const std::string& name ) {
     factoryMap.erase( name );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ConnectorFactory* ConnectorFactoryMap::lookup( const std::string& name ) 
-{
-    std::map<std::string, ConnectorFactory*>::const_iterator itr = 
+ConnectorFactory* ConnectorFactoryMap::lookup( const std::string& name ) {
+    std::map<std::string, ConnectorFactory*>::const_iterator itr =
         factoryMap.find( name );
 
-    if( itr != factoryMap.end() )
-    {
+    if( itr != factoryMap.end() ) {
         return itr->second;
     }
 
@@ -60,15 +56,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 std::size_t ConnectorFactoryMap::getFactoryNames(
-   std::vector<std::string>& factoryList )
-{
+   std::vector<std::string>& factoryList ) {
+
     std::map<std::string, ConnectorFactory*>::const_iterator itr =
         factoryMap.begin();
-      
-    for( ; itr != factoryMap.end(); ++itr )
-    {
+
+    for( ; itr != factoryMap.end(); ++itr ) {
         factoryList.insert( factoryList.end(), itr->first );
     }
-      
+
     return factoryMap.size();
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMap.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 CONNECTORFACTORYMAP_H_
-#define CONNECTORFACTORYMAP_H_
+#ifndef _ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAP_H_
+#define _ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAP_H_
 
 #include <map>
 #include <vector>
@@ -32,23 +32,22 @@
      * find the associated factory.  This class does not take ownership
      * of the stored factories, they must be deallocated somewhere.
      */
-    class ConnectorFactoryMap
-    {
+    class ConnectorFactoryMap {
     public:
-      
+
         /**
          * Gets a singleton instance of this class.
          */
-        static ConnectorFactoryMap* getInstance(void);
+        static ConnectorFactoryMap* getInstance();
 
         /**
          * Registers a new Connector Factory with this map
          * @param name to associate the factory with
          * @param factory to store.
         */
-        void registerConnectorFactory( const std::string& name, 
+        void registerConnectorFactory( const std::string& name,
                                        ConnectorFactory* factory );
-      
+
         /**
          * Unregisters a Connector Factory with this map
          * @param name of the factory to remove
@@ -61,7 +60,7 @@
          * @return the factory assciated with the name, or NULL
          */
         ConnectorFactory* lookup( const std::string& name );
-      
+
         /**
          * Fetch a list of factory names that this Map contains
          * @param factoryList vector object to receive the list
@@ -70,24 +69,24 @@
         std::size_t getFactoryNames( std::vector< std::string >& factoryList );
 
     private:
-   
+
         // Hidden Contrustor, prevents instantiation
         ConnectorFactoryMap() {};
-      
+
         // Hidden Destructor.
         virtual ~ConnectorFactoryMap() {};
- 
+
         // Hidden Copy Constructore
         ConnectorFactoryMap( const ConnectorFactoryMap& factoryMap );
-      
+
         // Hidden Assignment operator
         ConnectorFactoryMap operator=( const ConnectorFactoryMap& factoryMap );
 
         // Map of Factories
         std::map< std::string, ConnectorFactory* > factoryMap;
-      
+
     };
 
 }}
 
-#endif /*CONNECTORFACTORYMAP_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAP_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMapRegistrar.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMapRegistrar.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMapRegistrar.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorFactoryMapRegistrar.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 CONNECTORFACTORYMAPREGISTRAR_H_
-#define CONNECTORFACTORYMAPREGISTRAR_H_
+#ifndef _ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAPREGISTRAR_H_
+#define _ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAPREGISTRAR_H_
 
 #include <string>
 
@@ -28,47 +28,45 @@
      * Registers the passed in factory into the factory map, this class
      * can manage the lifetime of the registered factory (default behaviour).
      */
-    class ConnectorFactoryMapRegistrar
-    {
+    class ConnectorFactoryMapRegistrar {
     public:
-   
-        /** 
+
+        /**
          * Constructor for this class
          * @param name of the factory to register
          * @param factory the factory
-         * @param manageLifetime boolean indicating if this object manages the 
+         * @param manageLifetime boolean indicating if this object manages the
          * lifetime of the factory that is being registered.
          */
-        ConnectorFactoryMapRegistrar( const std::string& name, 
+        ConnectorFactoryMapRegistrar( const std::string& name,
                                       ConnectorFactory* factory,
-                                      bool manageLifetime = true )
-        {       
+                                      bool manageLifetime = true ) {
+
             // Register it in the map.
             ConnectorFactoryMap::getInstance()->
                 registerConnectorFactory(name, factory);
 
-            // Store for later deletion            
-            this->factory        = factory;
+            // Store for later deletion
+            this->factory = factory;
             this->manageLifetime = manageLifetime;
-            this->name           = name;
+            this->name = name;
         }
-      
-        virtual ~ConnectorFactoryMapRegistrar(void)
-        {
-            try
-            {
+
+        virtual ~ConnectorFactoryMapRegistrar() {
+
+            try{
+
                 // UnRegister it in the map.
                 ConnectorFactoryMap::getInstance()->
                     unregisterConnectorFactory( name );
-            
-                if( manageLifetime )
-                {
+
+                if( manageLifetime ) {
                     delete factory;
                 }
             }
             catch(...) {}
         }
-      
+
         /**
          * get a reference to the factory that this class is holding
          * @return reference to a factory class
@@ -76,15 +74,15 @@
         virtual ConnectorFactory& getFactory(void) {
             return *factory;
         }
-      
+
     private:
-      
-        std::string       name;
+
+        std::string name;
         ConnectorFactory* factory;
-        bool              manageLifetime;
+        bool manageLifetime;
+
+    };
 
-    }; 
-      
 }}
 
-#endif /*CONNECTORFACTORYMAPREGISTRAR_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_CONNECTORFACTORYMAPREGISTRAR_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResource.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResource.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResource.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResource.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_
-#define ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_
+#ifndef _ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_
+#define _ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_
 
 #include <cms/Closeable.h>
 #include <activemq/connector/ConnectorResourceListener.h>
@@ -38,7 +38,6 @@
      * <code>ConnectorResouceListener</code> from its owner.
      */
     class ConnectorResource : public cms::Closeable {
-
     public:
 
         virtual ~ConnectorResource() {}
@@ -71,4 +70,4 @@
 
 }}
 
-#endif /*ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_CONNECTORRESOURCE_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResourceListener.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResourceListener.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResourceListener.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConnectorResourceListener.h Sun Nov 11 08:52:45 2007
@@ -29,7 +29,6 @@
      * Listener of events from a connector resource.
      */
     class ConnectorResourceListener {
-
     public:
 
         virtual ~ConnectorResourceListener() {}

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

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerMessageListener.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerMessageListener.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerMessageListener.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/ConsumerMessageListener.h Sun Nov 11 08:52:45 2007
@@ -30,7 +30,7 @@
     class ConsumerMessageListener{
     public:
 
-        virtual ~ConsumerMessageListener(){}
+        virtual ~ConsumerMessageListener() {}
 
         /**
          * Called to dispatch a message to a particular consumer.
@@ -38,9 +38,8 @@
          * @param msg the message to be dispatched. the receiver owns this
          * destroy it.
          */
-        virtual void onConsumerMessage(
-            ConsumerInfo* consumer,
-            core::ActiveMQMessage* msg ) = 0;
+        virtual void onConsumerMessage( ConsumerInfo* consumer,
+                                        core::ActiveMQMessage* msg ) = 0;
 
     };
 

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

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

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

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/BrokerException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/BrokerException.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/BrokerException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/BrokerException.h Sun Nov 11 08:52:45 2007
@@ -25,24 +25,27 @@
 namespace activemq{
 namespace connector{
 namespace openwire{
-    
+
     class BrokerException : public OpenWireConnectorException {
     public:
-    
-        BrokerException() throw(){}
+
+        BrokerException() throw() {}
+
         BrokerException( const exceptions::ActiveMQException& ex ) throw()
             : OpenWireConnectorException(){
             *( exceptions::ActiveMQException* )this = ex;
         }
+
         BrokerException( const BrokerException& ex ) throw()
             : OpenWireConnectorException(){
             *( exceptions::ActiveMQException* )this = ex;
         }
+
         BrokerException( const char* file,
                                     const int lineNumber,
                                     const char* msg, ... ) throw()
-            : OpenWireConnectorException()
-        {
+          : OpenWireConnectorException() {
+
             va_list vargs;
             va_start( vargs, msg );
             buildMessage( msg, vargs );
@@ -50,29 +53,29 @@
             // Set the first mark for this exception.
             setMark( file, lineNumber );
         }
-        
-        BrokerException( const char* file, 
-                         const int lineNumber, 
+
+        BrokerException( const char* file,
+                         const int lineNumber,
                          const commands::BrokerError* error ) throw()
-            : OpenWireConnectorException()
-        {
+          : OpenWireConnectorException() {
+
             std::ostringstream ostream;
             ostream << "*** BEGIN SERVER-SIDE STACK TRACE ***" << std::endl;
             ostream << "Message: " << error->getMessage() << std::endl;
             ostream << "Cause: " << error->getCause() << std::endl;
             ostream << "Exception Class " << error->getExceptionClass() << std::endl;
-            
+
             const std::vector<commands::BrokerError::StackTraceElement*>& trace = error->getStackTraceElements();
             for( std::size_t ix=0; ix<trace.size(); ++ix ){
                 commands::BrokerError::StackTraceElement* element = trace[ix];
                 ostream << "\t[FILE: " << element->FileName << ", LINE: " << element->LineNumber
                     << "] occurred in: " << element->ClassName << "." << element->MethodName << std::endl;
             }
-            
+
             ostream << "*** END SERVER-SIDE STACK TRACE ***";
-            
-            setMessage( ostream.str().c_str() );            
-            setMark( file, lineNumber );            
+
+            setMessage( ostream.str().c_str() );
+            setMark( file, lineNumber );
         }
 
         /**
@@ -80,13 +83,13 @@
          * to preserve the type of the original exception as well as the message.
          * All subclasses should override.
          */
-        virtual exceptions::ActiveMQException* clone() const{
+        virtual BrokerException* clone() const{
             return new BrokerException( *this );
         }
 
         virtual ~BrokerException() throw() {}
     };
-    
+
 }}}
 
 #endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_BROKEREXCEPTION_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp Sun Nov 11 08:52:45 2007
@@ -22,16 +22,18 @@
 
 using namespace std;
 using namespace activemq;
-using namespace decaf::util::concurrent;
 using namespace activemq::connector;
 using namespace activemq::connector::openwire;
 using namespace activemq::transport;
 using namespace activemq::exceptions;
 using namespace decaf::io;
+using namespace decaf::util::concurrent;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-OpenWireCommandReader::OpenWireCommandReader()
-{
+OpenWireCommandReader::OpenWireCommandReader() {
+
     this->inputStream = NULL;
     this->openWireFormat = NULL;
     this->dataInputStream = NULL;
@@ -39,15 +41,13 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 OpenWireCommandReader::OpenWireCommandReader( InputStream* inputStream,
-                                              OpenWireFormat* openWireFormat )
-{
+                                              OpenWireFormat* openWireFormat ) {
     this->setInputStream( inputStream );
     this->openWireFormat = openWireFormat;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 OpenWireCommandReader::~OpenWireCommandReader() {
-
     if( dataInputStream != NULL ) {
         delete dataInputStream;
     }
@@ -55,14 +55,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 Command* OpenWireCommandReader::readCommand()
-    throw ( CommandIOException )
-{
-    try
-    {
+    throw ( CommandIOException ) {
+
+    try{
+
         if( inputStream == NULL ||
             dataInputStream == NULL ||
-            openWireFormat == NULL)
-        {
+            openWireFormat == NULL) {
+
             throw IOException(
                 __FILE__, __LINE__,
                 "OpenwireCommandReader::read(char*,int) - class not properly initialized" );
@@ -72,17 +72,17 @@
     }
     AMQ_CATCH_RETHROW( CommandIOException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 size_t OpenWireCommandReader::read( unsigned char* buffer, size_t count )
-   throw( decaf::io::IOException )
-{
-    try
-    {
-        if( inputStream == NULL )
-        {
+   throw( decaf::io::IOException ) {
+
+    try{
+
+        if( inputStream == NULL ) {
             throw IOException(
                 __FILE__, __LINE__,
                 "OpenwireCommandReader::read(char*,int) - input stream is NULL" );
@@ -92,16 +92,16 @@
     }
     AMQ_CATCH_RETHROW( IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
     AMQ_CATCHALL_THROW( IOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char OpenWireCommandReader::readByte() throw( decaf::io::IOException )
-{
-    try
-    {
-        if( inputStream == NULL )
-        {
+unsigned char OpenWireCommandReader::readByte() throw( decaf::io::IOException ) {
+
+    try{
+
+        if( inputStream == NULL ) {
             throw IOException(
                 __FILE__, __LINE__,
                 "OpenwireCommandReader::read(char*,int) - "
@@ -114,5 +114,6 @@
     }
     AMQ_CATCH_RETHROW( IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
     AMQ_CATCHALL_THROW( IOException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandReader.h Sun Nov 11 08:52:45 2007
@@ -19,18 +19,18 @@
 #define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDREADER_H_
 
 #include <activemq/transport/CommandReader.h>
-#include <decaf/io/InputStream.h>
-#include <decaf/io/DataInputStream.h>
 #include <activemq/transport/CommandIOException.h>
 #include <activemq/transport/Command.h>
 #include <activemq/connector/openwire/OpenWireFormat.h>
 
+#include <decaf/io/InputStream.h>
+#include <decaf/io/DataInputStream.h>
+
 namespace activemq{
 namespace connector{
 namespace openwire{
 
-    class OpenWireCommandReader : public transport::CommandReader
-    {
+    class OpenWireCommandReader : public transport::CommandReader {
     private:
 
         /**

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp Sun Nov 11 08:52:45 2007
@@ -25,6 +25,7 @@
 using namespace activemq::transport;
 using namespace activemq::exceptions;
 using namespace decaf::io;
+using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -37,8 +38,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 OpenWireCommandWriter::OpenWireCommandWriter( OutputStream* outputStream,
-                                              OpenWireFormat* openWireFormat )
-{
+                                              OpenWireFormat* openWireFormat ) {
+
     this->setOutputStream( outputStream );
     this->openWireFormat = openWireFormat;
 }
@@ -53,14 +54,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireCommandWriter::writeCommand( Command* command )
-    throw ( transport::CommandIOException )
-{
-    try
-    {
+    throw ( transport::CommandIOException ) {
+
+    try{
+
         if( outputStream == NULL ||
             dataOutputStream == NULL ||
-            openWireFormat == NULL )
-        {
+            openWireFormat == NULL ) {
+
             throw CommandIOException(
                 __FILE__, __LINE__,
                 "OpenWireCommandWriter::writeCommand - "
@@ -74,32 +75,43 @@
     }
     AMQ_CATCH_RETHROW( CommandIOException )
     AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, CommandIOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, CommandIOException )
     AMQ_CATCHALL_THROW( CommandIOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireCommandWriter::write( const unsigned char* buffer, size_t count )
-    throw( IOException )
-{
-    if( outputStream == NULL )
-    {
+    throw( IOException ) {
+
+    if( outputStream == NULL ) {
         throw IOException(
             __FILE__, __LINE__,
             "OpenWireCommandWriter::write(char*,int) - input stream is NULL" );
     }
 
-    outputStream->write( buffer, 0, count );
+    try{
+        outputStream->write( buffer, 0, count );
+    }
+    AMQ_CATCH_RETHROW( IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
+    AMQ_CATCHALL_THROW( IOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireCommandWriter::writeByte( unsigned char v ) throw( IOException )
-{
-    if( outputStream == NULL )
-    {
+void OpenWireCommandWriter::writeByte( unsigned char v ) throw( IOException ) {
+
+    if( outputStream == NULL ) {
         throw IOException(
             __FILE__, __LINE__,
             "OpenWireCommandWriter::write(char) - input stream is NULL" );
     }
 
-    outputStream->write( v );
+    try{
+        outputStream->write( v );
+    }
+    AMQ_CATCH_RETHROW( IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( ActiveMQException, IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
+    AMQ_CATCHALL_THROW( IOException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireCommandWriter.h Sun Nov 11 08:52:45 2007
@@ -18,10 +18,10 @@
 #ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDWRITER_H_
 #define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECOMMANDWRITER_H_
 
+#include <activemq/connector/openwire/OpenWireFormat.h>
 #include <activemq/transport/CommandWriter.h>
 #include <activemq/transport/CommandIOException.h>
 #include <activemq/transport/Command.h>
-#include <activemq/connector/openwire/OpenWireFormat.h>
 #include <decaf/io/OutputStream.h>
 #include <decaf/io/DataOutputStream.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp Sun Nov 11 08:52:45 2007
@@ -70,10 +70,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 OpenWireConnector::OpenWireConnector( Transport* transport,
                                       const decaf::util::Properties& properties )
-    throw ( IllegalArgumentException )
-{
-    if( transport == NULL )
-    {
+    throw ( IllegalArgumentException ) {
+
+    if( transport == NULL ) {
         throw IllegalArgumentException(
             __FILE__, __LINE__,
             "OpenWireConnector::OpenWireConnector - Transport cannot be NULL");
@@ -106,8 +105,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-OpenWireConnector::~OpenWireConnector()
-{
+OpenWireConnector::~OpenWireConnector() {
     try {
 
         close();
@@ -118,14 +116,13 @@
         delete brokerWireFormatInfo;
     }
     AMQ_CATCH_NOTHROW( ActiveMQException )
+    AMQ_CATCH_NOTHROW( Exception )
     AMQ_CATCHALL_NOTHROW( )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::enforceConnected() throw ( ConnectorException )
-{
-    if( state != CONNECTION_STATE_CONNECTED )
-    {
+void OpenWireConnector::enforceConnected() throw ( ConnectorException ) {
+    if( state != CONNECTION_STATE_CONNECTED ) {
         throw OpenWireConnectorException(
             __FILE__, __LINE__,
             "OpenWireConnector::enforceConnected - Not Connected!" );
@@ -133,14 +130,13 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::start() throw( cms::CMSException )
-{
-    try
-    {
-        synchronized( &mutex )
-        {
-            if( state == CONNECTION_STATE_CONNECTED )
-            {
+void OpenWireConnector::start() throw( cms::CMSException ) {
+
+    try{
+
+        synchronized( &mutex ) {
+
+            if( state == CONNECTION_STATE_CONNECTED ) {
                 throw ActiveMQException(
                     __FILE__, __LINE__,
                     "OpenWireConnector::start - already started" );
@@ -154,14 +150,15 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::close() throw( cms::CMSException ){
 
-    try
-    {
+    try{
+
         if( state == CONNECTION_STATE_DISCONNECTED ){
             return;
         }
@@ -176,14 +173,15 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::connect() throw (ConnectorException)
-{
-    try
-    {
+void OpenWireConnector::connect() throw ( ConnectorException ) {
+
+    try{
+
         // Mark this connector as started.
         state = CONNECTION_STATE_CONNECTING;
 
@@ -214,14 +212,15 @@
         delete response;
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::disconnect() throw (ConnectorException)
-{
-    try
-    {
+void OpenWireConnector::disconnect() throw ( ConnectorException ) {
+
+    try{
+
         // Mark state as no longer connected.
         state = CONNECTION_STATE_DISCONNECTED;
 
@@ -236,6 +235,10 @@
         try{ transport->close(); } catch( ... ){}
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+        try{ transport->close(); } catch( ... ){}
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         try{ transport->close(); } catch( ... ){}
         throw OpenWireConnectorException(__FILE__, __LINE__,
@@ -246,10 +249,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 connector::SessionInfo* OpenWireConnector::createSession(
     cms::Session::AcknowledgeMode ackMode )
-        throw( ConnectorException )
-{
-    try
-    {
+        throw( ConnectorException ) {
+
+    try{
+
         enforceConnected();
 
         // Create and initialize a new SessionInfo object
@@ -288,6 +291,7 @@
         }
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -297,13 +301,13 @@
     connector::SessionInfo* session,
     const std::string& selector,
     bool noLocal )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     OpenWireConsumerInfo* consumer = NULL;
     commands::ConsumerInfo* consumerInfo = NULL;
 
-    try
-    {
+    try{
+
         enforceConnected();
 
         consumer = new OpenWireConsumerInfo( this );
@@ -331,13 +335,16 @@
     } catch( ConnectorException& ex ) {
         delete consumer;
         delete consumerInfo;
-
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
+    } catch( Exception& ex ) {
+        delete consumer;
+        delete consumerInfo;
+        ex.setMark( __FILE__, __LINE__ );
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         delete consumer;
         delete consumerInfo;
-
         throw OpenWireConnectorException( __FILE__, __LINE__,
             "caught unknown exception" );
     }
@@ -350,13 +357,13 @@
     const std::string& name,
     const std::string& selector,
     bool noLocal )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     OpenWireConsumerInfo* consumer = NULL;
     commands::ConsumerInfo* consumerInfo = NULL;
 
-    try
-    {
+    try{
+
         enforceConnected();
 
         consumer = new OpenWireConsumerInfo( this );
@@ -388,6 +395,12 @@
 
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
+    } catch( Exception& ex ) {
+        delete consumer;
+        delete consumerInfo;
+
+        ex.setMark( __FILE__, __LINE__ );
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         delete consumer;
         delete consumerInfo;
@@ -398,8 +411,8 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::applyDestinationOptions( commands::ConsumerInfo* info )
-{
+void OpenWireConnector::applyDestinationOptions( commands::ConsumerInfo* info ) {
+
     const commands::ActiveMQDestination* amqDestination = info->getDestination();
 
     // Get any options specified in the destination and apply them to the
@@ -409,8 +422,7 @@
     std::string noLocalStr =
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_NOLOCAL );
-    if( options.hasProperty( noLocalStr ) )
-    {
+    if( options.hasProperty( noLocalStr ) ) {
         info->setNoLocal(
             Boolean::parseBoolean(
                 options.getProperty( noLocalStr ) ) );
@@ -420,8 +432,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_SELECTOR );
 
-    if( options.hasProperty( selectorStr ) )
-    {
+    if( options.hasProperty( selectorStr ) ) {
         info->setSelector(
             options.getProperty( selectorStr ) );
     }
@@ -430,8 +441,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_PRIORITY );
 
-    if( options.hasProperty( priorityStr ) )
-    {
+    if( options.hasProperty( priorityStr ) ) {
         info->setPriority(
             Integer::parseInt(
                 options.getProperty( priorityStr ) ) );
@@ -441,8 +451,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_DISPATCHASYNC );
 
-    if( options.hasProperty( dispatchAsyncStr ) )
-    {
+    if( options.hasProperty( dispatchAsyncStr ) ) {
         info->setDispatchAsync(
             Boolean::parseBoolean(
                 options.getProperty( dispatchAsyncStr ) ) );
@@ -452,8 +461,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_EXCLUSIVE );
 
-    if( options.hasProperty( exclusiveStr ) )
-    {
+    if( options.hasProperty( exclusiveStr ) ) {
         info->setExclusive(
             Boolean::parseBoolean(
                 options.getProperty( exclusiveStr ) ) );
@@ -463,8 +471,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CUNSUMER_MAXPENDINGMSGLIMIT );
 
-    if( options.hasProperty( maxPendingMsgLimitStr ) )
-    {
+    if( options.hasProperty( maxPendingMsgLimitStr ) ) {
         info->setMaximumPendingMessageLimit(
             Integer::parseInt(
                 options.getProperty( maxPendingMsgLimitStr ) ) );
@@ -474,8 +481,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_PREFECTCHSIZE );
 
-    if( info->getPrefetchSize() <= 0 || options.hasProperty( prefetchSizeStr )  )
-    {
+    if( info->getPrefetchSize() <= 0 || options.hasProperty( prefetchSizeStr )  ) {
         info->setPrefetchSize(
             Integer::parseInt(
                 options.getProperty( prefetchSizeStr, "1000" ) ) );
@@ -485,8 +491,7 @@
         core::ActiveMQConstants::toString(
             core::ActiveMQConstants::CONSUMER_RETROACTIVE );
 
-    if( options.hasProperty( retroactiveStr ) )
-    {
+    if( options.hasProperty( retroactiveStr ) ) {
         info->setRetroactive(
             Boolean::parseBoolean(
                 options.getProperty( retroactiveStr ) ) );
@@ -494,8 +499,7 @@
 
     std::string browserStr = "consumer.browser";
 
-    if( options.hasProperty( browserStr ) )
-    {
+    if( options.hasProperty( browserStr ) ) {
         info->setBrowser(
             Boolean::parseBoolean(
                 options.getProperty( browserStr ) ) );
@@ -503,8 +507,7 @@
 
     std::string networkSubscriptionStr = "consumer.networkSubscription";
 
-    if( options.hasProperty( networkSubscriptionStr ) )
-    {
+    if( options.hasProperty( networkSubscriptionStr ) ) {
         info->setNetworkSubscription(
             Boolean::parseBoolean(
                 options.getProperty( networkSubscriptionStr ) ) );
@@ -512,8 +515,7 @@
 
     std::string optimizedAcknowledgeStr = "consumer.optimizedAcknowledge";
 
-    if( options.hasProperty( optimizedAcknowledgeStr ) )
-    {
+    if( options.hasProperty( optimizedAcknowledgeStr ) ) {
         info->setOptimizedAcknowledge(
             Boolean::parseBoolean(
                 options.getProperty( optimizedAcknowledgeStr ) ) );
@@ -521,8 +523,7 @@
 
     std::string noRangeAcksStr = "consumer.noRangeAcks";
 
-    if( options.hasProperty( noRangeAcksStr ) )
-    {
+    if( options.hasProperty( noRangeAcksStr ) ) {
         info->setNoRangeAcks(
             Boolean::parseBoolean(
                 options.getProperty( noRangeAcksStr ) ) );
@@ -533,12 +534,14 @@
 commands::ConsumerInfo* OpenWireConnector::createConsumerInfo(
     const cms::Destination* destination,
     connector::SessionInfo* session )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     commands::ConsumerInfo* consumerInfo = NULL;
 
-    try
-    {
+    try{
+
+        enforceConnected();
+
         consumerInfo = new commands::ConsumerInfo();
         commands::ConsumerId* consumerId = new commands::ConsumerId();
         consumerInfo->setConsumerId( consumerId );
@@ -566,6 +569,11 @@
 
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
+    } catch( Exception& ex ) {
+        delete consumerInfo;
+
+        ex.setMark( __FILE__, __LINE__ );
+        throw OpenWireConnectorException( ex );
     } catch( std::exception& ex ) {
         delete consumerInfo;
 
@@ -584,8 +592,8 @@
 void OpenWireConnector::startConsumer( ConsumerInfo* consumer )
     throw ( ConnectorException ) {
 
-    try
-    {
+    try{
+
         enforceConnected();
 
         OpenWireConsumerInfo* consumerInfo =
@@ -617,6 +625,7 @@
         consumerInfo->setStarted( true );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -624,13 +633,13 @@
 ProducerInfo* OpenWireConnector::createProducer(
     const cms::Destination* destination,
     connector::SessionInfo* session )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     OpenWireProducerInfo* producer = NULL;
     commands::ProducerInfo* producerInfo = NULL;
 
-    try
-    {
+    try{
+
         enforceConnected();
 
         producer = new OpenWireProducerInfo( this );
@@ -682,6 +691,12 @@
 
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
+    } catch( Exception& ex ) {
+        delete producer;
+        delete producerInfo;
+
+        ex.setMark( __FILE__, __LINE__ );
+        throw OpenWireConnectorException( ex );
     } catch( std::exception& ex ) {
         delete producer;
         delete producerInfo;
@@ -700,27 +715,24 @@
 ////////////////////////////////////////////////////////////////////////////////
 cms::Topic* OpenWireConnector::createTopic( const std::string& name,
                                             connector::SessionInfo* session AMQCPP_UNUSED )
-    throw ( ConnectorException )
-{
-    try
-    {
-        enforceConnected();
+    throw ( ConnectorException ) {
 
+    try{
+        enforceConnected();
         return new commands::ActiveMQTopic( name );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 cms::Queue* OpenWireConnector::createQueue( const std::string& name,
                                             connector::SessionInfo* session AMQCPP_UNUSED )
-    throw ( ConnectorException )
-{
-    try
-    {
-        enforceConnected();
+    throw ( ConnectorException ) {
 
+    try{
+        enforceConnected();
         return new commands::ActiveMQQueue( name );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
@@ -730,10 +742,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 cms::TemporaryTopic* OpenWireConnector::createTemporaryTopic(
     connector::SessionInfo* session AMQCPP_UNUSED )
-        throw ( ConnectorException, UnsupportedOperationException )
-{
-    try
-    {
+        throw ( ConnectorException, UnsupportedOperationException ) {
+
+    try{
+
         enforceConnected();
 
         commands::ActiveMQTempTopic* topic = new
@@ -745,16 +757,17 @@
         return topic;
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 cms::TemporaryQueue* OpenWireConnector::createTemporaryQueue(
     connector::SessionInfo* session AMQCPP_UNUSED )
-        throw ( ConnectorException, UnsupportedOperationException )
-{
-    try
-    {
+        throw ( ConnectorException, UnsupportedOperationException ) {
+
+    try{
+
         enforceConnected();
 
         commands::ActiveMQTempQueue* queue = new
@@ -766,16 +779,17 @@
         return queue;
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::send( cms::Message* message,
                               ProducerInfo* producerInfo )
-    throw ( ConnectorException )
-{
-    try
-    {
+    throw ( ConnectorException ) {
+
+    try{
+
         enforceConnected();
 
         OpenWireProducerInfo* producer =
@@ -792,8 +806,7 @@
         commands::Message* amqMessage =
             dynamic_cast< commands::Message* >( message );
 
-        if( amqMessage == NULL )
-        {
+        if( amqMessage == NULL ) {
             throw OpenWireConnectorException(
                 __FILE__, __LINE__,
                 "OpenWireConnector::send - "
@@ -849,6 +862,12 @@
 
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+
+        try{ transport->close(); } catch( ... ){}
+
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
 
         try{ transport->close(); } catch( ... ){}
@@ -861,20 +880,20 @@
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::send( std::list<cms::Message*>& messages,
                               ProducerInfo* producerInfo )
-    throw ( ConnectorException )
-{
-    try
-    {
+    throw ( ConnectorException ) {
+
+    try{
+
         enforceConnected();
 
         list< cms::Message* >::const_iterator itr = messages.begin();
 
-        for( ; itr != messages.end(); ++itr )
-        {
+        for( ; itr != messages.end(); ++itr ) {
             this->send( *itr, producerInfo );
         }
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -883,9 +902,9 @@
                                      const ConsumerInfo* consumer,
                                      const cms::Message* message,
                                      AckType ackType )
-    throw ( ConnectorException )
-{
-    try {
+    throw ( ConnectorException ) {
+
+    try{
 
         const commands::Message* amqMessage =
             dynamic_cast<const commands::Message*>( message );
@@ -948,6 +967,11 @@
 
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+        try{ transport->close(); } catch( ... ){}
+
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         try{ transport->close(); } catch( ... ){}
 
@@ -959,8 +983,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 TransactionInfo* OpenWireConnector::startTransaction(
     connector::SessionInfo* session )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     try {
 
         enforceConnected();
@@ -990,6 +1014,10 @@
         try{ transport->close(); } catch( ... ){}
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+        try{ transport->close(); } catch( ... ){}
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         try{ transport->close(); } catch( ... ){}
 
@@ -1001,10 +1029,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::commit( TransactionInfo* transaction,
                                 SessionInfo* session AMQCPP_UNUSED )
-    throw ( ConnectorException )
-{
-    try
-    {
+    throw ( ConnectorException ) {
+
+    try{
+
         enforceConnected();
 
         OpenWireTransactionInfo* transactionInfo =
@@ -1027,6 +1055,10 @@
         try{ transport->close(); } catch( ... ){}
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+        try{ transport->close(); } catch( ... ){}
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         try{ transport->close(); } catch( ... ){}
 
@@ -1038,10 +1070,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::rollback( TransactionInfo* transaction,
                                   SessionInfo* session AMQCPP_UNUSED )
-    throw ( ConnectorException )
-{
-    try
-    {
+    throw ( ConnectorException ) {
+
+    try{
+
         enforceConnected();
 
         OpenWireTransactionInfo* transactionInfo =
@@ -1064,6 +1096,10 @@
         try{ transport->close(); } catch( ... ){}
         ex.setMark(__FILE__,__LINE__);
         throw ex;
+    } catch( Exception& ex ){
+        try{ transport->close(); } catch( ... ){}
+        ex.setMark(__FILE__,__LINE__);
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         try{ transport->close(); } catch( ... ){}
 
@@ -1076,12 +1112,13 @@
 cms::Message* OpenWireConnector::createMessage(
     connector::SessionInfo* session AMQCPP_UNUSED,
     TransactionInfo* transaction AMQCPP_UNUSED )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     try {
         return new commands::ActiveMQMessage();
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1089,12 +1126,13 @@
 cms::BytesMessage* OpenWireConnector::createBytesMessage(
     connector::SessionInfo* session AMQCPP_UNUSED,
     TransactionInfo* transaction AMQCPP_UNUSED )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     try {
         return new commands::ActiveMQBytesMessage();
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1102,12 +1140,13 @@
 cms::TextMessage* OpenWireConnector::createTextMessage(
     connector::SessionInfo* session AMQCPP_UNUSED,
     TransactionInfo* transaction AMQCPP_UNUSED )
-        throw ( ConnectorException )
-{
+        throw ( ConnectorException ) {
+
     try {
         return new commands::ActiveMQTextMessage();
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1115,19 +1154,20 @@
 cms::MapMessage* OpenWireConnector::createMapMessage(
     connector::SessionInfo* session AMQCPP_UNUSED,
     TransactionInfo* transaction AMQCPP_UNUSED )
-        throw ( ConnectorException, UnsupportedOperationException )
-{
+        throw ( ConnectorException, UnsupportedOperationException ) {
+
     try {
         return new commands::ActiveMQMapMessage();
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::unsubscribe( const std::string& name )
-    throw ( ConnectorException, UnsupportedOperationException )
-{
+    throw ( ConnectorException, UnsupportedOperationException ) {
+
     commands::RemoveSubscriptionInfo* rsi = NULL;
 
     try {
@@ -1151,6 +1191,11 @@
 
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
+    } catch( Exception& ex ) {
+        delete rsi;
+
+        ex.setMark( __FILE__, __LINE__ );
+        throw OpenWireConnectorException( ex );
     } catch( ... ) {
         delete rsi;
 
@@ -1161,8 +1206,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::closeResource( ConnectorResource* resource )
-    throw ( ConnectorException )
-{
+    throw ( ConnectorException ) {
+
     try {
 
         // if we don't get a resource or we aren't connected then we can't do
@@ -1222,14 +1267,15 @@
         ex.setMark(__FILE__, __LINE__ );
         throw ex;
     }
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenWireConnector::onCommand( transport::Command* command )
-{
-    try
-    {
+void OpenWireConnector::onCommand( transport::Command* command ) {
+
+    try{
+
         if( typeid( *command ) == typeid( commands::MessageDispatch ) ) {
 
             commands::MessageDispatch* dispatch =
@@ -1297,24 +1343,24 @@
             } catch( ... ) { /* do nothing */ }
 
             delete command;
-        }
-        else
-        {
+
+        } else {
             //LOGDECAF_WARN( logger, "Received an unknown command" );
             delete command;
         }
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::onTransportException(
     transport::Transport* source AMQCPP_UNUSED,
-    const exceptions::ActiveMQException& ex )
-{
-    try
-    {
+    const decaf::lang::Exception& ex ) {
+
+    try {
+
         // We're disconnected - the asynchronous error is expected.
         if( state == CONNECTION_STATE_DISCONNECTED ){
             return;
@@ -1332,28 +1378,30 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::oneway( Command* command )
-    throw ( ConnectorException )
-{
+    throw ( ConnectorException ) {
+
     try {
         transport->oneway(command);
     }
     AMQ_CATCH_EXCEPTION_CONVERT( CommandIOException, OpenWireConnectorException )
     AMQ_CATCH_EXCEPTION_CONVERT( UnsupportedOperationException, OpenWireConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Response* OpenWireConnector::syncRequest( Command* command )
-    throw ( ConnectorException )
-{
-    try
-    {
+    throw ( ConnectorException ) {
+
+    try {
+
         Response* response = transport->request( command );
 
         commands::ExceptionResponse* exceptionResponse =
             dynamic_cast<commands::ExceptionResponse*>( response );
-        if( exceptionResponse != NULL )
-        {
+
+        if( exceptionResponse != NULL ) {
+
             // Create an exception to hold the error information.
             commands::BrokerError* brokerError =
                 dynamic_cast<commands::BrokerError*>(
@@ -1370,23 +1418,24 @@
         // Nothing bad happened - just return the response.
         return response;
     }
+    AMQ_CATCH_RETHROW( ConnectorException )
     AMQ_CATCH_EXCEPTION_CONVERT( CommandIOException, OpenWireConnectorException )
     AMQ_CATCH_EXCEPTION_CONVERT( UnsupportedOperationException, OpenWireConnectorException )
-    AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireConnector::disposeOf(
-    commands::DataStructure* objectId ) throw ( ConnectorException )
-{
-    try
-    {
+    commands::DataStructure* objectId ) throw ( ConnectorException ) {
+
+    try{
         commands::RemoveInfo command;
         command.setObjectId( objectId->cloneDataStructure() );
         oneway( &command );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1413,6 +1462,7 @@
         tempDestination->setConnector( this );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1437,6 +1487,7 @@
         delete response;
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1449,6 +1500,7 @@
                Long::toString( tempDestinationIds.getNextSequenceId() );
     }
     AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
     AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }
 
@@ -1456,10 +1508,15 @@
 commands::TransactionId* OpenWireConnector::createLocalTransactionId()
     throw ( ConnectorException ) {
 
-    commands::LocalTransactionId* id = new commands::LocalTransactionId();
+    try{
+        commands::LocalTransactionId* id = new commands::LocalTransactionId();
 
-    id->setConnectionId( connectionInfo.getConnectionId()->cloneDataStructure() );
-    id->setValue( transactionIds.getNextSequenceId() );
+        id->setConnectionId( connectionInfo.getConnectionId()->cloneDataStructure() );
+        id->setValue( transactionIds.getNextSequenceId() );
 
-    return id;
+        return id;
+    }
+    AMQ_CATCH_RETHROW( ConnectorException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, OpenWireConnectorException )
+    AMQ_CATCHALL_THROW( OpenWireConnectorException )
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h Sun Nov 11 08:52:45 2007
@@ -52,7 +52,6 @@
 
 #include <activemq/connector/openwire/OpenWireCommandReader.h>
 #include <activemq/connector/openwire/OpenWireCommandWriter.h>
-#include <activemq/connector/openwire/OpenWireFormat.h>
 #include <activemq/connector/openwire/OpenWireFormatNegotiator.h>
 #include <activemq/connector/openwire/OpenWireConsumerInfo.h>
 
@@ -67,11 +66,11 @@
 namespace connector{
 namespace openwire{
 
-    class OpenWireConnector :
-        public Connector,
-        public transport::CommandListener,
-        public transport::TransportExceptionListener
-    {
+    class OpenWireFormat;
+
+    class OpenWireConnector : public Connector,
+                              public transport::CommandListener,
+                              public transport::TransportExceptionListener {
     private:
 
         // Enumeration of Transaction State flags
@@ -192,12 +191,12 @@
          * Sends the connect message to the broker and
          * waits for the response.
          */
-        void connect() throw (ConnectorException);
+        void connect() throw ( ConnectorException );
 
         /**
          * Sends a oneway disconnect message to the broker.
          */
-        void disconnect() throw (ConnectorException);
+        void disconnect() throw ( ConnectorException );
 
         /**
          * Fires a consumer message to the observer.
@@ -577,7 +576,7 @@
          */
         virtual void onTransportException(
             transport::Transport* source,
-            const exceptions::ActiveMQException& ex );
+            const decaf::lang::Exception& ex );
 
     private:
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorException.h?rev=593929&r1=593928&r2=593929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnectorException.h Sun Nov 11 08:52:45 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_
-#define ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_
+#ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_
+#define _ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_
 
 #include <activemq/connector/ConnectorException.h>
 
@@ -27,24 +27,26 @@
     /*
      * Signals that an Connector exception of some sort has occurred.
      */
-    class OpenWireConnectorException : public connector::ConnectorException
-    {
+    class OpenWireConnectorException : public connector::ConnectorException {
     public:
 
         OpenWireConnectorException() throw(){}
+
         OpenWireConnectorException( const exceptions::ActiveMQException& ex ) throw()
             : connector::ConnectorException(){
             *( exceptions::ActiveMQException* )this = ex;
         }
+
         OpenWireConnectorException( const OpenWireConnectorException& ex ) throw()
             : connector::ConnectorException(){
             *( exceptions::ActiveMQException* )this = ex;
         }
+
         OpenWireConnectorException( const char* file,
                                     const int lineNumber,
                                     const char* msg, ... ) throw()
-            : connector::ConnectorException()
-        {
+            : connector::ConnectorException() {
+
             va_list vargs;
             va_start( vargs, msg );
             buildMessage( msg, vargs );
@@ -58,7 +60,7 @@
          * to preserve the type of the original exception as well as the message.
          * All subclasses should override.
          */
-        virtual exceptions::ActiveMQException* clone() const{
+        virtual OpenWireConnectorException* clone() const{
             return new OpenWireConnectorException( *this );
         }
 
@@ -68,4 +70,4 @@
 
 }}}
 
-#endif /*ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_OPENWIRE_OPENWIRECONNECTOREXCEPTION_H_*/



Mime
View raw message