You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/05/12 21:15:08 UTC
svn commit: r774034 - in /activemq/activemq-cpp/trunk/activemq-cpp/src:
main/ main/activemq/cmsutil/ main/activemq/core/ main/cms/
test/activemq/cmsutil/ test/activemq/exceptions/
Author: tabish
Date: Tue May 12 19:15:08 2009
New Revision: 774034
URL: http://svn.apache.org/viewvc?rev=774034&view=rev
Log:
Updates to the CMS API to allow for future work to not break source compatibility.
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h (with props)
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/cmsutil/DummySession.h
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Tue May 12 19:15:08 2009
@@ -88,7 +88,12 @@
decaf/io/BufferedOutputStream.cpp \
decaf/io/BlockingByteArrayInputStream.cpp \
decaf/io/DataInputStream.cpp \
+ cms/MessageNotWriteableException.cpp \
cms/CMSException.cpp \
+ cms/CMSSecurityException.cpp \
+ cms/MessageEOFException.cpp \
+ cms/MessageNotReadableException.cpp \
+ cms/MessageFormatException.cpp \
activemq/transport/mock/MockTransportFactory.cpp \
activemq/transport/mock/MockTransport.cpp \
activemq/transport/mock/InternalCommandListener.cpp \
@@ -593,8 +598,10 @@
cms/TextMessage.h \
cms/Closeable.h \
cms/BytesMessage.h \
+ cms/CMSSecurityException.h \
cms/ObjectMessage.h \
cms/QueueBrowser.h \
+ cms/MessageEOFException.h \
cms/TemporaryQueue.h \
cms/MapMessage.h \
cms/Connection.h \
@@ -603,10 +610,12 @@
cms/Session.h \
cms/ExceptionListener.h \
cms/Stoppable.h \
+ cms/StreamMessage.h \
cms/MessageConsumer.h \
cms/DeliveryMode.h \
cms/Config.h \
cms/Destination.h \
+ cms/MessageNotReadableException.h \
cms/CMSProperties.h \
cms/TemporaryTopic.h \
cms/Topic.h \
@@ -615,6 +624,8 @@
cms/Startable.h \
cms/Queue.h \
cms/MessageProducer.h \
+ cms/MessageFormatException.h \
+ cms/MessageNotWriteableException.h \
activemq/transport/TransportListener.h \
activemq/transport/TransportFilter.h \
activemq/transport/CompositeTransport.h \
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/cmsutil/PooledSession.h Tue May 12 19:15:08 2009
@@ -190,6 +190,11 @@
return session->createBytesMessage( bytes, bytesSize );
}
+ virtual cms::StreamMessage* createStreamMessage()
+ throw ( cms::CMSException ) {
+ return session->createStreamMessage();
+ }
+
virtual cms::TextMessage* createTextMessage()
throw ( cms::CMSException ) {
return session->createTextMessage();
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp Tue May 12 19:15:08 2009
@@ -525,6 +525,18 @@
}
////////////////////////////////////////////////////////////////////////////////
+cms::StreamMessage* ActiveMQSession::createStreamMessage()
+ throw ( cms::CMSException ) {
+
+ try{
+ // TODO
+ throw decaf::lang::exceptions::UnsupportedOperationException(
+ __FILE__, __LINE__, "StreamMessage Not Yet Implemented." );
+ }
+ AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+}
+
+////////////////////////////////////////////////////////////////////////////////
cms::TextMessage* ActiveMQSession::createTextMessage()
throw ( cms::CMSException ) {
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h Tue May 12 19:15:08 2009
@@ -318,11 +318,17 @@
throw ( cms::CMSException );
/**
+ * Creates a new StreamMessage
+ * TODO - Throws UnsupportedOperation as this Message is not Implemented yet.
+ * @throws CMSException
+ */
+ virtual cms::StreamMessage* createStreamMessage() throw ( cms::CMSException );
+
+ /**
* Creates a new TextMessage
* @throws CMSException
*/
- virtual cms::TextMessage* createTextMessage()
- throw ( cms::CMSException );
+ virtual cms::TextMessage* createTextMessage() throw ( cms::CMSException );
/**
* Creates a new TextMessage and set the text to the value given
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp Tue May 12 19:15:08 2009
@@ -0,0 +1,44 @@
+/**
+ * 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 "CMSSecurityException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+CMSSecurityException::CMSSecurityException() throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CMSSecurityException::CMSSecurityException( const CMSSecurityException& ex ) throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CMSSecurityException::CMSSecurityException( const std::string& message, const std::exception* cause )
+ throw() : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CMSSecurityException::CMSSecurityException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace )
+ throw() : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CMSSecurityException::~CMSSecurityException() throw() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h Tue May 12 19:15:08 2009
@@ -0,0 +1,53 @@
+/**
+ * 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 _CMS_CMSSECURITYEXCEPTION_H_
+#define _CMS_CMSSECURITYEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+ /**
+ * This exception must be thrown when a provider rejects a user name/password submitted
+ * by a client. It may also be thrown for any case where a security restriction prevents
+ * a method from completing.
+ *
+ * @since 1.2
+ */
+ class CMS_API CMSSecurityException : public CMSException {
+ public:
+
+ CMSSecurityException() throw();
+
+ CMSSecurityException( const CMSSecurityException& ex ) throw();
+
+ CMSSecurityException( const std::string& message,
+ const std::exception* cause ) throw();
+
+ CMSSecurityException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace ) throw();
+
+ virtual ~CMSSecurityException() throw();
+
+ };
+
+}
+
+#endif /*_CMS_CMSSECURITYEXCEPTION_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/CMSSecurityException.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp Tue May 12 19:15:08 2009
@@ -0,0 +1,44 @@
+/**
+ * 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 "MessageEOFException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageEOFException::MessageEOFException() throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageEOFException::MessageEOFException( const MessageEOFException& ex ) throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageEOFException::MessageEOFException( const std::string& message, const std::exception* cause )
+ throw() : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageEOFException::MessageEOFException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace )
+ throw() : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageEOFException::~MessageEOFException() throw() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h Tue May 12 19:15:08 2009
@@ -0,0 +1,52 @@
+/**
+ * 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 _CMS_MESSAGEEOFEXCEPTION_H_
+#define _CMS_MESSAGEEOFEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+ /**
+ * This exception must be thrown when an unexpected end of stream has been
+ * reached when a StreamMessage or BytesMessage is being read.
+ *
+ * @since 1.2
+ */
+ class CMS_API MessageEOFException : public CMSException {
+ public:
+
+ MessageEOFException() throw();
+
+ MessageEOFException( const MessageEOFException& ex ) throw();
+
+ MessageEOFException( const std::string& message,
+ const std::exception* cause ) throw();
+
+ MessageEOFException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace ) throw();
+
+ virtual ~MessageEOFException() throw();
+
+ };
+
+}
+
+#endif /*_CMS_MESSAGEEOFEXCEPTION_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageEOFException.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp Tue May 12 19:15:08 2009
@@ -0,0 +1,45 @@
+/**
+ * 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 "MessageFormatException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageFormatException::MessageFormatException() throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageFormatException::MessageFormatException( const MessageFormatException& ex )
+ throw() : CMSException( ex ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageFormatException::MessageFormatException( const std::string& message, const std::exception* cause )
+ throw() : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageFormatException::MessageFormatException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace )
+ throw() : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageFormatException::~MessageFormatException() throw() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h Tue May 12 19:15:08 2009
@@ -0,0 +1,55 @@
+/**
+ * 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 _CMS_MESSAGEFORMATEXCEPTION_H_
+#define _CMS_MESSAGEFORMATEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+ /**
+ * This exception must be thrown when a CMS client attempts to use a data type not
+ * supported by a message or attempts to read data in a message as the wrong type. It
+ * must also be thrown when equivalent type errors are made with message property values.
+ * For example, this exception must be thrown if StreamMessage.readShort is used to read
+ * a boolean value.
+ *
+ * @since 1.2
+ */
+ class CMS_API MessageFormatException : public CMSException {
+ public:
+
+ MessageFormatException() throw();
+
+ MessageFormatException( const MessageFormatException& ex ) throw();
+
+ MessageFormatException( const std::string& message,
+ const std::exception* cause ) throw();
+
+ MessageFormatException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace ) throw();
+
+ virtual ~MessageFormatException() throw();
+
+ };
+
+}
+
+#endif /*_CMS_MESSAGEFORMATEXCEPTION_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageFormatException.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp Tue May 12 19:15:08 2009
@@ -0,0 +1,45 @@
+/**
+ * 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 "MessageNotReadableException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotReadableException::MessageNotReadableException() throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotReadableException::MessageNotReadableException( const MessageNotReadableException& ex )
+ throw() : CMSException( ex ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotReadableException::MessageNotReadableException( const std::string& message, const std::exception* cause )
+ throw() : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotReadableException::MessageNotReadableException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace )
+ throw() : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotReadableException::~MessageNotReadableException() throw() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h Tue May 12 19:15:08 2009
@@ -0,0 +1,52 @@
+/**
+ * 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 _CMS_MESSAGENOTREADABLEEXCEPTION_H_
+#define _CMS_MESSAGENOTREADABLEEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+ /**
+ * This exception must be thrown when an unexpected end of stream has been
+ * reached when a StreamMessage or BytesMessage is being read.
+ *
+ * @since 1.2
+ */
+ class CMS_API MessageNotReadableException : public CMSException {
+ public:
+
+ MessageNotReadableException() throw();
+
+ MessageNotReadableException( const MessageNotReadableException& ex ) throw();
+
+ MessageNotReadableException( const std::string& message,
+ const std::exception* cause ) throw();
+
+ MessageNotReadableException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace ) throw();
+
+ virtual ~MessageNotReadableException() throw();
+
+ };
+
+}
+
+#endif /*_CMS_MESSAGENOTREADABLEEXCEPTION_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotReadableException.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp Tue May 12 19:15:08 2009
@@ -0,0 +1,45 @@
+/**
+ * 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 "MessageNotWriteableException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotWriteableException::MessageNotWriteableException() throw() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotWriteableException::MessageNotWriteableException( const MessageNotWriteableException& ex )
+ throw() : CMSException( ex ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotWriteableException::MessageNotWriteableException( const std::string& message, const std::exception* cause )
+ throw() : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotWriteableException::MessageNotWriteableException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace )
+ throw() : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageNotWriteableException::~MessageNotWriteableException() throw() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h Tue May 12 19:15:08 2009
@@ -0,0 +1,52 @@
+/**
+ * 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 _CMS_MESSAGENOTWRITEABLEEXCEPTION_H_
+#define _CMS_MESSAGENOTWRITEABLEEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+ /**
+ * This exception must be thrown when an unexpected end of stream has been
+ * reached when a StreamMessage or BytesMessage is being read.
+ *
+ * @since 1.2
+ */
+ class CMS_API MessageNotWriteableException : public CMSException {
+ public:
+
+ MessageNotWriteableException() throw();
+
+ MessageNotWriteableException( const MessageNotWriteableException& ex ) throw();
+
+ MessageNotWriteableException( const std::string& message,
+ const std::exception* cause ) throw();
+
+ MessageNotWriteableException( const std::string& message,
+ const std::exception* cause,
+ const std::vector< std::pair< std::string, int> >& stackTrace ) throw();
+
+ virtual ~MessageNotWriteableException() throw();
+
+ };
+
+}
+
+#endif /*_CMS_MESSAGENOTWRITEABLEEXCEPTION_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageNotWriteableException.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h Tue May 12 19:15:08 2009
@@ -23,6 +23,7 @@
#include <cms/TextMessage.h>
#include <cms/BytesMessage.h>
#include <cms/MapMessage.h>
+#include <cms/StreamMessage.h>
#include <cms/MessageProducer.h>
#include <cms/MessageConsumer.h>
#include <cms/Topic.h>
@@ -290,6 +291,14 @@
throw ( CMSException) = 0;
/**
+ * Creates a new StreamMessage
+ *
+ * @throws CMSException
+ */
+ virtual StreamMessage* createStreamMessage()
+ throw ( CMSException ) = 0;
+
+ /**
* Creates a new TextMessage
*
* @throws CMSException
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h?rev=774034&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h Tue May 12 19:15:08 2009
@@ -0,0 +1,393 @@
+/**
+ * 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 _CMS_STREAMMESSAGE_H_
+#define _CMS_STREAMMESSAGE_H_
+
+#include <cms/Config.h>
+#include <cms/Message.h>
+#include <cms/CMSException.h>
+#include <cms/MessageNotReadableException.h>
+#include <cms/MessageNotWriteableException.h>
+#include <cms/MessageFormatException.h>
+#include <cms/MessageEOFException.h>
+
+namespace cms {
+
+ /**
+ * Interface for a StreamMessage. The stream Messages provides a Message
+ * type whose body is a stream of self describing primitive types. The primitive
+ * values are read and written using accessors specific to the given types.
+ *
+ * StreamMessage objects support the following conversion table. The marked cases
+ * must be supported. The unmarked cases must throw a CMSException. The string-to-
+ * primitive conversions may throw a runtime exception if the primitive's valueOf()
+ * method does not accept it as a valid String representation of the primitive.
+ *
+ * A value written as the row type can be read as the column type.
+ *
+ * | | boolean byte short char int long float double String byte[]
+ * |----------------------------------------------------------------------
+ * |boolean | X X
+ * |byte | X X X X X
+ * |short | X X X X
+ * |char | X X
+ * |int | X X X
+ * |long | X X
+ * |float | X X X
+ * |double | X X
+ * |String | X X X X X X X X
+ * |byte[] | X
+ * |----------------------------------------------------------------------
+ *
+ *
+ * @since 1.2
+ */
+ class CMS_API StreamMessage : public Message {
+ public:
+
+ virtual ~StreamMessage() {}
+
+ /**
+ * Reads a Boolean from the Stream message stream
+ * @returns boolean value from stream
+ *
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual bool readBoolean() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a boolean to the Stream message stream as a 1-byte value.
+ * The value true is written as the value (byte)1; the value false
+ * is written as the value (byte)0.
+ *
+ * @param value
+ * boolean to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeBoolean( bool value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a Byte from the Stream message stream
+ *
+ * @returns unsigned char value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual unsigned char readByte() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a byte to the Stream message stream as a 1-byte value
+ *
+ * @param value
+ * byte to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeByte( unsigned char value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a byte array from the Stream message stream.
+ *
+ * If the length of vector value is less than the number of bytes
+ * remaining to be read from the stream, the vector should be filled. A
+ * subsequent call reads the next increment, and so on.
+ *
+ * If the number of bytes remaining in the stream is less than the
+ * length of vector value, the bytes should be read into the vector. The
+ * return value of the total number of bytes read will be less than the
+ * length of the vector, indicating that there are no more bytes left to
+ * be read from the stream. The next read of the stream returns -1.
+ *
+ * @param value
+ * buffer to place data in
+ * @returns the total number of bytes read into the buffer, or -1 if
+ * there is no more data because the end of the stream has
+ * been reached
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual std::size_t readBytes( std::vector<unsigned char>& value ) const
+ throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a byte array to the Stream message stream using the vector
+ * size as the number of bytes to write.
+ *
+ * @param value
+ * bytes to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeBytes( const std::vector<unsigned char>& value )
+ throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a portion of the Stream message stream.
+ *
+ * If the length of array value is less than the number of bytes
+ * remaining to be read from the stream, the array should be filled. A
+ * subsequent call reads the next increment, and so on.
+ *
+ * If the number of bytes remaining in the stream is less than the
+ * length of array value, the bytes should be read into the array. The
+ * return value of the total number of bytes read will be less than the
+ * length of the array, indicating that there are no more bytes left to
+ * be read from the stream. The next read of the stream returns -1.
+ *
+ * If length is negative, or length is greater than the length of the
+ * array value, then an CMSException is thrown. No bytes
+ * will be read from the stream for this exception case.
+ *
+ * @param buffer
+ * the buffer into which the data is read
+ * @param length
+ * the number of bytes to read; must be less than or equal to
+ * value.length
+ * @returns the total number of bytes read into the buffer, or -1 if
+ * there is no more data because the end of the stream has
+ * been reached
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual std::size_t readBytes( unsigned char*& buffer, std::size_t length ) const
+ throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a portion of a byte array to the Stream message stream.
+ * size as the number of bytes to write.
+ *
+ * @param value
+ * bytes to write to the stream
+ * @param offset
+ * the initial offset within the byte array
+ * @param length
+ * the number of bytes to use
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeBytes( const unsigned char* value,
+ std::size_t offset,
+ std::size_t length ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a Char from the Stream message stream
+ *
+ * @returns char value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual char readChar() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a char to the Stream message stream as a 1-byte value
+ *
+ * @param value
+ * char to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeChar( char value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 32 bit float from the Stream message stream
+ *
+ * @returns double value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual float readFloat() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a float to the Stream message stream as a 4 byte value
+ * @param value
+ * float to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeFloat( float value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 64 bit double from the Stream message stream
+ *
+ * @returns double value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual double readDouble() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a double to the Stream message stream as a 8 byte value
+ * @param value
+ * double to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeDouble( double value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 16 bit signed short from the Stream message stream
+ *
+ * @returns short value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual short readShort() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a signed short to the Stream message stream as a 2 byte value
+ *
+ * @param value
+ * signed short to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeShort( short value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 16 bit unsigned short from the Stream message stream
+ *
+ * @returns unsigned short value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual unsigned short readUnsignedShort() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a unsigned short to the Stream message stream as a 2 byte value
+ *
+ * @param value
+ * unsigned short to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeUnsignedShort( unsigned short value )
+ throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 32 bit signed integer from the Stream message stream
+ *
+ * @returns int value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual int readInt() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a signed int to the Stream message stream as a 4 byte value
+ *
+ * @param value
+ * signed int to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeInt( int value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads a 64 bit long from the Stream message stream
+ *
+ * @returns long long value from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual long long readLong() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes a long long to the Stream message stream as a 8 byte value
+ *
+ * @param value
+ * signed long long to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeLong( long long value ) throw ( cms::CMSException ) = 0;
+
+ /**
+ * Reads an ASCII String from the Stream message stream
+ *
+ * @returns String from stream
+ * @throw CMSException - if the CMS provider fails to read the message
+ * due to some internal error.
+ * @throw MessageEOFException - if unexpected end of message stream has been reached.
+ * @throw MessageFormatException - if this type conversion is invalid.
+ * @throw MessageNotReadableException - if the message is in write-only mode.
+ */
+ virtual std::string readString() const throw ( cms::CMSException ) = 0;
+
+ /**
+ * Writes an ASCII String to the Stream message stream
+ *
+ * @param value
+ * String to write to the stream
+ * @throws CMSException - if the CMS provider fails to write the message due
+ * to some internal error.
+ * @throws MessageNotWriteableException - if the message is in read-only mode.
+ */
+ virtual void writeString( const std::string& value )
+ throw ( cms::CMSException ) = 0;
+
+ };
+
+}
+
+#endif /*_CMS_STREAMMESSAGE_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/StreamMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/cmsutil/DummySession.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/cmsutil/DummySession.h?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/cmsutil/DummySession.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/cmsutil/DummySession.h Tue May 12 19:15:08 2009
@@ -112,6 +112,9 @@
return NULL;
}
+ virtual cms::StreamMessage* createStreamMessage()
+ throw ( cms::CMSException ){ return NULL; }
+
virtual cms::TextMessage* createTextMessage()
throw ( cms::CMSException ){ return NULL; }
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp?rev=774034&r1=774033&r2=774034&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/exceptions/ActiveMQExceptionTest.cpp Tue May 12 19:15:08 2009
@@ -17,6 +17,7 @@
#include "ActiveMQExceptionTest.h"
#include <activemq/exceptions/ExceptionDefines.h>
+#include <cms/MessageNotReadableException.h>
#include <decaf/lang/Exception.h>
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
@@ -27,8 +28,20 @@
using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
+namespace {
+ void testMethod() throw ( cms::CMSException ) {
+ throw cms::MessageNotReadableException( "TEST", NULL );
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQExceptionTest::testMacros() {
+ CPPUNIT_ASSERT_THROW_MESSAGE(
+ "Should Throw a CMSException",
+ testMethod(),
+ cms::CMSException );
+
try{
try{