activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r734228 [2/2] - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/connector/openwire/ main/activemq/connector/stomp/ main/activemq/connector/stomp/commands/ main/activemq/connector/stomp/marshal/ main/activemq/transport/ main/activem...
Date Tue, 13 Jan 2009 20:14:45 GMT
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h Tue Jan 13 12:13:51 2009
@@ -20,12 +20,27 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/wireformat/WireFormat.h>
+#include <activemq/wireformat/stomp/StompFrame.h>
+#include <activemq/wireformat/stomp/marshal/Marshaler.h>
+#include <decaf/io/IOException.h>
 
 namespace activemq {
 namespace wireformat {
 namespace stomp {
 
     class AMQCPP_API StompWireFormat : public WireFormat {
+    private:
+
+        /**
+         * Vector Object used to buffer data
+         */
+        std::vector<unsigned char> buffer;
+
+        /**
+         * Marshaler of Stomp Commands
+         */
+        marshal::Marshaler marshaler;
+
     public:
 
         StompWireFormat();
@@ -81,6 +96,38 @@
         virtual WireFormatNegotiator* createNegotiator( transport::Transport* transport )
             throw( decaf::lang::exceptions::UnsupportedOperationException );
 
+    private:
+
+        /**
+         * Read the Stomp Command from the Frame
+         * @param reference to a Stomp Frame
+         * @throws StompConnectorException
+         */
+        void readStompCommandHeader( StompFrame& frame, decaf::io::DataInputStream* in )
+            throw ( decaf::io::IOException );
+
+        /**
+         * Read all the Stomp Headers for the incoming Frame
+         * @param Frame to place data into
+         * @throws StompConnectorException
+         */
+        void readStompHeaders( StompFrame& frame, decaf::io::DataInputStream* in )
+            throw ( decaf::io::IOException );
+
+        /**
+         * Reads a Stomp Header line and stores it in the buffer object
+         * @return number of bytes read, zero if there was a problem.
+         * @throws StompConnectorException
+         */
+        std::size_t readStompHeaderLine( decaf::io::DataInputStream* in ) throw ( decaf::io::IOException );
+
+        /**
+         * Reads the Stomp Body from the Wire and store it in the frame.
+         * @param Stomp Frame to place data in
+         */
+        void readStompBody( StompFrame& frame, decaf::io::DataInputStream* in )
+            throw ( decaf::io::IOException );
+
     };
 
 }}}

