You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2006/03/01 15:28:20 UTC
svn commit: r382028 [4/4] - in /incubator/activemq/trunk/cms: ./
activemqcms/ activemqcms/src/ activemqcms/src/activemq/
activemqcms/src/activemq/concurrent/ activemqcms/src/activemq/io/
activemqcms/src/activemq/transport/ activemqcms/src/activemq/tran...
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,85 @@
+/*
+ * 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_TRANSPORT_STOMP_SUBSCRIBEMESSAGE_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_SUBSCRIBEMESSAGE_H_
+
+#include <activemq/transport/stomp/DestinationMessage.h>
+#include <cms/Session.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ /**
+ * Message sent to the broker to subscribe to a topic
+ * or queue.
+ * @author Nathan Mittler
+ */
+ class SubscribeMessage : public DestinationMessage
+ {
+ public:
+
+ SubscribeMessage(){
+ mode = cms::Session::AUTO_ACKNOWLEDGE;
+ }
+ virtual ~SubscribeMessage(){};
+
+ virtual MessageType getMessageType() const{
+ return MSG_SUBSCRIBE;
+ }
+
+ virtual const cms::Message* getCMSMessage() const{
+ return NULL;
+ }
+
+ virtual cms::Message* getCMSMessage(){
+ return NULL;
+ }
+
+ virtual void setDestination( const char* destination ){
+ this->destination = destination;
+ }
+
+ virtual const char* getDestination() const{
+ return destination.c_str();
+ }
+
+ virtual void setAckMode( const cms::Session::AcknowledgeMode mode ){
+ this->mode = mode;
+ }
+
+ virtual cms::Session::AcknowledgeMode getAckMode() const{
+ return mode;
+ }
+
+ virtual cms::Message* clone() const{
+ SubscribeMessage* msg = new SubscribeMessage();
+ msg->destination = destination;
+ msg->mode = mode;
+ return msg->getCMSMessage();
+ }
+
+ public:
+
+ std::string destination;
+ cms::Session::AcknowledgeMode mode;
+ };
+
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_SUBSCRIBEMESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeMessage.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,70 @@
+/*
+ * 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_TRANSPORT_STOMP_SUBSCRIBEPROTOCOLADAPTER_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_SUBSCRIBEPROTOCOLADAPTER_H_
+
+#include <activemq/transport/stomp/ProtocolAdapter.h>
+#include <activemq/transport/stomp/SubscribeMessage.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ /**
+ * Adapts between subscribe messages and stomp frames.
+ * @author Nathan Mittler
+ */
+ class SubscribeProtocolAdapter : public ProtocolAdapter{
+ public:
+
+ virtual ~SubscribeProtocolAdapter(){}
+
+ virtual StompMessage* adapt( const StompFrame* frame ){
+ const StompFrame::HeaderInfo* dest = frame->getHeaderInfo( StompFrame::HEADER_DESTINATION );
+
+ SubscribeMessage* msg = new SubscribeMessage();
+ msg->setDestination( dest->value );
+ msg->setAckMode( getAckMode(frame) );
+ return msg;
+ }
+
+ virtual StompFrame* adapt( const StompMessage* message ){
+ StompFrame* frame = new StompFrame();
+
+ const SubscribeMessage* connectMsg = dynamic_cast<const SubscribeMessage*>(message);
+
+ // Set command.
+ frame->setCommand( getCommandId( connectMsg->getMessageType() ) );
+
+ // Set destination header.
+ frame->setHeader( StompFrame::HEADER_DESTINATION,
+ connectMsg->getDestination(),
+ strlen( connectMsg->getDestination() ) );
+
+ // Set ack header.
+ frame->setHeader( StompFrame::HEADER_ACK,
+ getAckModeString( connectMsg->getAckMode() ),
+ getAckModeStringLength( connectMsg->getAckMode() ) );
+
+ return frame;
+ }
+ };
+
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_SUBSCRIBEPROTOCOLADAPTER_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/SubscribeProtocolAdapter.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,78 @@
+/*
+ * 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_TRANSPORT_STOMP_TEXTPROTOCOLADAPTER_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_TEXTPROTOCOLADAPTER_H_
+
+#include <activemq/transport/stomp/ProtocolAdapter.h>
+#include <activemq/transport/stomp/StompTextMessage.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ /**
+ * Adapts between text messages and stomp frames.
+ * @author Nathan Mittler
+ */
+ class TextProtocolAdapter : public ProtocolAdapter{
+ public:
+
+ virtual ~TextProtocolAdapter(){}
+
+ virtual StompMessage* adapt( const StompFrame* frame ){
+ const StompFrame::HeaderInfo* dest = frame->getHeaderInfo( StompFrame::HEADER_DESTINATION );
+ const StompFrame::HeaderInfo* transaction = frame->getHeaderInfo( StompFrame::HEADER_TRANSACTIONID );
+
+ StompTextMessage* msg = new StompTextMessage();
+ msg->setDestination( dest->value );
+ msg->setText( frame->getBody() );
+ if( transaction != NULL ){
+ msg->setTransactionId( transaction->value );
+ }
+
+ return (DestinationMessage*)msg;
+ }
+ virtual StompFrame* adapt( const StompMessage* message ){
+ StompFrame* frame = new StompFrame();
+
+ const StompTextMessage* msg = dynamic_cast<const StompTextMessage*>(message);
+
+ // Set the command.
+ frame->setCommand( getCommandId( msg->getMessageType() ) );
+
+ // Set the destination header.
+ frame->setHeader( StompFrame::HEADER_DESTINATION,
+ msg->getDestination(),
+ strlen( msg->getDestination() ) );
+
+ // Set the transaction header (if provided)
+ if( msg->isTransaction() ){
+ frame->setHeader( StompFrame::HEADER_TRANSACTIONID,
+ msg->getTransactionId(),
+ strlen( msg->getTransactionId() ) );
+ }
+
+ // Set the text.
+ frame->setBodyText( msg->getText(), strlen( msg->getText() ) );
+
+ return frame;
+ }
+ };
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_TEXTPROTOCOLADAPTER_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TextProtocolAdapter.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,37 @@
+/*
+ * 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_TRANSPORT_STOMP_TRANSACTIONMESSAGE_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_TRANSACTIONMESSAGE_H_
+
+#include <activemq/transport/stomp/StompMessage.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ class TransactionMessage : public StompMessage{
+ public:
+ virtual ~TransactionMessage(){}
+
+ virtual bool isTransaction() const = 0;
+ virtual const char* getTransactionId() const = 0;
+ virtual void setTransactionId( const char* id ) = 0;
+ };
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_TRANSACTIONMESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/TransactionMessage.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,71 @@
+/*
+ * 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_TRANSPORT_STOMP_UNSUBSCRIBEMESSAGE_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_UNSUBSCRIBEMESSAGE_H_
+
+#include <activemq/transport/stomp/DestinationMessage.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ /**
+ * Message sent to the broker to unsubscribe to a
+ * topic or queue.
+ * @author Nathan Mittler
+ */
+ class UnsubscribeMessage : public DestinationMessage
+ {
+ public:
+
+ virtual ~UnsubscribeMessage(){};
+
+ virtual MessageType getMessageType() const{
+ return MSG_UNSUBSCRIBE;
+ }
+
+ virtual const cms::Message* getCMSMessage() const{
+ return NULL;
+ }
+
+ virtual cms::Message* getCMSMessage(){
+ return NULL;
+ }
+
+ virtual void setDestination( const char* destination ){
+ this->destination = destination;
+ }
+
+ virtual const char* getDestination() const{
+ return destination.c_str();
+ }
+
+ virtual cms::Message* clone() const{
+ UnsubscribeMessage* msg = new UnsubscribeMessage();
+ msg->destination = destination;
+ return msg->getCMSMessage();
+ }
+
+ private:
+
+ std::string destination;
+ };
+
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_UNSUBSCRIBEMESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeMessage.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h (added)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,64 @@
+/*
+ * 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_TRANSPORT_STOMP_UNSUBSCRIBEPROTOCOLADAPTER_H_
+#define ACTIVEMQ_TRANSPORT_STOMP_UNSUBSCRIBEPROTOCOLADAPTER_H_
+
+#include <activemq/transport/stomp/ProtocolAdapter.h>
+#include <activemq/transport/stomp/UnsubscribeMessage.h>
+
+namespace activemq{
+namespace transport{
+namespace stomp{
+
+ /**
+ * Adapts between unsubscribe messages and stomp frames.
+ * @author Nathan Mittler
+ */
+ class UnsubscribeProtocolAdapter : public ProtocolAdapter{
+ public:
+
+ virtual ~UnsubscribeProtocolAdapter(){}
+
+ virtual StompMessage* adapt( const StompFrame* frame ){
+ const StompFrame::HeaderInfo* dest = frame->getHeaderInfo( StompFrame::HEADER_DESTINATION );
+
+ UnsubscribeMessage* msg = new UnsubscribeMessage();
+ msg->setDestination( dest->value );
+ return msg;
+ }
+
+ virtual StompFrame* adapt( const StompMessage* message ){
+ StompFrame* frame = new StompFrame();
+
+ const UnsubscribeMessage* connectMsg = dynamic_cast<const UnsubscribeMessage*>(message);
+
+ // Set command.
+ frame->setCommand( getCommandId( connectMsg->getMessageType() ) );
+
+ // Set destination header.
+ frame->setHeader( StompFrame::HEADER_DESTINATION,
+ connectMsg->getDestination(),
+ strlen( connectMsg->getDestination() ) );
+
+ return frame;
+ }
+ };
+
+}}}
+
+#endif /*ACTIVEMQ_TRANSPORT_STOMP_UNSUBSCRIBEPROTOCOLADAPTER_H_*/
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/UnsubscribeProtocolAdapter.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,38 @@
+/*
+ * 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 _CMS_BYTESMESSAGE_H_
+#define _CMS_BYTESMESSAGE_H_
+
+#include <cms/Message.h>
+
+namespace cms{
+
+ class BytesMessage : public Message{
+
+ public:
+
+ virtual ~BytesMessage(){}
+
+ virtual void setData( const char* data, const int numBytes ) throw(CMSException) = 0;
+ virtual int getNumBytes() const = 0;
+ virtual const char* getData() const = 0;
+
+ };
+}
+
+#endif /*_CMS_BYTESMESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/BytesMessage.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/CMSException.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/CMSException.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/CMSException.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/CMSException.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,47 @@
+/*
+ * 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 _CMS_JMSEXCEPTION_H_
+#define _CMS_JMSEXCEPTION_H_
+
+// Includes
+#include <string>
+
+namespace cms{
+
+ /**
+ * This class represents an error that has occurred in
+ * the cms connection.
+ */
+ class CMSException{
+
+ public:
+
+ /**
+ * Destruction
+ */
+ virtual ~CMSException(){}
+
+ /**
+ * @return The error message.
+ */
+ virtual const char* getMessage() const = 0;
+ };
+
+}
+
+#endif /*_CMS_JMSEXCEPTION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/CMSException.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/CMSException.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Closeable.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Closeable.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Closeable.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Closeable.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,38 @@
+/*
+ * 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 _CMS_CLOSEABLE_H_
+#define _CMS_CLOSEABLE_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ class Closeable{
+
+ public:
+
+ virtual ~Closeable(){}
+
+ /**
+ * Closes this object and deallocates the appropriate resources.
+ */
+ virtual void close() throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_CLOSEABLE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Closeable.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Closeable.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Connection.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Connection.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Connection.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Connection.h Wed Mar 1 06:27:46 2006
@@ -0,0 +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 _CMS_CONNECTION_H_
+#define _CMS_CONNECTION_H_
+
+#include <cms/CMSException.h>
+#include <cms/Closeable.h>
+#include <cms/Service.h>
+#include <cms/Session.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class ExceptionListener;
+
+ class Connection
+ :
+ public Closeable,
+ public Service
+ {
+
+ public:
+
+ virtual ~Connection(){}
+
+ virtual Session* createSession( const bool transacted,
+ const Session::AcknowledgeMode = Session::AUTO_ACKNOWLEDGE ) throw( CMSException ) = 0;
+
+ virtual void setExceptionListener( ExceptionListener* listener )
+ throw( CMSException ) = 0;
+
+ virtual ExceptionListener* getExceptionListener() const
+ throw( CMSException ) = 0;
+ };
+
+}
+
+#endif /*_CMS_CONNECTION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Connection.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Connection.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,45 @@
+/*
+ * 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 _CMS_CONNECTIONFACTORY_H_
+#define _CMS_CONNECTIONFACTORY_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class Connection;
+
+ /**
+ * A ConnectionFactory object encapsulates a set of connection
+ * configuration parameters that has been defined by an administrator.
+ * A client uses it to create a connection with a CMS provider.
+ */
+ class ConnectionFactory{
+
+ public:
+
+ virtual ~ConnectionFactory(){}
+
+ virtual Connection* createConnection() throw( CMSException ) = 0;
+ virtual Connection* createConnection( const char* userName,
+ const char* password ) throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_CONNECTIONFACTORY_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/ConnectionFactory.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Destination.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Destination.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Destination.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Destination.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,34 @@
+/*
+ * 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 _CMS_DESTINATION_H_
+#define _CMS_DESTINATION_H_
+
+namespace cms{
+
+ /**
+ * A Destination object encapsulates a provider-specific address.
+ */
+ class Destination{
+
+ public:
+
+ virtual ~Destination(){}
+ };
+}
+
+#endif /*_CMS_DESTINATION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Destination.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Destination.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,45 @@
+/*
+ * 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 _CMS_EXCEPTIONLISTENER_H_
+#define _CMS_EXCEPTIONLISTENER_H_
+
+namespace cms{
+
+ // Forward declarations.
+ class CMSException;
+
+ /**
+ * Defines the interface for listeners of client exceptions.
+ * @author Nathan Mittler
+ */
+ class ExceptionListener{
+
+ public:
+
+ virtual ~ExceptionListener(){}
+
+ /**
+ * Invoked by a client when an error has occurred.
+ * @param error Information about the error that has occurred.
+ */
+ virtual void onException( const CMSException* error ) = 0;
+ };
+
+}
+
+#endif /*_CMS_EXCEPTIONLISTENER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/ExceptionListener.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Message.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Message.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Message.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Message.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,49 @@
+/*
+ * 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 _CMS_MESSAGE_H_
+#define _CMS_MESSAGE_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ /**
+ * Root of all messages.
+ */
+ class Message{
+
+ public:
+
+ virtual ~Message(){}
+
+ /**
+ * Acknowledges all consumed messages of the session
+ * of this consumed message.
+ */
+ virtual void acknowledge() throw( CMSException ) = 0;
+
+ /**
+ * Clones this message.
+ * @return a copy of this message. The caller is responsible
+ * for freeing this memory.
+ */
+ virtual Message* clone() const = 0;
+ };
+}
+
+#endif /*_CMS_MESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Message.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Message.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,74 @@
+/*
+ * 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 _CMS_MESSAGECONSUMER_H_
+#define _CMS_MESSAGECONSUMER_H_
+
+#include <cms/CMSException.h>
+#include <cms/Closeable.h>
+#include <string>
+
+namespace cms{
+
+ // Forward declarations.
+ class MessageListener;
+ class Message;
+
+ /**
+ * A client uses a MessageConsumer object to receive messages from
+ * a destination. A MessageConsumer object is created by passing a
+ * Destination object to a message-consumer creation method supplied
+ * by a session.
+ */
+ class MessageConsumer : public Closeable{
+
+ public:
+
+ virtual ~MessageConsumer(){}
+
+ /**
+ * Gets the message consumer's MessageListener.
+ */
+ virtual MessageListener* getMessageListener() const
+ throw( CMSException ) = 0;
+
+ /**
+ * Sets the message consumer's MessageListener.
+ */
+ virtual void setMessageListener( MessageListener* listener )
+ throw( CMSException ) = 0;
+
+ /**
+ * Receives the next message produced for this message consumer.
+ */
+ virtual Message* receive() throw( CMSException ) = 0;
+
+ /**
+ * Receives the next message that arrives within the specified
+ * timeout interval.
+ * @param timeout The timeout value (in milliseconds)
+ */
+ virtual Message* receive( long timeout ) throw( CMSException ) = 0;
+
+ /**
+ * Receives the next message if one is immediately available.
+ */
+ virtual Message* receiveNoWait() throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_MESSAGECONSUMER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageConsumer.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h Wed Mar 1 06:27:46 2006
@@ -0,0 +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.
+ */
+
+#ifndef _CMS_MESSAGELISTENER_H_
+#define _CMS_MESSAGELISTENER_H_
+
+namespace cms{
+
+ class Message;
+
+ class MessageListener{
+ public:
+
+ virtual ~MessageListener(){}
+
+ virtual void onMessage( const Message* message ) = 0;
+ };
+
+}
+
+#endif /*_CMS_MESSAGELISTENER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageListener.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,37 @@
+/*
+ * 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 _CMS_MESSAGEPRODUCER_H_
+#define _CMS_MESSAGEPRODUCER_H_
+
+namespace cms{
+
+ /**
+ * A client uses a MessageProducer object to send messages to a
+ * destination. A MessageProducer object is created by passing a
+ * Destination object to a message-producer creation method
+ * supplied by a session.
+ */
+ class MessageProducer{
+
+ public:
+
+ virtual ~MessageProducer(){}
+ };
+}
+
+#endif /*_CMS_MESSAGEPRODUCER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/MessageProducer.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Queue.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Queue.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Queue.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Queue.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,44 @@
+/*
+ * 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 _CMS_QUEUE_H_
+#define _CMS_QUEUE_H_
+
+#include <cms/Destination.h>
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ /**
+ * An interface encapsulating a provider-specific queue name.
+ */
+ class Queue : public Destination{
+
+ public:
+
+ virtual ~Queue(){}
+
+ /**
+ * Gets the name of this queue.
+ * @return The queue name.
+ */
+ virtual const char* getQueueName() const throw( CMSException ) = 0;
+ };
+
+}
+
+#endif /*_CMS_QUEUE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Queue.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Queue.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Service.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Service.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Service.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Service.h Wed Mar 1 06:27:46 2006
@@ -0,0 +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.
+ */
+
+#ifndef _CMS_SERVICE_H_
+#define _CMS_SERVICE_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ class Service{
+ public:
+
+ virtual ~Service(){}
+
+ virtual void start() throw( CMSException ) = 0;
+ virtual void stop() throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_SERVICE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Service.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Service.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Session.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Session.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Session.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Session.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,89 @@
+/*
+ * 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 _CMS_SESSION_H_
+#define _CMS_SESSION_H_
+
+#include <cms/CMSException.h>
+#include <cms/Closeable.h>
+#include <cms/TransactionController.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class TextMessage;
+ class BytesMessage;
+
+ class Session
+ :
+ public Closeable,
+ public TransactionController{
+
+ public:
+
+ enum AcknowledgeMode{
+
+ /**
+ * With this acknowledgment mode, the session automatically
+ * acknowledges a client's receipt of a message either when
+ * the session has successfully returned from a call to receive
+ * or when the message listener the session has called to
+ * process the message successfully returns.
+ */
+ AUTO_ACKNOWLEDGE,
+
+ /**
+ * With this acknowledgment mode, the client acknowledges a
+ * consumed message by calling the message's acknowledge method.
+ */
+ CLIENT_ACKNOWLEDGE,
+
+ };
+
+ public:
+
+ virtual ~Session(){}
+
+ /**
+ * Indicates whether the session is in transacted mode.
+ * @return true if the session is in transacted mode.
+ */
+ virtual bool getTransacted() const = 0;
+
+ /**
+ * Creates a TextMessage object.
+ * @return a new text message object.
+ */
+ virtual TextMessage* createTextMessage() throw( CMSException ) = 0;
+
+ /**
+ * Creates an initialized TextMessage object.
+ * @param msg The buffer to be set in the message.
+ * @return A new text message object.
+ */
+ virtual TextMessage* createTextMessage( const char* msg ) throw( CMSException ) = 0;
+
+ /**
+ * Creates a BytesMessage object.
+ * @return A new byte message object.
+ */
+ virtual BytesMessage* createBytesMessage() throw( CMSException ) = 0;
+ };
+
+}
+
+#endif /*_CMS_SESSION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Session.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Session.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,49 @@
+/*
+ * 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 _CMS_TEXTMESSAGE_H_
+#define _CMS_TEXTMESSAGE_H_
+
+#include <cms/Message.h>
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ /**
+ * Interface for a text message.
+ */
+ class TextMessage : public Message{
+
+ public:
+
+ virtual ~TextMessage(){}
+
+ /**
+ * Gets the message character buffer.
+ * @return The message character buffer.
+ */
+ virtual const char* getText() const throw( CMSException ) = 0;
+
+ /**
+ * Sets the message contents.
+ * @param msg The message buffer.
+ */
+ virtual void setText( const char* msg ) throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_TEXTMESSAGE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TextMessage.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Topic.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Topic.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Topic.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Topic.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,44 @@
+/*
+ * 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 _CMS_TOPIC_
+#define _CMS_TOPIC_
+
+#include <cms/Destination.h>
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ /**
+ * An interface encapsulating a provider-specific topic name.
+ */
+ class Topic : public Destination{
+
+ public:
+
+ virtual ~Topic(){}
+
+ /**
+ * Gets the name of this topic.
+ * @return The topic name.
+ */
+ virtual const char* getTopicName() const throw( CMSException ) = 0;
+ };
+
+}
+
+#endif /*_CMS_TOPIC_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Topic.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Topic.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,40 @@
+/*
+ * 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 _CMS_TOPICCONNECTION_H_
+#define _CMS_TOPICCONNECTION_H_
+
+#include <cms/Connection.h>
+#include <cms/TopicSession.h>
+
+namespace cms{
+
+ class TopicConnection : public Connection{
+
+ public:
+
+ virtual ~TopicConnection(){}
+
+ virtual TopicSession* createTopicSession( const bool transacted,
+ const Session::AcknowledgeMode acknowledgeMode = Session::AUTO_ACKNOWLEDGE )
+ throw( CMSException ) = 0;
+
+ };
+
+}
+
+#endif /*_CMS_TOPICCONNECTION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicConnection.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,54 @@
+/*
+ * 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 _CMS_TOPICCONNECTIONFACTORY_H_
+#define _CMS_TOPICCONNECTIONFACTORY_H_
+
+#include <cms/CMSException.h>
+#include <cms/ConnectionFactory.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class TopicConnection;
+
+ /**
+ * A ConnectionFactory object encapsulates a set of connection
+ * configuration parameters that has been defined by an administrator.
+ * A client uses it to create a connection with a STOMP provider.
+ */
+ class TopicConnectionFactory : public ConnectionFactory{
+
+ public:
+
+ virtual ~TopicConnectionFactory(){}
+
+ /**
+ * Creates a topic connection with the default user identity.
+ */
+ virtual TopicConnection* createTopicConnection() throw( CMSException ) = 0;
+
+ /**
+ * Creates a topic connection with the specified user identity.
+ */
+ virtual TopicConnection* createTopicConnection(
+ const char* userName,
+ const char* password ) throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_TOPICCONNECTIONFACTORY_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicConnectionFactory.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,63 @@
+/*
+ * 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 _CMS_TOPICPUBLISHER_H_
+#define _CMS_TOPICPUBLISHER_H_
+
+#include <cms/MessageProducer.h>
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ // Forward declarations
+ class Message;
+ class Topic;
+
+ /**
+ * A client uses a TopicPublisher object to publish messages on
+ * a topic. A TopicPublisher object is the publish-subscribe form
+ * of a message producer.
+ */
+ class TopicPublisher : public MessageProducer{
+
+ public:
+
+ virtual ~TopicPublisher(){}
+
+ /**
+ * Gets the topic associated with this TopicPublisher.
+ */
+ virtual const Topic* getTopic() const throw( CMSException ) = 0;
+
+ /**
+ * Publishes a message to the topic.
+ * @param message the message to publish
+ */
+ virtual void publish( Message* message )
+ throw( CMSException ) = 0;
+
+ /**
+ * Publishes a message to a topic for an unidentified message producer.
+ * @param topic The topic to publish this message to.
+ * @param message The message to publish
+ */
+ virtual void publish( const Topic* topic,
+ Message* message ) throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_TOPICPUBLISHER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicPublisher.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,66 @@
+/*
+ * 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 _CMS_TOPICSESSION_H_
+#define _CMS_TOPICSESSION_H_
+
+#include <cms/Session.h>
+#include <string>
+
+namespace cms{
+
+ // Forward declarations.
+ class Topic;
+ class TopicPublisher;
+ class TopicSubscriber;
+
+ /**
+ * A TopicSession object provides methods for creating TopicPublisher,
+ * TopicSubscriber, and Topic objects.
+ */
+ class TopicSession : public Session{
+
+ public:
+
+ virtual ~TopicSession(){}
+
+ /**
+ * Creates a publisher for the specified topic.
+ * @param topic The Topic to publish to, or null if this is an
+ * unidentified producer
+ */
+ virtual TopicPublisher* createPublisher( const Topic* topic )
+ throw( CMSException ) = 0;
+
+ /**
+ * Creates a subscriber to the specified topic.
+ * @param topic The Topic to publish to, or null if this is an
+ * unidentified producer
+ */
+ virtual TopicSubscriber* createSubscriber( const Topic* topic )
+ throw( CMSException ) = 0;
+
+ /**
+ * Creates a topic identity given a Topic name.
+ */
+ virtual Topic* createTopic( const char* topicName )
+ throw( CMSException ) = 0;
+
+ };
+}
+
+#endif /*_CMS_TOPICSESSION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicSession.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,46 @@
+/*
+ * 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 _CMS_TOPICSUBSCRIBER_H_
+#define _CMS_TOPICSUBSCRIBER_H_
+
+#include <cms/MessageConsumer.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class Topic;
+
+ /**
+ * A client uses a TopicSubscriber object to receive messages
+ * that have been published to a topic. A TopicSubscriber object
+ * is the publish/subscribe form of a message consumer.
+ */
+ class TopicSubscriber : public MessageConsumer{
+
+ public:
+
+ virtual ~TopicSubscriber(){}
+
+ /**
+ * Gets the Topic associated with this subscriber.
+ */
+ virtual const Topic* getTopic() const throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_TOPICSUBSCRIBER_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TopicSubscriber.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,44 @@
+/*
+ * 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 _CMS_TRANSACTIONCONTROLLER_
+#define _CMS_TRANSACTIONCONTROLLER_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ class TransactionController{
+
+ public:
+
+ virtual ~TransactionController(){}
+
+ /**
+ * Commits the current transaction.
+ */
+ virtual void commit() throw( CMSException ) = 0;
+
+ /**
+ * Cancels the current transaction and rolls the system state
+ * back to before the transaction occurred.
+ */
+ virtual void rollback() throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_TRANSACTIONCONTROLLER_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/TransactionController.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/XAResource.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/XAResource.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/XAResource.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/XAResource.h Wed Mar 1 06:27:46 2006
@@ -0,0 +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.
+ */
+
+#ifndef _CMS_XARESOURCE_H_
+#define _CMS_XARESOURCE_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ class XAResource{
+
+ public:
+
+ virtual void commit( const Xid* xid ) throw( CMSException ) = 0;
+ virtual void rollback( const Xid* xid ) throw( CMSException ) = 0;
+ virtual void start( const Xid* xid ) throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_XARESOURCE_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XAResource.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XAResource.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/XASession.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/XASession.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/XASession.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/XASession.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,39 @@
+/*
+ * 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 _CMS_XASESSION_H_
+#define _CMS_XASESSION_H_
+
+#include <cms/Session.h>
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class XAResource;
+
+ class XASession : public Session{
+
+ public:
+
+ virtual ~XASession(){}
+
+ virtual XAResource* getXAResource() const throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_XASESSION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XASession.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XASession.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,38 @@
+/*
+ * 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 _CMS_XATOPICSESSION_H_
+#define _CMS_XATOPICSESSION_H_
+
+#include <cms/XASession.h>
+
+namespace cms{
+
+ // Forward declarations.
+ class TopicSession;
+
+ class XATopicSession : public XASession{
+
+ public:
+
+ virtual ~XATopicSession(){}
+
+ virtual TopicSession* getTopicSession() const throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_XATOPICSESSION_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/XATopicSession.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/cms/src/cms/Xid.h
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/cms/src/cms/Xid.h?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/cms/src/cms/Xid.h (added)
+++ incubator/activemq/trunk/cms/cms/src/cms/Xid.h Wed Mar 1 06:27:46 2006
@@ -0,0 +1,36 @@
+/*
+ * 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 _CMS_XID_H_
+#define _CMS_XID_H_
+
+#include <cms/CMSException.h>
+
+namespace cms{
+
+ class Xid{
+
+ public:
+
+ virtual ~Xid(){}
+
+ virtual const char* getTransactionId() const
+ throw( CMSException ) = 0;
+ };
+}
+
+#endif /*_CMS_XID_H_*/
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Xid.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/cms/src/cms/Xid.h
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: incubator/activemq/trunk/cms/docs/cms_overview.pdf
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/docs/cms_overview.pdf?rev=382028&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/activemq/trunk/cms/docs/cms_overview.pdf
------------------------------------------------------------------------------
svn:mime-type = application/pdf
Added: incubator/activemq/trunk/cms/test/main.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/test/main.cpp?rev=382028&view=auto
==============================================================================
--- incubator/activemq/trunk/cms/test/main.cpp (added)
+++ incubator/activemq/trunk/cms/test/main.cpp Wed Mar 1 06:27:46 2006
@@ -0,0 +1,114 @@
+#include <activemq/ActiveMQTextMessage.h>
+#include <cms/TopicConnectionFactory.h>
+#include <cms/TopicConnection.h>
+#include <cms/TopicSession.h>
+#include <cms/TopicSubscriber.h>
+#include <cms/Topic.h>
+#include <activemq/ActiveMQConnectionFactory.h>
+#include <cms/MessageListener.h>
+#include <cms/ExceptionListener.h>
+#include <cms/TopicPublisher.h>
+
+#include <stdlib.h>
+#include <sys/time.h>
+#include <iostream>
+
+using namespace std;
+
+class Tester
+:
+ public cms::ExceptionListener,
+ public cms::MessageListener
+{
+public:
+
+ Tester(){numReceived = 0;}
+ virtual ~Tester(){}
+
+ void test(){
+
+ try{
+
+ int numMessages = 1000;
+ int sleepTime = 10;
+
+ printf("Starting activemqcms test (sending %d messages and sleeping %d seconds) ...\n", numMessages, sleepTime );
+
+ cms::TopicConnectionFactory* connectionFactory = new activemq::ActiveMQConnectionFactory( "127.0.0.1:61626" );
+ cms::TopicConnection* connection = connectionFactory->createTopicConnection();
+ connection->setExceptionListener( this );
+ connection->start();
+ cms::TopicSession* session = connection->createTopicSession( false );
+ cms::Topic* topic = session->createTopic("mytopic");
+ cms::TopicSubscriber* subscriber = session->createSubscriber( topic );
+ subscriber->setMessageListener( this );
+ cms::TopicPublisher* publisher = session->createPublisher( topic );
+
+ const char* text = "this is a test!";
+ cms::TextMessage* msg = session->createTextMessage( text );
+
+ for( int ix=0; ix<numMessages; ++ix ){
+ publisher->publish( msg );
+
+
+ timespec sleepTime;
+ sleepTime.tv_sec = 0;
+ sleepTime.tv_nsec = 1000;
+ nanosleep( &sleepTime, &sleepTime );
+ }
+
+ sleep( sleepTime );
+
+ printf("received: %d\n", numReceived );
+
+ delete publisher;
+ subscriber->close();
+ delete subscriber;
+ session->close();
+ delete session;
+ connection->close();
+ delete connection;
+ delete connectionFactory;
+
+ }catch( cms::CMSException& ex ){
+ printf("StompTester::test() - %s\n", ex.getMessage() );
+ }
+ }
+
+ virtual void onMessage( const cms::Message* message ){
+ const cms::TextMessage* txtMsg = dynamic_cast<const cms::TextMessage*>(message);
+ if( txtMsg == NULL ){
+ printf("received non-text message\n" );
+ return;
+ }
+
+ numReceived++;
+ //printf( "[%d]: %s\n", ++ix, txtMsg->getMessage() );
+ }
+
+ virtual void onException( const cms::CMSException* error ){
+ printf( "StompTester::onException() - %s\n", error->getMessage() );
+ }
+
+private:
+
+ int numReceived;
+};
+
+int main(int argc, char *argv[]){
+ try{
+
+ Tester tester;
+ tester.test();
+
+ }catch( ... ){
+ printf("main - caught unknown exception\n" );
+ }
+
+ printf("done");
+
+ cout.flush();
+
+ return 0;
+}
+
Propchange: incubator/activemq/trunk/cms/test/main.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/trunk/cms/test/main.cpp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL