Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp Fri Jul 28 01:22:48 2006
@@ -1,460 +1,460 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQMapMessage.hpp"
-#include "ppr/io/ByteArrayOutputStream.hpp"
-#include "ppr/io/ByteArrayInputStream.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- *
- */
-ActiveMQMapMessage::ActiveMQMapMessage()
-{
- contentMap = new PropertyMap() ;
-}
-
-/*
- *
- */
-ActiveMQMapMessage::~ActiveMQMapMessage()
-{
-}
-
-/*
- *
- */
-unsigned char ActiveMQMapMessage::getDataStructureType()
-{
- return ActiveMQMapMessage::TYPE ;
-}
-
-/*
- *
- */
-p<PropertyMap> ActiveMQMapMessage::getBody()
-{
- return contentMap ;
-}
-
-/*
- *
- */
-bool ActiveMQMapMessage::getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = string(name) ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No boolean value available for given key") ;
-
- try
- {
- // Try to get value as a boolean
- return tempIter->second.getBoolean() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setBoolean(const char* name, bool value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- //contentMap->insert (pair<string,p<MapItemHolder> > (key, new MapItemHolder(value)));
- (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- *
- */
-char ActiveMQMapMessage::getByte(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = string(name) ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No byte value available for given key") ;
-
- try
- {
- // Try to get value as a byte
- return tempIter->second.getByte() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setByte(const char* name, char value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- *
- */
-array<char> ActiveMQMapMessage::getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = string(name) ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No byte array value available for given key") ;
-
- try
- {
- // Try to get value as a byte array
- return tempIter->second.getBytes() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setBytes(const char* name, array<char> value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- *
- */
-double ActiveMQMapMessage::getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No double value available for given key") ;
-
- try
- {
- // Try to get value as a double
- return tempIter->second.getDouble() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setDouble(const char* name, double value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-float ActiveMQMapMessage::getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No float value available for given key") ;
-
- try
- {
- // Try to get value as a float
- return tempIter->second.getFloat() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*F
- *
- */
-void ActiveMQMapMessage::setFloat(const char* name, float value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-int ActiveMQMapMessage::getInt(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No integer value available for given key") ;
-
- try
- {
- // Try to get value as an integer
- return tempIter->second.getInt() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setInt(const char* name, int value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-long long ActiveMQMapMessage::getLong(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No long value available for given key") ;
-
- try
- {
- // Try to get value as a long
- return tempIter->second.getLong() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setLong(const char* name, long long value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-short ActiveMQMapMessage::getShort(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No short value available for given key") ;
-
- try
- {
- // Try to get value as a short
- return tempIter->second.getShort() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setShort(const char* name, short value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-p<string> ActiveMQMapMessage::getString(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- if( tempIter == contentMap->end() )
- throw MessageFormatException("No short value available for given key") ;
-
- try
- {
- // Try to get value as a string
- return tempIter->second.getString() ;
- }
- catch( ConversionException ce )
- {
- throw MessageFormatException( ce.what() ) ;
- }
-}
-
-/*
- *
- */
-void ActiveMQMapMessage::setString(const char* name, p<string> value) throw (IllegalArgumentException)
-{
- // Assert arguments
- if( name == NULL || strcmp(name, "") == 0 )
- throw IllegalArgumentException("Invalid key name") ;
-
- string key = name ;
- (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- *
- */
-array<string> ActiveMQMapMessage::getMapNames()
-{
- PropertyMap::iterator tempIter ;
- array<string> keyNames (contentMap->size()) ;
- int index = 0 ;
-
- for( tempIter = contentMap->begin() ;
- tempIter != contentMap->end() ;
- tempIter++ )
- {
- keyNames[index++] = new string(tempIter->first) ;
- }
- return keyNames ;
-}
-
-/*
- *
- */
-bool ActiveMQMapMessage::itemExists(const char* name)
-{
- PropertyMap::iterator tempIter ;
- string key = name ;
-
- // Check if key exists in map
- tempIter = contentMap->find(key) ;
- return ( tempIter != contentMap->end() ) ? true : false ;
-}
-
-/*
- *
- */
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQMapMessage.hpp"
+#include "ppr/io/ByteArrayOutputStream.hpp"
+#include "ppr/io/ByteArrayInputStream.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ */
+ActiveMQMapMessage::ActiveMQMapMessage()
+{
+ contentMap = new PropertyMap() ;
+}
+
+/*
+ *
+ */
+ActiveMQMapMessage::~ActiveMQMapMessage()
+{
+}
+
+/*
+ *
+ */
+unsigned char ActiveMQMapMessage::getDataStructureType()
+{
+ return ActiveMQMapMessage::TYPE ;
+}
+
+/*
+ *
+ */
+p<PropertyMap> ActiveMQMapMessage::getBody()
+{
+ return contentMap ;
+}
+
+/*
+ *
+ */
+bool ActiveMQMapMessage::getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = string(name) ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No boolean value available for given key") ;
+
+ try
+ {
+ // Try to get value as a boolean
+ return tempIter->second.getBoolean() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setBoolean(const char* name, bool value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ //contentMap->insert (pair<string,p<MapItemHolder> > (key, new MapItemHolder(value)));
+ (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ *
+ */
+char ActiveMQMapMessage::getByte(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = string(name) ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No byte value available for given key") ;
+
+ try
+ {
+ // Try to get value as a byte
+ return tempIter->second.getByte() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setByte(const char* name, char value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ *
+ */
+array<char> ActiveMQMapMessage::getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = string(name) ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No byte array value available for given key") ;
+
+ try
+ {
+ // Try to get value as a byte array
+ return tempIter->second.getBytes() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setBytes(const char* name, array<char> value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ *
+ */
+double ActiveMQMapMessage::getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No double value available for given key") ;
+
+ try
+ {
+ // Try to get value as a double
+ return tempIter->second.getDouble() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setDouble(const char* name, double value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+float ActiveMQMapMessage::getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No float value available for given key") ;
+
+ try
+ {
+ // Try to get value as a float
+ return tempIter->second.getFloat() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*F
+ *
+ */
+void ActiveMQMapMessage::setFloat(const char* name, float value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+int ActiveMQMapMessage::getInt(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No integer value available for given key") ;
+
+ try
+ {
+ // Try to get value as an integer
+ return tempIter->second.getInt() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setInt(const char* name, int value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+long long ActiveMQMapMessage::getLong(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No long value available for given key") ;
+
+ try
+ {
+ // Try to get value as a long
+ return tempIter->second.getLong() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setLong(const char* name, long long value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+short ActiveMQMapMessage::getShort(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No short value available for given key") ;
+
+ try
+ {
+ // Try to get value as a short
+ return tempIter->second.getShort() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setShort(const char* name, short value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMapMessage::getString(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ if( tempIter == contentMap->end() )
+ throw MessageFormatException("No short value available for given key") ;
+
+ try
+ {
+ // Try to get value as a string
+ return tempIter->second.getString() ;
+ }
+ catch( ConversionException ce )
+ {
+ throw MessageFormatException( ce.what() ) ;
+ }
+}
+
+/*
+ *
+ */
+void ActiveMQMapMessage::setString(const char* name, p<string> value) throw (IllegalArgumentException)
+{
+ // Assert arguments
+ if( name == NULL || strcmp(name, "") == 0 )
+ throw IllegalArgumentException("Invalid key name") ;
+
+ string key = name ;
+ (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ *
+ */
+array<string> ActiveMQMapMessage::getMapNames()
+{
+ PropertyMap::iterator tempIter ;
+ array<string> keyNames (contentMap->size()) ;
+ int index = 0 ;
+
+ for( tempIter = contentMap->begin() ;
+ tempIter != contentMap->end() ;
+ tempIter++ )
+ {
+ keyNames[index++] = new string(tempIter->first) ;
+ }
+ return keyNames ;
+}
+
+/*
+ *
+ */
+bool ActiveMQMapMessage::itemExists(const char* name)
+{
+ PropertyMap::iterator tempIter ;
+ string key = name ;
+
+ // Check if key exists in map
+ tempIter = contentMap->find(key) ;
+ return ( tempIter != contentMap->end() ) ? true : false ;
+}
+
+/*
+ *
+ */
int ActiveMQMapMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException)
{
int size = 0 ;
@@ -476,9 +476,9 @@
return size ;
}
-/*
- *
- */
+/*
+ *
+ */
void ActiveMQMapMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException)
{
// Note! Message content unmarshalling is done in super class
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp Fri Jul 28 01:22:48 2006
@@ -1,175 +1,175 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_ActiveMQMapMessage_hpp_
-#define ActiveMQ_ActiveMQMapMessage_hpp_
-
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
-#include <map>
-#include <string>
-#include "cms/IMapMessage.hpp"
-#include "cms/MessageFormatException.hpp"
-#include "activemq/command/ActiveMQMessage.hpp"
-#include "ppr/IllegalArgumentException.hpp"
-#include "ppr/io/IOutputStream.hpp"
-#include "ppr/io/IInputStream.hpp"
-#include "ppr/util/MapItemHolder.hpp"
-#include "ppr/util/ifr/array"
-#include "ppr/util/ifr/p"
-
-namespace apache
-{
- namespace activemq
- {
- namespace command
- {
- using namespace ifr;
- using namespace std;
- using namespace apache::cms;
- using namespace apache::ppr;
- using namespace apache::ppr::io;
- using namespace apache::ppr::util;
-
-/*
- *
- */
-class ActiveMQMapMessage : public ActiveMQMessage, public IMapMessage
-{
-private:
- p<string> text ;
- p<PropertyMap> contentMap ;
-
-public:
- const static unsigned char TYPE = 25 ;
-
-public:
- ActiveMQMapMessage() ;
- virtual ~ActiveMQMapMessage() ;
-
- virtual unsigned char getDataStructureType() ;
-
- virtual p<PropertyMap> getBody() ;
- virtual bool getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setBoolean(const char* name, bool value) throw (IllegalArgumentException) ;
- virtual char getByte(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setByte(const char* name, char value) throw (IllegalArgumentException) ;
- virtual array<char> getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setBytes(const char* name, array<char> value) throw (IllegalArgumentException) ;
- virtual double getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setDouble(const char* name, double value) throw (IllegalArgumentException) ;
- virtual float getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setFloat(const char* name, float value) throw (IllegalArgumentException) ;
- virtual int getInt(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setInt(const char* name, int value) throw (IllegalArgumentException) ;
- virtual long long getLong(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setLong(const char* name, long long value) throw (IllegalArgumentException) ;
- virtual short getShort(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setShort(const char* name, short value) throw (IllegalArgumentException) ;
- virtual p<string> getString(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
- virtual void setString(const char* name, p<string> value) throw (IllegalArgumentException) ;
- virtual array<string> getMapNames() ;
- virtual bool itemExists(const char* name) ;
-
- virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
- virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
-
- //
- // The methods below are needed to resolve the multiple
- // inheritance of IMessage.
- virtual void acknowledge() {
- ActiveMQMessage::acknowledge() ;
- } ;
- virtual p<PropertyMap> getProperties() {
- return ActiveMQMessage::getProperties() ;
- } ;
- virtual p<string> getJMSCorrelationID() {
- return ActiveMQMessage::getJMSCorrelationID() ;
- } ;
- virtual void setJMSCorrelationID(const char* correlationId) {
- return ActiveMQMessage::setJMSCorrelationID(correlationId) ;
- } ;
- virtual p<IDestination> getJMSDestination() {
- return ActiveMQMessage::getJMSDestination() ;
- } ;
- virtual long long getJMSExpiration() {
- return ActiveMQMessage::getJMSExpiration() ;
- } ;
- virtual void setJMSExpiration(long long time) {
- return ActiveMQMessage::setJMSExpiration(time) ;
- } ;
- virtual p<string> getJMSMessageID() {
- return ActiveMQMessage::getJMSMessageID() ;
- } ;
- virtual bool getJMSPersistent() {
- return ActiveMQMessage::getJMSPersistent() ;
- } ;
- virtual void setJMSPersistent(bool persistent) {
- return ActiveMQMessage::setJMSPersistent(persistent) ;
- } ;
- virtual unsigned char getJMSPriority() {
- return ActiveMQMessage::getJMSPriority() ;
- } ;
- virtual void setJMSPriority(unsigned char priority) {
- return ActiveMQMessage::setJMSPriority(priority) ;
- } ;
- virtual bool getJMSRedelivered() {
- return ActiveMQMessage::getJMSRedelivered() ;
- } ;
- virtual p<IDestination> getJMSReplyTo() {
- return ActiveMQMessage::getJMSReplyTo() ;
- } ;
- virtual void setJMSReplyTo(p<IDestination> destination) {
- return ActiveMQMessage::setJMSReplyTo(destination) ;
- } ;
- virtual long long getJMSTimestamp() {
- return ActiveMQMessage::getJMSTimestamp() ;
- } ;
- virtual p<string> getJMSType() {
- return ActiveMQMessage::getJMSType() ;
- } ;
- virtual void setJMSType(const char* type) {
- return ActiveMQMessage::setJMSType(type) ;
- } ;
- virtual int getJMSXDeliveryCount() {
- return ActiveMQMessage::getJMSXDeliveryCount() ;
- } ;
- virtual p<string> getJMSXGroupID() {
- return ActiveMQMessage::getJMSXGroupID() ;
- } ;
- virtual void setJMSXGroupID(const char* groupId) {
- return ActiveMQMessage::setJMSXGroupID(groupId) ;
- } ;
- virtual int getJMSXGroupSeq() {
- return ActiveMQMessage::getJMSXGroupSeq() ;
- } ;
- virtual void setJMSXGroupSeq(int sequence) {
- return ActiveMQMessage::setJMSXGroupSeq(sequence) ;
- } ;
- virtual p<string> getJMSXProducerTxID() {
- return ActiveMQMessage::getJMSXProducerTxID() ;
- } ;
-} ;
-
-/* namespace */
- }
- }
-}
-
-#endif /*ActiveMQ_ActiveMQMapMessage_hpp_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_ActiveMQMapMessage_hpp_
+#define ActiveMQ_ActiveMQMapMessage_hpp_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <map>
+#include <string>
+#include "cms/IMapMessage.hpp"
+#include "cms/MessageFormatException.hpp"
+#include "activemq/command/ActiveMQMessage.hpp"
+#include "ppr/IllegalArgumentException.hpp"
+#include "ppr/io/IOutputStream.hpp"
+#include "ppr/io/IInputStream.hpp"
+#include "ppr/util/MapItemHolder.hpp"
+#include "ppr/util/ifr/array"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+ namespace activemq
+ {
+ namespace command
+ {
+ using namespace ifr;
+ using namespace std;
+ using namespace apache::cms;
+ using namespace apache::ppr;
+ using namespace apache::ppr::io;
+ using namespace apache::ppr::util;
+
+/*
+ *
+ */
+class ActiveMQMapMessage : public ActiveMQMessage, public IMapMessage
+{
+private:
+ p<string> text ;
+ p<PropertyMap> contentMap ;
+
+public:
+ const static unsigned char TYPE = 25 ;
+
+public:
+ ActiveMQMapMessage() ;
+ virtual ~ActiveMQMapMessage() ;
+
+ virtual unsigned char getDataStructureType() ;
+
+ virtual p<PropertyMap> getBody() ;
+ virtual bool getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setBoolean(const char* name, bool value) throw (IllegalArgumentException) ;
+ virtual char getByte(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setByte(const char* name, char value) throw (IllegalArgumentException) ;
+ virtual array<char> getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setBytes(const char* name, array<char> value) throw (IllegalArgumentException) ;
+ virtual double getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setDouble(const char* name, double value) throw (IllegalArgumentException) ;
+ virtual float getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setFloat(const char* name, float value) throw (IllegalArgumentException) ;
+ virtual int getInt(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setInt(const char* name, int value) throw (IllegalArgumentException) ;
+ virtual long long getLong(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setLong(const char* name, long long value) throw (IllegalArgumentException) ;
+ virtual short getShort(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setShort(const char* name, short value) throw (IllegalArgumentException) ;
+ virtual p<string> getString(const char* name) throw (MessageFormatException, IllegalArgumentException) ;
+ virtual void setString(const char* name, p<string> value) throw (IllegalArgumentException) ;
+ virtual array<string> getMapNames() ;
+ virtual bool itemExists(const char* name) ;
+
+ virtual int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw (IOException) ;
+ virtual void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw (IOException) ;
+
+ //
+ // The methods below are needed to resolve the multiple
+ // inheritance of IMessage.
+ virtual void acknowledge() {
+ ActiveMQMessage::acknowledge() ;
+ } ;
+ virtual p<PropertyMap> getProperties() {
+ return ActiveMQMessage::getProperties() ;
+ } ;
+ virtual p<string> getJMSCorrelationID() {
+ return ActiveMQMessage::getJMSCorrelationID() ;
+ } ;
+ virtual void setJMSCorrelationID(const char* correlationId) {
+ return ActiveMQMessage::setJMSCorrelationID(correlationId) ;
+ } ;
+ virtual p<IDestination> getJMSDestination() {
+ return ActiveMQMessage::getJMSDestination() ;
+ } ;
+ virtual long long getJMSExpiration() {
+ return ActiveMQMessage::getJMSExpiration() ;
+ } ;
+ virtual void setJMSExpiration(long long time) {
+ return ActiveMQMessage::setJMSExpiration(time) ;
+ } ;
+ virtual p<string> getJMSMessageID() {
+ return ActiveMQMessage::getJMSMessageID() ;
+ } ;
+ virtual bool getJMSPersistent() {
+ return ActiveMQMessage::getJMSPersistent() ;
+ } ;
+ virtual void setJMSPersistent(bool persistent) {
+ return ActiveMQMessage::setJMSPersistent(persistent) ;
+ } ;
+ virtual unsigned char getJMSPriority() {
+ return ActiveMQMessage::getJMSPriority() ;
+ } ;
+ virtual void setJMSPriority(unsigned char priority) {
+ return ActiveMQMessage::setJMSPriority(priority) ;
+ } ;
+ virtual bool getJMSRedelivered() {
+ return ActiveMQMessage::getJMSRedelivered() ;
+ } ;
+ virtual p<IDestination> getJMSReplyTo() {
+ return ActiveMQMessage::getJMSReplyTo() ;
+ } ;
+ virtual void setJMSReplyTo(p<IDestination> destination) {
+ return ActiveMQMessage::setJMSReplyTo(destination) ;
+ } ;
+ virtual long long getJMSTimestamp() {
+ return ActiveMQMessage::getJMSTimestamp() ;
+ } ;
+ virtual p<string> getJMSType() {
+ return ActiveMQMessage::getJMSType() ;
+ } ;
+ virtual void setJMSType(const char* type) {
+ return ActiveMQMessage::setJMSType(type) ;
+ } ;
+ virtual int getJMSXDeliveryCount() {
+ return ActiveMQMessage::getJMSXDeliveryCount() ;
+ } ;
+ virtual p<string> getJMSXGroupID() {
+ return ActiveMQMessage::getJMSXGroupID() ;
+ } ;
+ virtual void setJMSXGroupID(const char* groupId) {
+ return ActiveMQMessage::setJMSXGroupID(groupId) ;
+ } ;
+ virtual int getJMSXGroupSeq() {
+ return ActiveMQMessage::getJMSXGroupSeq() ;
+ } ;
+ virtual void setJMSXGroupSeq(int sequence) {
+ return ActiveMQMessage::setJMSXGroupSeq(sequence) ;
+ } ;
+ virtual p<string> getJMSXProducerTxID() {
+ return ActiveMQMessage::getJMSXProducerTxID() ;
+ } ;
+} ;
+
+/* namespace */
+ }
+ }
+}
+
+#endif /*ActiveMQ_ActiveMQMapMessage_hpp_*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp Fri Jul 28 01:22:48 2006
@@ -1,374 +1,374 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQMessage.hpp"
-#include "ppr/io/ByteArrayOutputStream.hpp"
-#include "ppr/io/ByteArrayInputStream.hpp"
-
-using namespace apache::activemq::command;
-
-
-// Constructors -----------------------------------------------------
-
-
-// Attribute methods ------------------------------------------------
-
-/*
- *
- */
-unsigned char ActiveMQMessage::getDataStructureType()
-{
- return ActiveMQMessage::TYPE ;
-}
-
-/*
- *
- */
-p<IDestination> ActiveMQMessage::getFromDestination()
-{
- return this->destination ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setFromDestination(p<IDestination> destination)
-{
- this->destination = p_dyncast<ActiveMQDestination> (destination) ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setAcknowledger(p<IAcknowledger> acknowledger)
-{
- this->acknowledger = acknowledger ;
-}
-
-/*
- *
- */
-p<PropertyMap> ActiveMQMessage::getProperties()
-{
- if( properties == NULL )
- properties = new PropertyMap() ;
-
- return properties;
-}
-
-/*
- *
- */
-p<string> ActiveMQMessage::getJMSCorrelationID()
-{
- return this->correlationId ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSCorrelationID(const char* correlationId)
-{
- this->correlationId = new string(correlationId) ;
-}
-
-/*
- *
- */
-p<IDestination> ActiveMQMessage::getJMSDestination()
-{
- return this->originalDestination ;
-}
-
-/*
- *
- */
-long long ActiveMQMessage::getJMSExpiration()
-{
- return this->expiration ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSExpiration(long long time)
-{
- this->expiration = time ;
-}
-
-/*
- *
- */
-p<string> ActiveMQMessage::getJMSMessageID()
-{
- p<string> str ;
- p<ProducerId> pid = this->getMessageId()->getProducerId() ;
- char buffer[256] ;
-
- // Compose message id as a string
-#ifdef unix
- sprintf(buffer, "%s:%lld:%lld:%lld", pid->getConnectionId()->c_str(),
- pid->getSessionId(),
- pid->getValue(),
- messageId->getProducerSequenceId() ) ;
-#else
- sprintf(buffer, "%s:%I64d:%I64d:%I64d", pid->getConnectionId()->c_str(),
- pid->getSessionId(),
- pid->getValue(),
- messageId->getProducerSequenceId() ) ;
-#endif
-
- str = new string(buffer) ;
- return str ;
-}
-
-/*
- *
- */
-bool ActiveMQMessage::getJMSPersistent()
-{
- return this->persistent ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSPersistent(bool persistent)
-{
- this->persistent = persistent ;
-}
-
-/*
- *
- */
-unsigned char ActiveMQMessage::getJMSPriority()
-{
- return this->priority ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSPriority(unsigned char priority)
-{
- this->priority = priority ;
-}
-
-/*
- *
- */
-bool ActiveMQMessage::getJMSRedelivered()
-{
- return ( this->redeliveryCounter > 0 ) ? true : false ;
-}
-
-/*
- *
- */
-p<IDestination> ActiveMQMessage::getJMSReplyTo()
-{
- return this->replyTo ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSReplyTo(p<IDestination> destination)
-{
- this->replyTo = p_dyncast<ActiveMQDestination> (destination) ;
-
-}
-
-/*
- *
- */
-long long ActiveMQMessage::getJMSTimestamp()
-{
- return this->timestamp ;
-}
-
-/*
- *
- */
-p<string> ActiveMQMessage::getJMSType()
-{
- return this->type ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSType(const char* type)
-{
- this->type = new string(type) ;
-}
-
-/*
- *
- */
-int ActiveMQMessage::getJMSXDeliveryCount()
-{
- return this->redeliveryCounter + 1 ;
-}
-
-/*
- *
- */
-p<string> ActiveMQMessage::getJMSXGroupID()
-{
- return this->groupID ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSXGroupID(const char* groupId)
-{
- this->groupID = new string(groupId) ;
-}
-
-/*
- *
- */
-int ActiveMQMessage::getJMSXGroupSeq()
-{
- return this->groupSequence ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::setJMSXGroupSeq(int sequence)
-{
- this->groupSequence = sequence ;
-}
-
-/*
- *
- */
-p<string> ActiveMQMessage::getJMSXProducerTxID()
-{
- p<TransactionId> txId = this->originalTransactionId ;
- p<string> str ;
-
- if( txId == NULL )
- txId = this->transactionId ;
-
- if( txId != NULL )
- {
- if( txId->getDataStructureType() == LocalTransactionId::TYPE )
- {
- p<LocalTransactionId> localTxId = p_cast<LocalTransactionId> (txId) ;
- char buffer[256] ;
-
- // Compose local transaction id string
-#ifdef unix
- sprintf(buffer, "%lld", localTxId->getValue() ) ;
-#else
- sprintf(buffer, "%I64d", localTxId->getValue() ) ;
-#endif
-
- str = new string(buffer ) ;
- return str ;
- }
- else if( txId->getDataStructureType() == XATransactionId::TYPE )
- {
- p<XATransactionId> xaTxId = p_cast<XATransactionId> (txId) ;
- char buffer[256] ;
-
- // Compose XA transaction id string
- sprintf(buffer, "XID:%d:%s:%s", xaTxId->getFormatId(),
- Hex::toString( xaTxId->getGlobalTransactionId() )->c_str(),
- Hex::toString( xaTxId->getBranchQualifier() )->c_str() ) ;
-
- str = new string(buffer ) ;
- return str ;
- }
- return NULL ;
- }
- return NULL ;
-}
-
-
-// Operation methods ------------------------------------------------
-
-/*
- *
- */
-void ActiveMQMessage::acknowledge()
-{
- if( acknowledger != NULL )
- acknowledger->acknowledge(smartify(this)) ;
-}
-
-
-// Implementation methods -------------------------------------------
-
-/*
- *
- */
-int ActiveMQMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw(IOException)
-{
- int size = 0 ;
-
- // Update message content if available
- if( mode == IMarshaller::MARSHAL_SIZE && this->properties != NULL )
- {
- p<ByteArrayOutputStream> arrayWriter = new ByteArrayOutputStream() ;
-
- // Marshal properties into a byte array
- marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, arrayWriter) ;
-
- // Store properties byte array in message content
- this->marshalledProperties = arrayWriter->toArray() ;
- }
- // Note! Message propertys marshalling is done in super class
- size += Message::marshal(marshaller, mode, writer) ;
-
- return size ;
-}
-
-/*
- *
- */
-void ActiveMQMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw(IOException)
-{
- // Note! Message property unmarshalling is done in super class
- Message::unmarshal(marshaller, mode, reader) ;
-
- // Extract properties from message
- if( mode == IMarshaller::MARSHAL_READ )
- {
- if( this->marshalledProperties != NULL )
- {
- p<ByteArrayInputStream> arrayReader = new ByteArrayInputStream( this->marshalledProperties ) ;
-
- // Unmarshal map into a map
- properties = marshaller->unmarshalMap(mode, arrayReader) ;
- }
- }
-}
-
-
-// Static methods ---------------------------------------------------
-
-/*
- *
- */
-/*p<ActiveMQMessage> ActiveMQMessage::transform(p<IMessage> message)
-{
- return p_cast<ActiveMQMessage> (message) ;
-}*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQMessage.hpp"
+#include "ppr/io/ByteArrayOutputStream.hpp"
+#include "ppr/io/ByteArrayInputStream.hpp"
+
+using namespace apache::activemq::command;
+
+
+// Constructors -----------------------------------------------------
+
+
+// Attribute methods ------------------------------------------------
+
+/*
+ *
+ */
+unsigned char ActiveMQMessage::getDataStructureType()
+{
+ return ActiveMQMessage::TYPE ;
+}
+
+/*
+ *
+ */
+p<IDestination> ActiveMQMessage::getFromDestination()
+{
+ return this->destination ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setFromDestination(p<IDestination> destination)
+{
+ this->destination = p_dyncast<ActiveMQDestination> (destination) ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setAcknowledger(p<IAcknowledger> acknowledger)
+{
+ this->acknowledger = acknowledger ;
+}
+
+/*
+ *
+ */
+p<PropertyMap> ActiveMQMessage::getProperties()
+{
+ if( properties == NULL )
+ properties = new PropertyMap() ;
+
+ return properties;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMessage::getJMSCorrelationID()
+{
+ return this->correlationId ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSCorrelationID(const char* correlationId)
+{
+ this->correlationId = new string(correlationId) ;
+}
+
+/*
+ *
+ */
+p<IDestination> ActiveMQMessage::getJMSDestination()
+{
+ return this->originalDestination ;
+}
+
+/*
+ *
+ */
+long long ActiveMQMessage::getJMSExpiration()
+{
+ return this->expiration ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSExpiration(long long time)
+{
+ this->expiration = time ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMessage::getJMSMessageID()
+{
+ p<string> str ;
+ p<ProducerId> pid = this->getMessageId()->getProducerId() ;
+ char buffer[256] ;
+
+ // Compose message id as a string
+#ifdef unix
+ sprintf(buffer, "%s:%lld:%lld:%lld", pid->getConnectionId()->c_str(),
+ pid->getSessionId(),
+ pid->getValue(),
+ messageId->getProducerSequenceId() ) ;
+#else
+ sprintf(buffer, "%s:%I64d:%I64d:%I64d", pid->getConnectionId()->c_str(),
+ pid->getSessionId(),
+ pid->getValue(),
+ messageId->getProducerSequenceId() ) ;
+#endif
+
+ str = new string(buffer) ;
+ return str ;
+}
+
+/*
+ *
+ */
+bool ActiveMQMessage::getJMSPersistent()
+{
+ return this->persistent ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSPersistent(bool persistent)
+{
+ this->persistent = persistent ;
+}
+
+/*
+ *
+ */
+unsigned char ActiveMQMessage::getJMSPriority()
+{
+ return this->priority ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSPriority(unsigned char priority)
+{
+ this->priority = priority ;
+}
+
+/*
+ *
+ */
+bool ActiveMQMessage::getJMSRedelivered()
+{
+ return ( this->redeliveryCounter > 0 ) ? true : false ;
+}
+
+/*
+ *
+ */
+p<IDestination> ActiveMQMessage::getJMSReplyTo()
+{
+ return this->replyTo ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSReplyTo(p<IDestination> destination)
+{
+ this->replyTo = p_dyncast<ActiveMQDestination> (destination) ;
+
+}
+
+/*
+ *
+ */
+long long ActiveMQMessage::getJMSTimestamp()
+{
+ return this->timestamp ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMessage::getJMSType()
+{
+ return this->type ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSType(const char* type)
+{
+ this->type = new string(type) ;
+}
+
+/*
+ *
+ */
+int ActiveMQMessage::getJMSXDeliveryCount()
+{
+ return this->redeliveryCounter + 1 ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMessage::getJMSXGroupID()
+{
+ return this->groupID ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSXGroupID(const char* groupId)
+{
+ this->groupID = new string(groupId) ;
+}
+
+/*
+ *
+ */
+int ActiveMQMessage::getJMSXGroupSeq()
+{
+ return this->groupSequence ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::setJMSXGroupSeq(int sequence)
+{
+ this->groupSequence = sequence ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQMessage::getJMSXProducerTxID()
+{
+ p<TransactionId> txId = this->originalTransactionId ;
+ p<string> str ;
+
+ if( txId == NULL )
+ txId = this->transactionId ;
+
+ if( txId != NULL )
+ {
+ if( txId->getDataStructureType() == LocalTransactionId::TYPE )
+ {
+ p<LocalTransactionId> localTxId = p_cast<LocalTransactionId> (txId) ;
+ char buffer[256] ;
+
+ // Compose local transaction id string
+#ifdef unix
+ sprintf(buffer, "%lld", localTxId->getValue() ) ;
+#else
+ sprintf(buffer, "%I64d", localTxId->getValue() ) ;
+#endif
+
+ str = new string(buffer ) ;
+ return str ;
+ }
+ else if( txId->getDataStructureType() == XATransactionId::TYPE )
+ {
+ p<XATransactionId> xaTxId = p_cast<XATransactionId> (txId) ;
+ char buffer[256] ;
+
+ // Compose XA transaction id string
+ sprintf(buffer, "XID:%d:%s:%s", xaTxId->getFormatId(),
+ Hex::toString( xaTxId->getGlobalTransactionId() )->c_str(),
+ Hex::toString( xaTxId->getBranchQualifier() )->c_str() ) ;
+
+ str = new string(buffer ) ;
+ return str ;
+ }
+ return NULL ;
+ }
+ return NULL ;
+}
+
+
+// Operation methods ------------------------------------------------
+
+/*
+ *
+ */
+void ActiveMQMessage::acknowledge()
+{
+ if( acknowledger != NULL )
+ acknowledger->acknowledge(smartify(this)) ;
+}
+
+
+// Implementation methods -------------------------------------------
+
+/*
+ *
+ */
+int ActiveMQMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw(IOException)
+{
+ int size = 0 ;
+
+ // Update message content if available
+ if( mode == IMarshaller::MARSHAL_SIZE && this->properties != NULL )
+ {
+ p<ByteArrayOutputStream> arrayWriter = new ByteArrayOutputStream() ;
+
+ // Marshal properties into a byte array
+ marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, arrayWriter) ;
+
+ // Store properties byte array in message content
+ this->marshalledProperties = arrayWriter->toArray() ;
+ }
+ // Note! Message propertys marshalling is done in super class
+ size += Message::marshal(marshaller, mode, writer) ;
+
+ return size ;
+}
+
+/*
+ *
+ */
+void ActiveMQMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw(IOException)
+{
+ // Note! Message property unmarshalling is done in super class
+ Message::unmarshal(marshaller, mode, reader) ;
+
+ // Extract properties from message
+ if( mode == IMarshaller::MARSHAL_READ )
+ {
+ if( this->marshalledProperties != NULL )
+ {
+ p<ByteArrayInputStream> arrayReader = new ByteArrayInputStream( this->marshalledProperties ) ;
+
+ // Unmarshal map into a map
+ properties = marshaller->unmarshalMap(mode, arrayReader) ;
+ }
+ }
+}
+
+
+// Static methods ---------------------------------------------------
+
+/*
+ *
+ */
+/*p<ActiveMQMessage> ActiveMQMessage::transform(p<IMessage> message)
+{
+ return p_cast<ActiveMQMessage> (message) ;
+}*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp Fri Jul 28 01:22:48 2006
@@ -1,104 +1,104 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_ActiveMQMessage_hpp_
-#define ActiveMQ_ActiveMQMessage_hpp_
-
-#include <string>
-#include "cms/IDestination.hpp"
-#include "cms/IMessage.hpp"
-#include "activemq/IAcknowledger.hpp"
-#include "activemq/command/Message.hpp"
-#include "activemq/command/LocalTransactionId.hpp"
-#include "activemq/command/XATransactionId.hpp"
-#include "ppr/io/IOException.hpp"
-#include "ppr/util/Hex.hpp"
-#include "ppr/util/MapItemHolder.hpp"
-#include "ppr/util/ifr/p"
-
-namespace apache
-{
- namespace activemq
- {
- namespace command
- {
- using namespace ifr;
- using namespace apache::activemq;
- using namespace apache::cms;
- using namespace apache::ppr::io;
- using namespace apache::ppr::util;
-
-/*
- *
- */
-class ActiveMQMessage : public Message, public IMessage
-{
-private:
- p<IAcknowledger> acknowledger ;
- p<PropertyMap> properties ;
-
-public:
- const static unsigned char TYPE = 23 ;
-
-public:
- // Attributes
- virtual unsigned char getDataStructureType() ;
- virtual p<IDestination> getFromDestination() ;
- virtual void setFromDestination(p<IDestination> destination) ;
- virtual void setAcknowledger(p<IAcknowledger> acknowledger) ;
- virtual p<PropertyMap> getProperties() ;
- virtual p<string> getJMSCorrelationID() ;
- virtual void setJMSCorrelationID(const char* correlationId) ;
- virtual p<IDestination> getJMSDestination() ;
- virtual long long getJMSExpiration() ;
- virtual void setJMSExpiration(long long time) ;
- virtual p<string> getJMSMessageID() ;
- virtual bool getJMSPersistent() ;
- virtual void setJMSPersistent(bool persistent) ;
- virtual unsigned char getJMSPriority() ;
- virtual void setJMSPriority(unsigned char priority) ;
- virtual bool getJMSRedelivered() ;
- virtual p<IDestination> getJMSReplyTo() ;
- virtual void setJMSReplyTo(p<IDestination> destination) ;
- virtual long long getJMSTimestamp() ;
- virtual p<string> getJMSType() ;
- virtual void setJMSType(const char* type) ;
- virtual int getJMSXDeliveryCount() ;
- virtual p<string> getJMSXGroupID() ;
- virtual void setJMSXGroupID(const char* groupId) ;
- virtual int getJMSXGroupSeq() ;
- virtual void setJMSXGroupSeq(int sequence) ;
- virtual p<string> getJMSXProducerTxID() ;
-
- // Operations
- virtual void acknowledge() ;
-
-protected:
- // Implementation
- int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw(IOException) ;
- void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw(IOException) ;
-
-public:
- // Static methods
- //static p<ActiveMQMessage> transform(p<IMessage> message) ;
-} ;
-
-/* namespace */
- }
- }
-}
-
-#endif /*ActiveMQ_ActiveMQMessage_hpp_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_ActiveMQMessage_hpp_
+#define ActiveMQ_ActiveMQMessage_hpp_
+
+#include <string>
+#include "cms/IDestination.hpp"
+#include "cms/IMessage.hpp"
+#include "activemq/IAcknowledger.hpp"
+#include "activemq/command/Message.hpp"
+#include "activemq/command/LocalTransactionId.hpp"
+#include "activemq/command/XATransactionId.hpp"
+#include "ppr/io/IOException.hpp"
+#include "ppr/util/Hex.hpp"
+#include "ppr/util/MapItemHolder.hpp"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+ namespace activemq
+ {
+ namespace command
+ {
+ using namespace ifr;
+ using namespace apache::activemq;
+ using namespace apache::cms;
+ using namespace apache::ppr::io;
+ using namespace apache::ppr::util;
+
+/*
+ *
+ */
+class ActiveMQMessage : public Message, public IMessage
+{
+private:
+ p<IAcknowledger> acknowledger ;
+ p<PropertyMap> properties ;
+
+public:
+ const static unsigned char TYPE = 23 ;
+
+public:
+ // Attributes
+ virtual unsigned char getDataStructureType() ;
+ virtual p<IDestination> getFromDestination() ;
+ virtual void setFromDestination(p<IDestination> destination) ;
+ virtual void setAcknowledger(p<IAcknowledger> acknowledger) ;
+ virtual p<PropertyMap> getProperties() ;
+ virtual p<string> getJMSCorrelationID() ;
+ virtual void setJMSCorrelationID(const char* correlationId) ;
+ virtual p<IDestination> getJMSDestination() ;
+ virtual long long getJMSExpiration() ;
+ virtual void setJMSExpiration(long long time) ;
+ virtual p<string> getJMSMessageID() ;
+ virtual bool getJMSPersistent() ;
+ virtual void setJMSPersistent(bool persistent) ;
+ virtual unsigned char getJMSPriority() ;
+ virtual void setJMSPriority(unsigned char priority) ;
+ virtual bool getJMSRedelivered() ;
+ virtual p<IDestination> getJMSReplyTo() ;
+ virtual void setJMSReplyTo(p<IDestination> destination) ;
+ virtual long long getJMSTimestamp() ;
+ virtual p<string> getJMSType() ;
+ virtual void setJMSType(const char* type) ;
+ virtual int getJMSXDeliveryCount() ;
+ virtual p<string> getJMSXGroupID() ;
+ virtual void setJMSXGroupID(const char* groupId) ;
+ virtual int getJMSXGroupSeq() ;
+ virtual void setJMSXGroupSeq(int sequence) ;
+ virtual p<string> getJMSXProducerTxID() ;
+
+ // Operations
+ virtual void acknowledge() ;
+
+protected:
+ // Implementation
+ int marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> writer) throw(IOException) ;
+ void unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> reader) throw(IOException) ;
+
+public:
+ // Static methods
+ //static p<ActiveMQMessage> transform(p<IMessage> message) ;
+} ;
+
+/* namespace */
+ }
+ }
+}
+
+#endif /*ActiveMQ_ActiveMQMessage_hpp_*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp Fri Jul 28 01:22:48 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQObjectMessage.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- *
- */
-ActiveMQObjectMessage::ActiveMQObjectMessage()
-{
-}
-
-ActiveMQObjectMessage::~ActiveMQObjectMessage()
-{
-}
-
-unsigned char ActiveMQObjectMessage::getDataStructureType()
-{
- return ActiveMQObjectMessage::TYPE ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQObjectMessage.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ */
+ActiveMQObjectMessage::ActiveMQObjectMessage()
+{
+}
+
+ActiveMQObjectMessage::~ActiveMQObjectMessage()
+{
+}
+
+unsigned char ActiveMQObjectMessage::getDataStructureType()
+{
+ return ActiveMQObjectMessage::TYPE ;
+}
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.hpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.hpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.hpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.hpp Fri Jul 28 01:22:48 2006
@@ -1,53 +1,53 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_ActiveMQObjectMessage_hpp_
-#define ActiveMQ_ActiveMQObjectMessage_hpp_
-
-#include <string>
-#include "activemq/command/ActiveMQMessage.hpp"
-#include "ppr/util/ifr/p"
-
-namespace apache
-{
- namespace activemq
- {
- namespace command
- {
- using namespace ifr;
- using namespace std;
-
-/*
- *
- */
-class ActiveMQObjectMessage : public ActiveMQMessage
-{
-public:
- const static unsigned char TYPE = 26 ;
-
-public:
- ActiveMQObjectMessage() ;
- virtual ~ActiveMQObjectMessage() ;
-
- virtual unsigned char getDataStructureType() ;
-} ;
-
-/* namespace */
- }
- }
-}
-
-#endif /*ActiveMQ_ActiveMQObjectMessage_hpp_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_ActiveMQObjectMessage_hpp_
+#define ActiveMQ_ActiveMQObjectMessage_hpp_
+
+#include <string>
+#include "activemq/command/ActiveMQMessage.hpp"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+ namespace activemq
+ {
+ namespace command
+ {
+ using namespace ifr;
+ using namespace std;
+
+/*
+ *
+ */
+class ActiveMQObjectMessage : public ActiveMQMessage
+{
+public:
+ const static unsigned char TYPE = 26 ;
+
+public:
+ ActiveMQObjectMessage() ;
+ virtual ~ActiveMQObjectMessage() ;
+
+ virtual unsigned char getDataStructureType() ;
+} ;
+
+/* namespace */
+ }
+ }
+}
+
+#endif /*ActiveMQ_ActiveMQObjectMessage_hpp_*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp Fri Jul 28 01:22:48 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQQueue.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- *
- */
-ActiveMQQueue::ActiveMQQueue()
- : ActiveMQDestination()
-{
-}
-
-/*
- *
- */
-ActiveMQQueue::ActiveMQQueue(const char* name)
- : ActiveMQDestination(name)
-{
-}
-
-/*
- *
- */
-ActiveMQQueue::~ActiveMQQueue()
-{
-}
-
-/*
- *
- */
-unsigned char ActiveMQQueue::getDataStructureType()
-{
- return ActiveMQQueue::TYPE ;
-}
-
-/*
- *
- */
-p<string> ActiveMQQueue::getQueueName()
-{
- return this->getPhysicalName() ;
-}
-
-/*
- *
- */
-int ActiveMQQueue::getDestinationType()
-{
- return ActiveMQDestination::ACTIVEMQ_QUEUE ;
-}
-
-/*
- *
- */
-p<ActiveMQDestination> ActiveMQQueue::createDestination(const char* name)
-{
- p<ActiveMQQueue> queue = new ActiveMQQueue(name) ;
- return queue ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQQueue.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ */
+ActiveMQQueue::ActiveMQQueue()
+ : ActiveMQDestination()
+{
+}
+
+/*
+ *
+ */
+ActiveMQQueue::ActiveMQQueue(const char* name)
+ : ActiveMQDestination(name)
+{
+}
+
+/*
+ *
+ */
+ActiveMQQueue::~ActiveMQQueue()
+{
+}
+
+/*
+ *
+ */
+unsigned char ActiveMQQueue::getDataStructureType()
+{
+ return ActiveMQQueue::TYPE ;
+}
+
+/*
+ *
+ */
+p<string> ActiveMQQueue::getQueueName()
+{
+ return this->getPhysicalName() ;
+}
+
+/*
+ *
+ */
+int ActiveMQQueue::getDestinationType()
+{
+ return ActiveMQDestination::ACTIVEMQ_QUEUE ;
+}
+
+/*
+ *
+ */
+p<ActiveMQDestination> ActiveMQQueue::createDestination(const char* name)
+{
+ p<ActiveMQQueue> queue = new ActiveMQQueue(name) ;
+ return queue ;
+}
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.hpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.hpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.hpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.hpp Fri Jul 28 01:22:48 2006
@@ -1,55 +1,55 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_ActiveMQQueue_hpp_
-#define ActiveMQ_ActiveMQQueue_hpp_
-
-#include "cms/IQueue.hpp"
-#include "activemq/command/ActiveMQDestination.hpp"
-
-namespace apache
-{
- namespace activemq
- {
- namespace command
- {
- using namespace apache::cms;
-
-/*
- *
- */
-class ActiveMQQueue : public ActiveMQDestination, public IQueue
-{
-public:
- const static unsigned char TYPE = 100 ;
-
-public:
- ActiveMQQueue() ;
- ActiveMQQueue(const char* name) ;
- virtual ~ActiveMQQueue() ;
-
- virtual unsigned char getDataStructureType() ;
- virtual p<string> getQueueName() ;
- virtual int getDestinationType() ;
- virtual p<ActiveMQDestination> createDestination(const char* name) ;
-} ;
-
-/* namespace */
- }
- }
-}
-
-#endif /*ActiveMQ_ActiveMQQueue_hpp_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_ActiveMQQueue_hpp_
+#define ActiveMQ_ActiveMQQueue_hpp_
+
+#include "cms/IQueue.hpp"
+#include "activemq/command/ActiveMQDestination.hpp"
+
+namespace apache
+{
+ namespace activemq
+ {
+ namespace command
+ {
+ using namespace apache::cms;
+
+/*
+ *
+ */
+class ActiveMQQueue : public ActiveMQDestination, public IQueue
+{
+public:
+ const static unsigned char TYPE = 100 ;
+
+public:
+ ActiveMQQueue() ;
+ ActiveMQQueue(const char* name) ;
+ virtual ~ActiveMQQueue() ;
+
+ virtual unsigned char getDataStructureType() ;
+ virtual p<string> getQueueName() ;
+ virtual int getDestinationType() ;
+ virtual p<ActiveMQDestination> createDestination(const char* name) ;
+} ;
+
+/* namespace */
+ }
+ }
+}
+
+#endif /*ActiveMQ_ActiveMQQueue_hpp_*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp Fri Jul 28 01:22:48 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQStreamMessage.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- *
- */
-ActiveMQStreamMessage::ActiveMQStreamMessage()
-{
-}
-
-ActiveMQStreamMessage::~ActiveMQStreamMessage()
-{
-}
-
-unsigned char ActiveMQStreamMessage::getDataStructureType()
-{
- return ActiveMQStreamMessage::TYPE ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQStreamMessage.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ */
+ActiveMQStreamMessage::ActiveMQStreamMessage()
+{
+}
+
+ActiveMQStreamMessage::~ActiveMQStreamMessage()
+{
+}
+
+unsigned char ActiveMQStreamMessage::getDataStructureType()
+{
+ return ActiveMQStreamMessage::TYPE ;
+}
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.hpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.hpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.hpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.hpp Fri Jul 28 01:22:48 2006
@@ -1,53 +1,53 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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_ActiveMQStreamMessage_hpp_
-#define ActiveMQ_ActiveMQStreamMessage_hpp_
-
-#include <string>
-#include "activemq/command/ActiveMQMessage.hpp"
-#include "ppr/util/ifr/p"
-
-namespace apache
-{
- namespace activemq
- {
- namespace command
- {
- using namespace ifr;
- using namespace std;
-
-/*
- *
- */
-class ActiveMQStreamMessage : public ActiveMQMessage
-{
-public:
- const static unsigned char TYPE = 27 ;
-
-public:
- ActiveMQStreamMessage() ;
- virtual ~ActiveMQStreamMessage() ;
-
- virtual unsigned char getDataStructureType() ;
-} ;
-
-/* namespace */
- }
- }
-}
-
-#endif /*ActiveMQ_ActiveMQStreamMessage_hpp_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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_ActiveMQStreamMessage_hpp_
+#define ActiveMQ_ActiveMQStreamMessage_hpp_
+
+#include <string>
+#include "activemq/command/ActiveMQMessage.hpp"
+#include "ppr/util/ifr/p"
+
+namespace apache
+{
+ namespace activemq
+ {
+ namespace command
+ {
+ using namespace ifr;
+ using namespace std;
+
+/*
+ *
+ */
+class ActiveMQStreamMessage : public ActiveMQMessage
+{
+public:
+ const static unsigned char TYPE = 27 ;
+
+public:
+ ActiveMQStreamMessage() ;
+ virtual ~ActiveMQStreamMessage() ;
+
+ virtual unsigned char getDataStructureType() ;
+} ;
+
+/* namespace */
+ }
+ }
+}
+
+#endif /*ActiveMQ_ActiveMQStreamMessage_hpp_*/
Propchange: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp?rev=426431&r1=426430&r2=426431&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp (original)
+++ incubator/activemq/branches/activemq-4.0/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp Fri Jul 28 01:22:48 2006
@@ -1,53 +1,53 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "activemq/command/ActiveMQTempDestination.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- *
- */
-ActiveMQTempDestination::ActiveMQTempDestination()
- : ActiveMQDestination()
-{
- // no-op
-}
-
-/*
- *
- */
-ActiveMQTempDestination::ActiveMQTempDestination(const char* name)
- : ActiveMQDestination(name)
-{
- // no-op
-}
-
-/*
- *
- */
-ActiveMQTempDestination::~ActiveMQTempDestination()
-{
- // no-op
-}
-
-/*
- *
- */
-unsigned char ActiveMQTempDestination::getDataStructureType()
-{
- return ActiveMQTempDestination::TYPE ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "activemq/command/ActiveMQTempDestination.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ *
+ */
+ActiveMQTempDestination::ActiveMQTempDestination()
+ : ActiveMQDestination()
+{
+ // no-op
+}
+
+/*
+ *
+ */
+ActiveMQTempDestination::ActiveMQTempDestination(const char* name)
+ : ActiveMQDestination(name)
+{
+ // no-op
+}
+
+/*
+ *
+ */
+ActiveMQTempDestination::~ActiveMQTempDestination()
+{
+ // no-op
+}
+
+/*
+ *
+ */
+unsigned char ActiveMQTempDestination::getDataStructureType()
+{
+ return ActiveMQTempDestination::TYPE ;
+}
|