Added: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.cpp?rev=734228&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.cpp Tue Jan 13 12:13:51 2009
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "CommandConstants.h"
+#include <stdio.h>
+#include <string.h>
+
+#include <activemq/connector/stomp/StompTopic.h>
+#include <activemq/connector/stomp/StompQueue.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::stomp;
+using namespace activemq::wireformat::stomp::commands;
+using namespace activemq::connector::stomp;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+const char* CommandConstants::queuePrefix = "/queue/";
+const char* CommandConstants::topicPrefix = "/topic/";
+
+////////////////////////////////////////////////////////////////////////////////
+string CommandConstants::StaticInitializer::stompHeaders[NUM_STOMP_HEADERS];
+string CommandConstants::StaticInitializer::commands[NUM_COMMANDS];
+string CommandConstants::StaticInitializer::ackModes[NUM_ACK_MODES];
+string CommandConstants::StaticInitializer::msgTypes[NUM_MSG_TYPES];
+map<std::string, CommandConstants::StompHeader> CommandConstants::StaticInitializer::stompHeaderMap;
+map<std::string, CommandConstants::CommandId> CommandConstants::StaticInitializer::commandMap;
+map<std::string, CommandConstants::AckMode> CommandConstants::StaticInitializer::ackModeMap;
+map<std::string, CommandConstants::MessageType> CommandConstants::StaticInitializer::msgTypeMap;
+CommandConstants::StaticInitializer CommandConstants::staticInits;
+
+////////////////////////////////////////////////////////////////////////////////
+CommandConstants::StaticInitializer::StaticInitializer(){
+
+    stompHeaders[HEADER_DESTINATION] = "destination";
+    stompHeaders[HEADER_TRANSACTIONID] = "transaction";
+    stompHeaders[HEADER_CONTENTLENGTH] = "content-length";
+    stompHeaders[HEADER_SESSIONID] = "session";
+    stompHeaders[HEADER_RECEIPTID] = "receipt-id";
+    stompHeaders[HEADER_RECEIPT_REQUIRED] = "receipt";
+    stompHeaders[HEADER_MESSAGEID] = "message-id";
+    stompHeaders[HEADER_ACK] = "ack";
+    stompHeaders[HEADER_LOGIN] = "login";
+    stompHeaders[HEADER_PASSWORD] = "passcode";
+    stompHeaders[HEADER_CLIENT_ID] = "client-id";
+    stompHeaders[HEADER_MESSAGE] = "message";
+    stompHeaders[HEADER_CORRELATIONID] = "correlation-id";
+    stompHeaders[HEADER_REQUESTID] = "request-id";
+    stompHeaders[HEADER_RESPONSEID] = "response-id";
+    stompHeaders[HEADER_EXPIRES] = "expires";
+    stompHeaders[HEADER_PERSISTENT] = "persistent";
+    stompHeaders[HEADER_JMSPRIORITY] = "priority";
+    stompHeaders[HEADER_CONSUMERPRIORITY] = "activemq.priority";
+    stompHeaders[HEADER_REPLYTO] = "reply-to";
+    stompHeaders[HEADER_TYPE] = "type";
+    stompHeaders[HEADER_SELECTOR] = "selector";
+    stompHeaders[HEADER_DISPATCH_ASYNC] = "activemq.dispatchAsync";
+    stompHeaders[HEADER_EXCLUSIVE] = "activemq.exclusive";
+    stompHeaders[HEADER_MAXPENDINGMSGLIMIT] = "activemq.maximumPendingMessageLimit";
+    stompHeaders[HEADER_NOLOCAL] = "activemq.noLocal";
+    stompHeaders[HEADER_PREFETCHSIZE] = "activemq.prefetchSize";
+    stompHeaders[HEADER_CONSUMERPRIORITY] = "activemq.priority";
+    stompHeaders[HEADER_RETROACTIVE] = "activemq.retroactive";
+    stompHeaders[HEADER_SUBSCRIPTIONNAME] = "activemq.subcriptionName";
+    stompHeaders[HEADER_TIMESTAMP] = "timestamp";
+    stompHeaders[HEADER_REDELIVERED] = "redelivered";
+    stompHeaders[HEADER_REDELIVERYCOUNT] = "redelivery_count";
+    stompHeaders[HEADER_SELECTOR] = "selector";
+    stompHeaders[HEADER_ID] = "id";
+    stompHeaders[HEADER_SUBSCRIPTION] = "subscription";
+    commands[CONNECT] = "CONNECT";
+    commands[CONNECTED] = "CONNECTED";
+    commands[DISCONNECT] = "DISCONNECT";
+    commands[SUBSCRIBE] = "SUBSCRIBE";
+    commands[UNSUBSCRIBE] = "UNSUBSCRIBE";
+    commands[MESSAGE] = "MESSAGE";
+    commands[SEND] = "SEND";
+    commands[BEGIN] = "BEGIN";
+    commands[COMMIT] = "COMMIT";
+    commands[ABORT] = "ABORT";
+    commands[ACK] = "ACK";
+    commands[ERROR_CMD] = "ERROR";
+    commands[RECEIPT] = "RECEIPT";
+    ackModes[ACK_CLIENT] = "client";
+    ackModes[ACK_AUTO] = "auto";
+    msgTypes[TEXT] = "text";
+    msgTypes[BYTES] = "bytes";
+
+    for( int ix=0; ix<NUM_STOMP_HEADERS; ++ix ){
+        stompHeaderMap[stompHeaders[ix]] = (StompHeader)ix;
+    }
+
+    for( int ix=0; ix<NUM_COMMANDS; ++ix ){
+        commandMap[commands[ix]] = (CommandId)ix;
+    }
+
+    for( int ix=0; ix<NUM_ACK_MODES; ++ix ){
+        ackModeMap[ackModes[ix]] = (AckMode)ix;
+    }
+
+    for( int ix=0; ix<NUM_MSG_TYPES; ++ix ){
+        msgTypeMap[msgTypes[ix]] = (MessageType)ix;
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms::Destination* CommandConstants::toDestination( const std::string& dest )
+    throw ( decaf::lang::exceptions::IllegalArgumentException )
+{
+    std::size_t qpos = dest.find( queuePrefix );
+    std::size_t tpos = dest.find( topicPrefix );
+
+    if( tpos == 0 ) {
+        return new StompTopic(dest.substr(strlen(topicPrefix)));
+    } else if( qpos == 0 ) {
+        return new StompQueue(dest.substr(strlen(queuePrefix)));
+    } else {
+        throw IllegalArgumentException(
+            __FILE__, __LINE__,
+            "CommandConstants::toDestination - Not a valid Stomp Dest [%s]", dest.c_str());
+    }
+}
+
+

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.h?rev=734228&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.h Tue Jan 13 12:13:51 2009
@@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _ACTIVEMQ_WIREFORMAT_STOMP_COMMANDS_COMMANDCONSTANTS_H_
+#define _ACTIVEMQ_WIREFORMAT_STOMP_COMMANDS_COMMANDCONSTANTS_H_
+
+#include <cms/Destination.h>
+#include <activemq/util/Config.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+
+#include <string>
+#include <map>
+
+namespace activemq{
+namespace wireformat{
+namespace stomp{
+namespace commands{
+
+    class AMQCPP_API CommandConstants{
+    public:
+
+        enum CommandId{
+            CONNECT,
+            CONNECTED,
+            DISCONNECT,
+            SUBSCRIBE,
+            UNSUBSCRIBE,
+            MESSAGE,
+            SEND,
+            BEGIN,
+            COMMIT,
+            ABORT,
+            ACK,
+            ERROR_CMD,
+            RECEIPT,
+            NUM_COMMANDS
+        };
+
+        enum StompHeader{
+            HEADER_DESTINATION,
+            HEADER_TRANSACTIONID,
+            HEADER_CONTENTLENGTH,
+            HEADER_SESSIONID,
+            HEADER_RECEIPT_REQUIRED,
+            HEADER_RECEIPTID,
+            HEADER_MESSAGEID,
+            HEADER_ACK,
+            HEADER_LOGIN,
+            HEADER_PASSWORD,
+            HEADER_CLIENT_ID,
+            HEADER_MESSAGE,
+            HEADER_CORRELATIONID,
+            HEADER_REQUESTID,
+            HEADER_RESPONSEID,
+            HEADER_EXPIRES,
+            HEADER_PERSISTENT,
+            HEADER_REPLYTO,
+            HEADER_TYPE,
+            HEADER_DISPATCH_ASYNC,
+            HEADER_EXCLUSIVE,
+            HEADER_MAXPENDINGMSGLIMIT,
+            HEADER_NOLOCAL,
+            HEADER_PREFETCHSIZE,
+            HEADER_JMSPRIORITY,
+            HEADER_CONSUMERPRIORITY,
+            HEADER_RETROACTIVE,
+            HEADER_SUBSCRIPTIONNAME,
+            HEADER_TIMESTAMP,
+            HEADER_REDELIVERED,
+            HEADER_REDELIVERYCOUNT,
+            HEADER_SELECTOR,
+            HEADER_ID,
+            HEADER_SUBSCRIPTION,
+            NUM_STOMP_HEADERS
+        };
+
+        enum AckMode{
+            ACK_CLIENT,
+            ACK_AUTO,
+            NUM_ACK_MODES
+        };
+
+        enum MessageType
+        {
+            TEXT,
+            BYTES,
+            NUM_MSG_TYPES
+        };
+
+        static const char* queuePrefix;
+        static const char* topicPrefix;
+
+        static const std::string& toString( const CommandId cmd ){
+            return StaticInitializer::commands[cmd];
+        }
+
+        static CommandId toCommandId( const std::string& cmd ){
+            std::map<std::string, CommandId>::iterator iter =
+                StaticInitializer::commandMap.find(cmd);
+
+            if( iter == StaticInitializer::commandMap.end() ){
+                return NUM_COMMANDS;
+            }
+
+            return iter->second;
+        }
+
+        static bool isCommandId( const std::string& str ){
+            std::map<std::string, CommandId>::iterator iter =
+                StaticInitializer::commandMap.find(str);
+
+            return iter != StaticInitializer::commandMap.end();
+        }
+
+        static std::string toString( const StompHeader header ){
+            return StaticInitializer::stompHeaders[header];
+        }
+
+        static StompHeader toStompHeader( const std::string& header ){
+
+            std::map<std::string, StompHeader>::iterator iter =
+                StaticInitializer::stompHeaderMap.find(header);
+
+            if( iter == StaticInitializer::stompHeaderMap.end() ){
+                return NUM_STOMP_HEADERS;
+            }
+
+            return iter->second;
+        }
+
+        static bool isStompHeader( const std::string& str ){
+            std::map<std::string, StompHeader>::iterator iter =
+                StaticInitializer::stompHeaderMap.find(str);
+
+            return iter != StaticInitializer::stompHeaderMap.end();
+        }
+
+        static std::string toString( const AckMode mode ){
+            return StaticInitializer::ackModes[mode];
+        }
+
+        static AckMode toAckMode( const std::string& mode ){
+            std::map<std::string, AckMode>::iterator iter =
+                StaticInitializer::ackModeMap.find(mode);
+
+            if( iter == StaticInitializer::ackModeMap.end() ){
+                return NUM_ACK_MODES;
+            }
+
+            return iter->second;
+        }
+
+        static std::string toString( const MessageType type ){
+            return StaticInitializer::msgTypes[type];
+        }
+
+        static MessageType toMessageType( const std::string& type ){
+            std::map<std::string, MessageType>::iterator iter =
+                StaticInitializer::msgTypeMap.find(type);
+
+            if( iter == StaticInitializer::msgTypeMap.end() ){
+                return NUM_MSG_TYPES;
+            }
+
+            return iter->second;
+        }
+
+        static cms::Destination* toDestination( const std::string& dest )
+            throw ( decaf::lang::exceptions::IllegalArgumentException );
+
+        class StaticInitializer{
+        public:
+            StaticInitializer();
+            virtual ~StaticInitializer(){}
+
+            static std::string stompHeaders[NUM_STOMP_HEADERS];
+            static std::string commands[NUM_COMMANDS];
+            static std::string ackModes[NUM_ACK_MODES];
+            static std::string msgTypes[NUM_MSG_TYPES];
+            static std::map<std::string, StompHeader> stompHeaderMap;
+            static std::map<std::string, CommandId> commandMap;
+            static std::map<std::string, AckMode> ackModeMap;
+            static std::map<std::string, MessageType> msgTypeMap;
+        };
+
+    private:
+
+        static StaticInitializer staticInits;
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_STOMP_COMMANDS_COMMANDCONSTANTS_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/commands/CommandConstants.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/MarshalException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/MarshalException.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/MarshalException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/MarshalException.h Tue Jan 13 12:13:51 2009
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_MARSHALL_MARSHALEXCEPTION_H_
+#ifndef _ACTIVEMQ_WIREFORMAT_STOMP_MARSHALL_MARSHALEXCEPTION_H_
+#define _ACTIVEMQ_WIREFORMAT_STOMP_MARSHALL_MARSHALEXCEPTION_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
 namespace activemq{
-namespace connector{
+namespace wireformat{
 namespace stomp{
 namespace marshal{
 
@@ -119,4 +119,4 @@
 
 }}}}
 
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALLEXCEPTION_H_*/
+#endif /*_ACTIVEMQ_WIREFORMAT_STOMP_MARSHALL_MARSHALEXCEPTION_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshalable.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshalable.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshalable.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshalable.h Tue Jan 13 12:13:51 2009
@@ -15,15 +15,15 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALABLE_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALABLE_H_
+#ifndef _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_MARSHALABLE_H_
+#define _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_MARSHALABLE_H_
 
 #include <activemq/util/Config.h>
-#include <activemq/connector/stomp/StompFrame.h>
-#include <activemq/connector/stomp/marshal/MarshalException.h>
+#include <activemq/wireformat/stomp/StompFrame.h>
+#include <activemq/wireformat/stomp/marshal/MarshalException.h>
 
 namespace activemq{
-namespace connector{
+namespace wireformat{
 namespace stomp{
 namespace marshal{
 
@@ -37,7 +37,7 @@
          * @returns the stomp frame representation of this
          * command.
          * @throws MarshalException if the command is not
-         * in a state that can be marshalled.
+         * in a state that can be marshaled.
          */
         virtual const StompFrame& marshal(void)
             throw ( marshal::MarshalException ) = 0;
@@ -46,4 +46,4 @@
 
 }}}}
 
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_MARSHAL_MARSHALABLE_H_*/
+#endif /*_ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_MARSHALABLE_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp Tue Jan 13 12:13:51 2009
@@ -15,13 +15,14 @@
  * limitations under the License.
  */
 
-#include <activemq/connector/stomp/marshal/Marshaler.h>
+#include <activemq/wireformat/stomp/marshal/Marshaler.h>
 
 #include <activemq/transport/Command.h>
-#include <activemq/connector/stomp/marshal/MarshalException.h>
 #include <activemq/connector/stomp/commands/CommandConstants.h>
 #include <activemq/connector/stomp/commands/AbstractCommand.h>
-#include <activemq/connector/stomp/StompFrame.h>
+
+#include <activemq/wireformat/stomp/StompFrame.h>
+#include <activemq/wireformat/stomp/marshal/MarshalException.h>
 
 // Commands we can receive
 #include <activemq/connector/stomp/commands/ConnectedCommand.h>
@@ -36,9 +37,10 @@
 using namespace activemq;
 using namespace activemq::exceptions;
 using namespace activemq::transport;
-using namespace activemq::connector::stomp;
 using namespace activemq::connector::stomp::commands;
-using namespace activemq::connector::stomp::marshal;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::stomp;
+using namespace activemq::wireformat::stomp::marshal;
 using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h Tue Jan 13 12:13:51 2009
@@ -15,22 +15,21 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_
+#ifndef _ACTIVEMQ_WIREFORMAT_STOMP_MARSHALER_H_
+#define _ACTIVEMQ_WIREFORMAT_STOMP_MARSHALER_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/Command.h>
-#include <activemq/connector/stomp/StompFrame.h>
-#include <activemq/connector/stomp/marshal/MarshalException.h>
+#include <activemq/wireformat/stomp/StompFrame.h>
+#include <activemq/wireformat/stomp/marshal/MarshalException.h>
 
 namespace activemq{
-namespace connector{
+namespace wireformat{
 namespace stomp{
 namespace marshal{
 
     /**
-     * Interface for all marshallers between Commands and
-     * stomp frames.
+     * Interface for all marshalers between Commands and stomp frames.
      */
     class AMQCPP_API Marshaler {
     public:
@@ -39,9 +38,9 @@
         virtual ~Marshaler(void) {}
 
         /**
-         * Marshall a Stomp Frame to a Stomp Command, the frame is now
+         * Marshal a Stomp Frame to a Stomp Command, the frame is now
          * owned by this Command, caller should not use the frame again.
-         * @param frame Frame to Marshall
+         * @param frame Frame to Marshal
          * @return Newly Marshaled Stomp Message
          * @throws MarshalException
          */
@@ -49,7 +48,7 @@
             throw ( MarshalException );
 
         /**
-         * Marshal a Stomp Command to a Stom Frame, if the command that
+         * Marshal a Stomp Command to a Stomp Frame, if the command that
          * is past is not castable to a Stomp Command an Exception will
          * be thrown
          * @param command The Stomp Command to Marshal
@@ -64,4 +63,4 @@
 
 }}}}
 
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_MARSHALER_H_*/
+#endif /*_ACTIVEMQ_WIREFORMAT_STOMP_MARSHALER_H_*/

Modified: activemq/activemq-cpp/trunk/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/Makefile.am?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/test/Makefile.am Tue Jan 13 12:13:51 2009
@@ -34,8 +34,6 @@
   activemq/connector/stomp/commands/TextMessageCommandTest.cpp \
   activemq/connector/stomp/commands/UnsubscribeCommandTest.cpp \
   activemq/connector/stomp/marshal/MarshalerTest.cpp \
-  activemq/connector/stomp/StompCommandReaderTest.cpp \
-  activemq/connector/stomp/StompCommandWriterTest.cpp \
   activemq/connector/stomp/StompConnectorTest.cpp \
   activemq/connector/stomp/StompFrameTest.cpp \
   activemq/connector/stomp/StompDestinationTest.cpp \
@@ -154,8 +152,6 @@
   activemq/connector/stomp/commands/TextMessageCommandTest.h \
   activemq/connector/stomp/commands/UnsubscribeCommandTest.h \
   activemq/connector/stomp/marshal/MarshalerTest.h \
-  activemq/connector/stomp/StompCommandReaderTest.h \
-  activemq/connector/stomp/StompCommandWriterTest.h \
   activemq/connector/stomp/StompConnectorTest.h \
   activemq/connector/stomp/StompFrameTest.h \
   activemq/connector/stomp/StompDestinationTest.h \

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp Tue Jan 13 12:13:51 2009
@@ -177,7 +177,7 @@
     MyMessageListener listener;
     connector->setConsumerMessageListener( &listener );
 
-    StompFrame* frame = new StompFrame();
+    wireformat::stomp::StompFrame* frame = new wireformat::stomp::StompFrame();
     frame->setCommand( "MESSAGE" );
     frame->getProperties().setProperty(
         "destination", dest1.toProviderString() );
@@ -197,7 +197,7 @@
     // Clean up the consumers list
     listener.consumers.clear();
 
-    frame = new StompFrame();
+    frame = new wireformat::stomp::StompFrame();
     frame->setCommand( "MESSAGE" );
     frame->getProperties().setProperty(
         "destination", dest2.toProviderString() );

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompFrameTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompFrameTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompFrameTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompFrameTest.h Tue Jan 13 12:13:51 2009
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_TEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_TEST_H_
 
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
-#include <activemq/connector/stomp/StompFrame.h>
+#include <activemq/wireformat/stomp/StompFrame.h>
 
 namespace activemq{
 namespace connector{
@@ -40,30 +40,30 @@
 
       void test()
       {
-         StompFrame frame;
-         
+         wireformat::stomp::StompFrame frame;
+
          CPPUNIT_ASSERT( frame.getCommand() == "" );
          frame.setCommand("test");
          CPPUNIT_ASSERT( frame.getCommand() == "test" );
-                  
+
          frame.getProperties().setProperty("key", "value");
-         
+
          std::string result = frame.getProperties().getProperty("key");
-         
-         CPPUNIT_ASSERT( result == "value" );         
-         
+
+         CPPUNIT_ASSERT( result == "value" );
+
          CPPUNIT_ASSERT( frame.getBody().size() == 0 );
          CPPUNIT_ASSERT( frame.getBodyLength() == 0 );
-         
+
          frame.setBody( (unsigned char*)"ABC", 4 );
-         
+
          CPPUNIT_ASSERT( frame.getBody().size() == 4 );
          CPPUNIT_ASSERT( frame.getBodyLength() == 4 );
          CPPUNIT_ASSERT( std::string((char*)&frame.getBody()[0]) == "ABC" );
       }
-      
+
    };
 
 }}}
 
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_*/
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_TEST_H_*/

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AbortCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AbortCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AbortCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AbortCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) ==
                             "ID:123456" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AckCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AckCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AckCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/AckCommandTest.h Tue Jan 13 12:13:51 2009
@@ -61,7 +61,7 @@
             cmd.setMessageId( "ID:123456789" );
             CPPUNIT_ASSERT( std::string( cmd.getMessageId() ) == "ID:123456789" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BeginCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BeginCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BeginCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BeginCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) ==
                             "ID:123456" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h Tue Jan 13 12:13:51 2009
@@ -89,7 +89,7 @@
             CPPUNIT_ASSERT( cmd.getCMSDestination()->toProviderString() ==
                             "/topic/testTopic" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 
@@ -203,7 +203,7 @@
 
         void testReadOnly(){
 
-            StompFrame* frame = new StompFrame();
+            wireformat::stomp::StompFrame* frame = new wireformat::stomp::StompFrame();
             frame->setCommand( CommandConstants::toString( CommandConstants::MESSAGE ) );
             frame->getProperties().setProperty( CommandConstants::toString( CommandConstants::HEADER_DESTINATION ),
                 (std::string)CommandConstants::topicPrefix + "mytopic" );

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/CommitCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/CommitCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/CommitCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/CommitCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) ==
                             "ID:123456" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) ==
                             "ID:123456" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectedCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectedCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectedCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ConnectedCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
                             "ID:123456" );
             
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
             
             CPPUNIT_ASSERT( frame != NULL );
             

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/DisconnectCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/DisconnectCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/DisconnectCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/DisconnectCommandTest.h Tue Jan 13 12:13:51 2009
@@ -58,7 +58,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) ==
                             "ID:123456" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ErrorCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ErrorCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ErrorCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ErrorCommandTest.h Tue Jan 13 12:13:51 2009
@@ -64,7 +64,7 @@
             cmd.setErrorDetails( "ErrorD" );
             CPPUNIT_ASSERT( std::string( cmd.getErrorDetails() ) == "ErrorD" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/MessageCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/MessageCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/MessageCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/MessageCommandTest.h Tue Jan 13 12:13:51 2009
@@ -90,7 +90,7 @@
             StompTopic topic("testTopic");
             cmd.setCMSDestination( &topic );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ReceiptCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ReceiptCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ReceiptCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/ReceiptCommandTest.h Tue Jan 13 12:13:51 2009
@@ -62,7 +62,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getReceiptId() ) ==
                             "456987" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/SubscribeCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/SubscribeCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/SubscribeCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/SubscribeCommandTest.h Tue Jan 13 12:13:51 2009
@@ -78,7 +78,7 @@
             cmd.setNoLocal( true );
             CPPUNIT_ASSERT( cmd.getNoLocal() == true );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/TextMessageCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/TextMessageCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/TextMessageCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/TextMessageCommandTest.h Tue Jan 13 12:13:51 2009
@@ -85,7 +85,7 @@
             StompTopic topic("testTopic");
             cmd.setCMSDestination( &topic );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/UnsubscribeCommandTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/UnsubscribeCommandTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/UnsubscribeCommandTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/commands/UnsubscribeCommandTest.h Tue Jan 13 12:13:51 2009
@@ -61,7 +61,7 @@
             CPPUNIT_ASSERT( std::string( cmd.getDestination() ) ==
                             "456987" );
 
-            StompFrame* frame = cmd.marshal().clone();
+            wireformat::stomp::StompFrame* frame = cmd.marshal().clone();
 
             CPPUNIT_ASSERT( frame != NULL );
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/marshal/MarshalerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/marshal/MarshalerTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/marshal/MarshalerTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/marshal/MarshalerTest.h Tue Jan 13 12:13:51 2009
@@ -26,7 +26,7 @@
 #include <activemq/connector/stomp/commands/ConnectedCommand.h>
 #include <activemq/connector/stomp/commands/TextMessageCommand.h>
 #include <activemq/connector/stomp/commands/BytesMessageCommand.h>
-#include <activemq/connector/stomp/marshal/Marshaler.h>
+#include <activemq/wireformat/stomp/marshal/Marshaler.h>
 
 namespace activemq{
 namespace connector{
@@ -40,18 +40,18 @@
         CPPUNIT_TEST_SUITE_END();
 
     public:
-    
+
     	MarshalerTest() {}
     	virtual ~MarshalerTest() {}
 
         void test( void )
         {
-            Marshaler marshaler;
-            
+            wireformat::stomp::marshal::Marshaler marshaler;
+
             commands::ConnectedCommand   connectedCommand;
             commands::TextMessageCommand textCommand;
             commands::BytesMessageCommand bytesCommand;
-            
+
             // Sync to expected output
             connectedCommand.setSessionId( "test" );
 
@@ -60,23 +60,23 @@
             // Sync to expected output
             textCommand.setCMSDestination( &myTopic );
             textCommand.setCMSMessageID( "123" );
-            textCommand.getProperties().setProperty( 
+            textCommand.getProperties().setProperty(
                 "sampleProperty", "testvalue" );
             textCommand.setText( "testMessage" );
 
             // Sync to expected output
             bytesCommand.setCMSDestination( &myTopic );
             bytesCommand.setCMSMessageID( "123" );
-            bytesCommand.getProperties().setProperty( 
+            bytesCommand.getProperties().setProperty(
                 "sampleProperty", "testvalue" );
-            bytesCommand.setBodyBytes( 
+            bytesCommand.setBodyBytes(
                 (const unsigned char*)"123456789\0", 10 );
-            
-            StompFrame* connectedFrame = 
+
+            wireformat::stomp::StompFrame* connectedFrame =
                 marshaler.marshal( &connectedCommand ).clone();
-            StompFrame* textFrame = 
+            wireformat::stomp::StompFrame* textFrame =
                 marshaler.marshal( &textCommand ).clone();
-            StompFrame* bytesFrame = 
+            wireformat::stomp::StompFrame* bytesFrame =
                 marshaler.marshal( &bytesCommand ).clone();
 
             CPPUNIT_ASSERT( connectedFrame != NULL );
@@ -86,33 +86,33 @@
             commands::ConnectedCommand   connectedCommand1( connectedFrame );
             commands::TextMessageCommand textCommand1( textFrame );
             commands::BytesMessageCommand bytesCommand1( bytesFrame );
-            
+
             // Connected Tests
-            CPPUNIT_ASSERT( connectedCommand.getCommandId() == 
+            CPPUNIT_ASSERT( connectedCommand.getCommandId() ==
                             connectedCommand1.getCommandId() );
-            CPPUNIT_ASSERT( connectedCommand.getStompCommandId() == 
+            CPPUNIT_ASSERT( connectedCommand.getStompCommandId() ==
                             connectedCommand1.getStompCommandId() );
-            CPPUNIT_ASSERT( connectedCommand.isResponseRequired() == 
+            CPPUNIT_ASSERT( connectedCommand.isResponseRequired() ==
                             connectedCommand1.isResponseRequired() );
-            CPPUNIT_ASSERT( connectedCommand.getCorrelationId() == 
+            CPPUNIT_ASSERT( connectedCommand.getCorrelationId() ==
                             connectedCommand1.getCorrelationId() );
 
             // TextMessage Tests
-            CPPUNIT_ASSERT( textCommand.getCommandId() == 
+            CPPUNIT_ASSERT( textCommand.getCommandId() ==
                             textCommand1.getCommandId() );
-            CPPUNIT_ASSERT( textCommand.getStompCommandId() == 
+            CPPUNIT_ASSERT( textCommand.getStompCommandId() ==
                             textCommand1.getStompCommandId() );
-            CPPUNIT_ASSERT( std::string( textCommand.getText() ) == 
+            CPPUNIT_ASSERT( std::string( textCommand.getText() ) ==
                             textCommand1.getText() );
 
             // BytesMessage Tests
-            CPPUNIT_ASSERT( bytesCommand.getCommandId() == 
+            CPPUNIT_ASSERT( bytesCommand.getCommandId() ==
                             bytesCommand1.getCommandId() );
-            CPPUNIT_ASSERT( bytesCommand.getStompCommandId() == 
+            CPPUNIT_ASSERT( bytesCommand.getStompCommandId() ==
                             bytesCommand1.getStompCommandId() );
-            CPPUNIT_ASSERT( std::string( (const char*)bytesCommand.getBodyBytes() ) == 
+            CPPUNIT_ASSERT( std::string( (const char*)bytesCommand.getBodyBytes() ) ==
                             (const char*)bytesCommand1.getBodyBytes() );
-            
+
 
         }
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp Tue Jan 13 12:13:51 2009
@@ -269,12 +269,7 @@
             CPPUNIT_ASSERT( false );
         }
 
-        transport::mock::MockTransport* dTransport =
-            dynamic_cast< transport::mock::MockTransport*>( transport );
-
-        CPPUNIT_ASSERT( dTransport != NULL );
-
-        dTransport->setCommandListener( &cmdListener );
+        transport->setCommandListener( &cmdListener );
 
         connector::Connector* connector =
             new connector::openwire::OpenWireConnector(

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp Tue Jan 13 12:13:51 2009
@@ -522,8 +522,8 @@
                                              const long long timeStamp,
                                              const long long timeToLive )
 {
-    connector::stomp::StompFrame* frame =
-        new connector::stomp::StompFrame();
+    wireformat::stomp::StompFrame* frame =
+        new wireformat::stomp::StompFrame();
     frame->setCommand( "MESSAGE" );
     frame->getProperties().setProperty(
         "destination", destination.toProviderString() );

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp Tue Jan 13 12:13:51 2009
@@ -19,10 +19,9 @@
 
 #include <activemq/transport/IOTransport.h>
 #include <activemq/transport/CommandListener.h>
-#include <activemq/transport/CommandReader.h>
-#include <activemq/transport/CommandWriter.h>
 #include <activemq/transport/Command.h>
 #include <activemq/transport/TransportExceptionListener.h>
+#include <activemq/wireformat/WireFormat.h>
 #include <decaf/util/concurrent/Concurrent.h>
 #include <decaf/util/concurrent/CountDownLatch.h>
 #include <decaf/util/concurrent/Mutex.h>
@@ -86,30 +85,25 @@
 };
 
 ////////////////////////////////////////////////////////////////////////////////
-class MyCommandReader : public CommandReader{
-private:
-
-    /**
-     * The target input stream.
-     */
-    decaf::io::InputStream* inputStream;
-
+class MyWireFormat : public wireformat::WireFormat {
 public:
 
-    MyCommandReader(){ throwException = false; }
-    virtual ~MyCommandReader(){}
+    MyWireFormat(){ throwException = false; }
+    virtual ~MyWireFormat(){}
 
     bool throwException;
 
-    virtual void setInputStream(decaf::io::InputStream* is){
-        inputStream = is;
-    }
+    virtual void setVersion( int version ) {}
 
-    virtual decaf::io::InputStream* getInputStream(void){
-        return inputStream;
-    }
+    virtual int getVersion() const { return 0; }
+
+    virtual bool hasNegotiator() const { return false; }
 
-    virtual Command* readCommand( void ) throw ( CommandIOException ){
+    virtual wireformat::WireFormatNegotiator* createNegotiator( transport::Transport* transport )
+        throw( decaf::lang::exceptions::UnsupportedOperationException ) { return NULL; }
+
+    virtual Command* unmarshal( decaf::io::DataInputStream* inputStream )
+        throw ( CommandIOException ){
 
         try{
             if( throwException ){
@@ -119,6 +113,7 @@
             decaf::util::Random randGen;
 
             synchronized( inputStream ){
+
                 MyCommand* command = new MyCommand();
                 try{
 
@@ -126,7 +121,7 @@
                     unsigned int randWait = randGen.nextInt( 50 );
                     decaf::lang::Thread::sleep( randWait );
 
-                    command->c = inputStream->read();
+                    command->c = inputStream->readByte();
 
                 } catch( decaf::lang::Exception& ex ){
 
@@ -145,7 +140,7 @@
                 return command;
             }
 
-            assert(false);
+            CPPUNIT_ASSERT( false );
             return NULL;
 
         }catch( decaf::lang::Exception& ex ){
@@ -160,48 +155,18 @@
         }
     }
 
-    virtual std::size_t read(unsigned char* buffer AMQCPP_UNUSED,
-                     std::size_t count AMQCPP_UNUSED)
-        throw( decaf::io::IOException ) {
-        return 0;
-    }
-
-    virtual unsigned char readByte() throw(decaf::io::IOException) {
-        return 0;
-    }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-class MyCommandWriter : public CommandWriter{
-private:
-
-    /**
-     * Target output stream.
-     */
-    decaf::io::OutputStream* outputStream;
-
-public:
-
-    virtual ~MyCommandWriter(){}
-
-    virtual void setOutputStream(decaf::io::OutputStream* os){
-        outputStream = os;
-    }
-
-    virtual decaf::io::OutputStream* getOutputStream(void){
-        return outputStream;
-    }
-
-    virtual void writeCommand( Command* command )
+    virtual void marshal( Command* command, decaf::io::DataOutputStream* outputStream )
         throw (CommandIOException)
     {
         try{
+
             synchronized( outputStream ){
 
                 const MyCommand* m =
                     dynamic_cast<const MyCommand*>(command);
                 outputStream->write( m->c );
             }
+
         }catch( decaf::lang::Exception& ex ){
             ex.setMark( __FILE__, __LINE__ );
             throw CommandIOException( ex );
@@ -210,13 +175,6 @@
             throw CommandIOException( __FILE__, __LINE__, "writeCommand");
         }
     }
-
-    virtual void write( const unsigned char* buffer AMQCPP_UNUSED,
-                        std::size_t count AMQCPP_UNUSED )
-        throw(decaf::io::IOException) {}
-
-    virtual void writeByte( unsigned char v AMQCPP_UNUSED )
-        throw( decaf::io::IOException ) {}
 };
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -249,17 +207,16 @@
 
     decaf::io::BlockingByteArrayInputStream is;
     decaf::io::ByteArrayOutputStream os;
+    decaf::io::DataInputStream input( &is );
+    decaf::io::DataOutputStream output( &os );
     MyCommandListener listener;
-    MyCommandReader reader;
-    MyCommandWriter writer;
+    MyWireFormat wireFormat;
     MyExceptionListener exListener;
-    IOTransport transport;
+    IOTransport transport( &wireFormat );
     transport.setCommandListener( &listener );
-    transport.setCommandReader( &reader );
-    transport.setCommandWriter( &writer );
-    transport.setInputStream( &is );
-    transport.setOutputStream( &os );
     transport.setTransportExceptionListener( &exListener );
+    transport.setInputStream( &input );
+    transport.setOutputStream( &output );
 
     transport.start();
     decaf::lang::Thread::sleep( 60 );
@@ -273,20 +230,20 @@
     decaf::io::ByteArrayOutputStream os;
     decaf::io::BufferedInputStream bis( &is );
     decaf::io::BufferedOutputStream bos( &os );
+    decaf::io::DataInputStream input( &bis );
+    decaf::io::DataOutputStream output( &bos );
 
     for( int i = 0; i < 50; ++i ) {
         MyCommandListener listener;
-        MyCommandReader reader;
-        MyCommandWriter writer;
+        MyWireFormat wireFormat;
         MyExceptionListener exListener;
 
         IOTransport transport;
         transport.setCommandListener( &listener );
-        transport.setCommandReader( &reader );
-        transport.setCommandWriter( &writer );
-        transport.setInputStream( &bis );
-        transport.setOutputStream( &bos );
+        transport.setWireFormat( &wireFormat );
         transport.setTransportExceptionListener( &exListener );
+        transport.setInputStream( &input );
+        transport.setOutputStream( &output );
 
         transport.start();
         unsigned char buffer[10] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
@@ -307,17 +264,18 @@
 
     decaf::io::BlockingByteArrayInputStream is;
     decaf::io::ByteArrayOutputStream os;
+    decaf::io::DataInputStream input( &is );
+    decaf::io::DataOutputStream output( &os );
+
     MyCommandListener listener(10);
-    MyCommandReader reader;
-    MyCommandWriter writer;
+    MyWireFormat wireFormat;
     MyExceptionListener exListener;
     IOTransport transport;
     transport.setCommandListener( &listener );
-    transport.setCommandReader( &reader );
-    transport.setCommandWriter( &writer );
-    transport.setInputStream( &is );
-    transport.setOutputStream( &os );
+    transport.setInputStream( &input );
+    transport.setOutputStream( &output );
     transport.setTransportExceptionListener( &exListener );
+    transport.setWireFormat( &wireFormat );
 
     transport.start();
 
@@ -344,17 +302,18 @@
 
     decaf::io::BlockingByteArrayInputStream is;
     decaf::io::ByteArrayOutputStream os;
+    decaf::io::DataInputStream input( &is );
+    decaf::io::DataOutputStream output( &os );
+
     MyCommandListener listener;
-    MyCommandReader reader;
-    MyCommandWriter writer;
+    MyWireFormat wireFormat;
     MyExceptionListener exListener;
     IOTransport transport;
     transport.setCommandListener( &listener );
-    transport.setCommandReader( &reader );
-    transport.setCommandWriter( &writer );
-    transport.setInputStream( &is );
-    transport.setOutputStream( &os );
+    transport.setInputStream( &input );
+    transport.setOutputStream( &output );
     transport.setTransportExceptionListener( &exListener );
+    transport.setWireFormat( &wireFormat );
 
     transport.start();
 
@@ -387,18 +346,19 @@
 
     decaf::io::BlockingByteArrayInputStream is;
     decaf::io::ByteArrayOutputStream os;
+    decaf::io::DataInputStream input( &is );
+    decaf::io::DataOutputStream output( &os );
+
     MyCommandListener listener;
-    MyCommandReader reader;
-    MyCommandWriter writer;
+    MyWireFormat wireFormat;
     MyExceptionListener exListener;
     IOTransport transport;
     transport.setCommandListener( &listener );
-    transport.setCommandReader( &reader );
-    reader.throwException = true;
-    transport.setCommandWriter( &writer );
-    transport.setInputStream( &is );
-    transport.setOutputStream( &os );
+    wireFormat.throwException = true;
+    transport.setInputStream( &input );
+    transport.setOutputStream( &output );
     transport.setTransportExceptionListener( &exListener );
+    transport.setWireFormat( &wireFormat );
 
     unsigned char buffer[1] = { '1' };
     try{

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h Tue Jan 13 12:13:51 2009
@@ -122,8 +122,6 @@
             public Transport,
             public decaf::lang::Runnable{
         public:
-            CommandReader* reader;
-            CommandWriter* writer;
             CommandListener* listener;
             TransportExceptionListener* exListener;
             decaf::lang::Thread* thread;
@@ -135,8 +133,6 @@
         public:
 
             MyTransport(){
-                reader = NULL;
-                writer = NULL;
                 listener = NULL;
                 exListener = NULL;
                 thread = NULL;
@@ -180,12 +176,8 @@
                 this->listener = listener;
             }
 
-            virtual void setCommandReader( CommandReader* reader ){
-                this->reader = reader;
-            }
+            virtual void setWireFormat( wireformat::WireFormat* wireFormat ) {
 
-            virtual void setCommandWriter( CommandWriter* writer ){
-                this->writer = writer;
             }
 
             virtual void setTransportExceptionListener(

Modified: activemq/activemq-cpp/trunk/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/testRegistry.cpp?rev=734228&r1=734227&r2=734228&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/testRegistry.cpp Tue Jan 13 12:13:51 2009
@@ -60,10 +60,6 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompDestinationTest );
 #include <activemq/connector/stomp/StompConnectorTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompConnectorTest );
-#include <activemq/connector/stomp/StompCommandWriterTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompCommandWriterTest );
-#include <activemq/connector/stomp/StompCommandReaderTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompCommandReaderTest );
 
 #include <activemq/commands/BrokerInfoTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::BrokerInfoTest );



Mime
View raw message