activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r505799 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire: OpenWireConnector.cpp OpenWireConnector.h OpenWireConnectorFactory.cpp OpenWireFormat.cpp
Date Sat, 10 Feb 2007 23:55:37 GMT
Author: tabish
Date: Sat Feb 10 15:55:36 2007
New Revision: 505799

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.cpp?view=diff&rev=505799&r1=505798&r2=505799
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.cpp
Sat Feb 10 15:55:36 2007
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-#include <activemq/connector/OpenWire/OpenWireConnector.h>
+#include <activemq/connector/openwire/OpenWireConnector.h>
 
 #include <activemq/concurrent/Concurrent.h>
 #include <activemq/transport/BrokerError.h>
@@ -23,7 +23,8 @@
 #include <activemq/transport/ExceptionResponse.h>
 #include <activemq/exceptions/UnsupportedOperationException.h>
 #include <activemq/util/Integer.h>
-#include <activemq/connector/OpenWire/OpenWireConnectorException.h>
+#include <activemq/connector/openwire/OpenWireConnectorException.h>
+#include <activemq/connector/openwire/OpenWireFormatFactory.h>
 
 using namespace std;
 using namespace activemq;
@@ -45,18 +46,27 @@
             "OpenWireConnector::OpenWireConnector - Transport cannot be NULL");
     }
 
-    this->transport = transport;
+    // Create our WireFormatFactory on the stack, only need it once.
+    OpenWireFormatFactory wireFormatFactory;
+
     this->state = DISCONNECTED;
     this->exceptionListener = NULL;
     this->messageListener = NULL;
     this->nextProducerId = 1;
     this->nextTransactionId = 1;
     this->properties.copy( &properties );
+    this->wireFormat = dynamic_cast<OpenWireFormat*>(
+        wireFormatFactory.createWireFormat( properties ) );
+    this->transport = new OpenWireFormatNegotiator( wireFormat, transport, false );
 
     // Observe the transport for events.
     this->transport->setCommandListener( this );
     this->transport->setTransportExceptionListener( this );
 
+    // Setup the Reader and Writer with a Wire Format pointer.
+    this->reader.setOpenWireFormat( wireFormat );
+    this->writer.setOpenWireFormat( wireFormat );
+
     // Setup the reader and writer in the transport.
     this->transport->setCommandReader( &reader );
     this->transport->setCommandWriter( &writer );
@@ -69,7 +79,8 @@
     {
         close();
 
-        // TODO - Add any cleanup code here
+        delete transport;
+        delete wireFormat;
     }
     AMQ_CATCH_NOTHROW( ActiveMQException )
     AMQ_CATCHALL_NOTHROW( )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.h?view=diff&rev=505799&r1=505798&r2=505799
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnector.h
Sat Feb 10 15:55:36 2007
@@ -51,6 +51,8 @@
 
 #include <activemq/connector/openwire/OpenWireCommandReader.h>
 #include <activemq/connector/openwire/OpenWireCommandWriter.h>
+#include <activemq/connector/openwire/OpenWireFormat.h>
+#include <activemq/connector/openwire/OpenWireFormatNegotiator.h>
 
 namespace activemq{
 namespace connector{
@@ -77,6 +79,12 @@
          * The transport for sending/receiving commands on the wire.
          */
         transport::Transport* transport;
+
+        /**
+         * The OpenWireFormat class that controls Protocal versions and
+         * marshalling details.
+         */
+        OpenWireFormat* wireFormat;
 
         /**
          * Flag to indicate the start state of the connector.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp?view=diff&rev=505799&r1=505798&r2=505799
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConnectorFactory.cpp
Sat Feb 10 15:55:36 2007
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#include <activemq/connector/stomp/OpenWireConnectorFactory.h>
-#include <activemq/connector/stomp/OpenWireConnector.h>
+#include <activemq/connector/openwire/OpenWireConnectorFactory.h>
+#include <activemq/connector/openwire/OpenWireConnector.h>
 #include <activemq/connector/Connector.h>
 #include <activemq/transport/Transport.h>
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp?view=diff&rev=505799&r1=505798&r2=505799
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
Sat Feb 10 15:55:36 2007
@@ -61,9 +61,6 @@
     // Generate an ID
     this->id = Guid::createGUIDString();
 
-    // Mark this as Versions 2 as we don't support version 1 at the moment.
-    this->version = 2;
-
     // parse params out of the properties
     stackTraceEnabled = Boolean::parseBoolean(
         properties.getProperty( "wireFormat.stackTraceEnabled",
@@ -80,10 +77,6 @@
     sizePrefixDisabled = Boolean::parseBoolean(
         properties.getProperty( "wireFormat.sizePrefixDisabled",
                                 "0" ) );
-
-    // Now that we've parsed the properties, lets setup the prefered
-    // WireFormatInfo object.
-    this->setPreferedWireFormatInfo( new WireFormatInfo() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message