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 2006/12/05 21:39:09 UTC
svn commit: r482768 - in
/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main:
activemq/connector/ activemq/connector/openwire/ activemq/connector/stomp/
activemq/core/ cms/
Author: tabish
Date: Tue Dec 5 12:39:08 2006
New Revision: 482768
URL: http://svn.apache.org/viewvc?view=rev&rev=482768
Log:
http://issues.apache.org/activemq/browse/AMQCPP-16
Adding createConsumer with nolocal
Adding close methods to consumer and producer.
Modified:
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/Connector.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageConsumer.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageProducer.h
incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/Connector.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/Connector.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/Connector.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/Connector.h Tue Dec 5 12:39:08 2006
@@ -109,13 +109,16 @@
* Create a Consumer for the given Session
* @param destination Destination to Subscribe to.
* @param session Session Information.
+ * @param Message Selector String
+ * @param should local messages be delivered back to this consumer
* @return Consumer Information
* @throws ConnectorException
*/
virtual ConsumerInfo* createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector = "" )
+ const std::string& selector = "",
+ bool noLocal = false )
throw ( ConnectorException ) = 0;
/**
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.cpp Tue Dec 5 12:39:08 2006
@@ -247,7 +247,8 @@
ConsumerInfo* OpenwireConnector::createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector )
+ const std::string& selector,
+ bool noLocal )
throw ( ConnectorException )
{
try
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenwireConnector.h Tue Dec 5 12:39:08 2006
@@ -255,13 +255,16 @@
* Create a Consumer for the given Session
* @param Destination to Subscribe to.
* @param Session Information.
+ * @param Message Selector
+ * @param No Local redelivery indicator
* @return Consumer Information
* @throws ConnectorException
*/
virtual ConsumerInfo* createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector = "" )
+ const std::string& selector = "",
+ bool noLocal = false )
throw ( ConnectorException );
/**
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp Tue Dec 5 12:39:08 2006
@@ -304,7 +304,8 @@
ConsumerInfo* StompConnector::createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector )
+ const std::string& selector,
+ bool noLocal )
throw ( ConnectorException )
{
try
@@ -312,7 +313,7 @@
enforceConnected();
return sessionManager->createConsumer(
- destination, session, selector );
+ destination, session, selector, noLocal );
}
AMQ_CATCH_RETHROW( ConnectorException )
AMQ_CATCHALL_THROW( ConnectorException );
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h Tue Dec 5 12:39:08 2006
@@ -260,13 +260,15 @@
* @param destination Destination to Subscribe to.
* @param session the session this consumer is attached to
* @param selector the selector string for this consumer
+ * @param noLocal should local message be delivered to the consumer
* @return Consumer Information
* @throws ConnectorException
*/
virtual ConsumerInfo* createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector = "" )
+ const std::string& selector = "",
+ bool noLocal = false )
throw ( ConnectorException );
/**
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp Tue Dec 5 12:39:08 2006
@@ -119,7 +119,8 @@
connector::ConsumerInfo* StompSessionManager::createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector )
+ const std::string& selector,
+ bool noLocal )
throw( StompConnectorException )
{
try
@@ -128,7 +129,7 @@
// appropriate params so that a regular consumer is created on
// the broker side.
return createDurableConsumer(
- destination, session, "", selector, false );
+ destination, session, "", selector, noLocal );
}
AMQ_CATCH_RETHROW( StompConnectorException )
AMQ_CATCHALL_THROW( StompConnectorException )
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h Tue Dec 5 12:39:08 2006
@@ -111,7 +111,8 @@
virtual connector::ConsumerInfo* createConsumer(
const cms::Destination* destination,
SessionInfo* session,
- const std::string& selector )
+ const std::string& selector = "",
+ bool noLocal = false )
throw( StompConnectorException );
/**
@@ -130,8 +131,8 @@
const cms::Destination* destination,
SessionInfo* session,
const std::string& name,
- const std::string& selector,
- bool noLocal )
+ const std::string& selector = "",
+ bool noLocal = false )
throw ( StompConnectorException );
/**
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp Tue Dec 5 12:39:08 2006
@@ -17,6 +17,7 @@
#include "ActiveMQConsumer.h"
#include <activemq/exceptions/NullPointerException.h>
+#include <activemq/exceptions/InvalidStateException.h>
#include <activemq/core/ActiveMQSession.h>
#include <activemq/core/ActiveMQMessage.h>
#include <cms/ExceptionListener.h>
@@ -45,6 +46,7 @@
this->listenerThread = NULL;
this->listener = NULL;
this->shutdown = false;
+ this->closed = false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -52,22 +54,38 @@
{
try
{
- // Dispose of the Consumer Info, this should stop us from getting
- // any more messages.
- session->onDestroySessionResource( this );
-
- // Stop the asynchronous message processin thread if it's
- // running.
- stopThread();
-
- // Purge all the pending messages
- purgeMessages();
+ close();
}
AMQ_CATCH_NOTHROW( ActiveMQException )
AMQ_CATCHALL_NOTHROW( )
}
////////////////////////////////////////////////////////////////////////////////
+void ActiveMQConsumer::close()
+ throw ( cms::CMSException )
+{
+ try
+ {
+ if( !closed ) {
+ // Dispose of the Consumer Info, this should stop us from getting
+ // any more messages.
+ session->onDestroySessionResource( this );
+
+ // Stop the asynchronous message processin thread if it's
+ // running.
+ stopThread();
+
+ // Purge all the pending messages
+ purgeMessages();
+
+ closed = true;
+ }
+ }
+ AMQ_CATCH_RETHROW( ActiveMQException )
+ AMQ_CATCHALL_THROW( ActiveMQException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
std::string ActiveMQConsumer::getMessageSelector(void) const
throw ( cms::CMSException )
{
@@ -81,10 +99,17 @@
}
////////////////////////////////////////////////////////////////////////////////
-cms::Message* ActiveMQConsumer::receive(void) throw ( cms::CMSException )
+cms::Message* ActiveMQConsumer::receive() throw ( cms::CMSException )
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQConsumer::receive - This Consumer is closed" );
+ }
+
synchronized( &msgQueue )
{
// Check for empty in case of spurious wakeup, or race to
@@ -128,6 +153,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQConsumer::receive - This Consumer is closed" );
+ }
+
synchronized( &msgQueue )
{
// Check for empty, and wait if its not
@@ -166,6 +198,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQConsumer::receive - This Consumer is closed" );
+ }
+
synchronized( &msgQueue )
{
if( !msgQueue.empty() )
@@ -196,6 +235,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQConsumer::receive - This Consumer is closed" );
+ }
+
synchronized( &listenerLock )
{
this->listener = listener;
@@ -217,6 +263,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQConsumer::receive - This Consumer is closed" );
+ }
+
// Delegate the Ack to the Session, we cast away copnstness since
// in a transactional session we might need to redeliver this
// message and update its data.
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h Tue Dec 5 12:39:08 2006
@@ -66,6 +66,9 @@
// down and the run method should return.
bool shutdown;
+ // Boolean that indicates if the consumer has been closed
+ bool closed;
+
public:
/**
@@ -77,7 +80,16 @@
virtual ~ActiveMQConsumer(void);
public: // Interface Implementation
-
+
+ /**
+ * Closes the Consumer. This will return all allocated resources
+ * and purge any outstanding messages. This method will block if
+ * there is a call to receive in progress, or a dispatch to a
+ * MessageListener in place
+ * @throws CMSException
+ */
+ virtual void close() throw ( cms::CMSException );
+
/**
* Synchronously Receive a Message
* @return new message
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp Tue Dec 5 12:39:08 2006
@@ -18,6 +18,7 @@
#include <activemq/core/ActiveMQSession.h>
#include <activemq/exceptions/NullPointerException.h>
+#include <activemq/exceptions/InvalidStateException.h>
#include <activemq/util/Date.h>
using namespace std;
@@ -41,13 +42,14 @@
// Init Producer Data
this->session = session;
this->producerInfo = producerInfo;
+ this->closed = false;
// Default the Delivery options
- defaultDeliveryMode = cms::DeliveryMode::PERSISTANT;
- disableMsgId = false;
- disableTimestamps = false;
- defaultPriority = 4;
- defaultTimeToLive = 0;
+ this->defaultDeliveryMode = cms::DeliveryMode::PERSISTANT;
+ this->disableMsgId = false;
+ this->disableTimestamps = false;
+ this->defaultPriority = 4;
+ this->defaultTimeToLive = 0;
}
////////////////////////////////////////////////////////////////////////////////
@@ -55,19 +57,42 @@
{
try
{
- // Dispose of the ProducerInfo
- session->onDestroySessionResource( this );
+ close();
}
AMQ_CATCH_NOTHROW( ActiveMQException )
AMQ_CATCHALL_NOTHROW( )
}
////////////////////////////////////////////////////////////////////////////////
+void ActiveMQProducer::close()
+ throw ( cms::CMSException )
+{
+ try
+ {
+ if( !closed ) {
+ // Dispose of the ProducerInfo
+ session->onDestroySessionResource( this );
+
+ closed = true;
+ }
+ }
+ AMQ_CATCH_RETHROW( ActiveMQException )
+ AMQ_CATCHALL_THROW( ActiveMQException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQProducer::send( cms::Message* message )
throw ( cms::CMSException )
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQProducer::send - This Producer is closed" );
+ }
+
send( &producerInfo->getDestination(), message );
}
AMQ_CATCH_RETHROW( ActiveMQException )
@@ -82,6 +107,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQProducer::send - This Producer is closed" );
+ }
+
send( &producerInfo->getDestination(), message, deliveryMode,
priority, timeToLive );
}
@@ -95,6 +127,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQProducer::send - This Producer is closed" );
+ }
+
send( destination, message, defaultDeliveryMode,
defaultPriority, defaultTimeToLive );
}
@@ -110,6 +149,13 @@
{
try
{
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQProducer::send - This Producer is closed" );
+ }
+
// configure the message
message->setCMSDestination( destination );
message->setCMSDeliveryMode( deliveryMode );
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h Tue Dec 5 12:39:08 2006
@@ -55,7 +55,10 @@
// This Producers protocal specific info object
connector::ProducerInfo* producerInfo;
-
+
+ // Boolean that indicates if the consumer has been closed
+ bool closed;
+
public:
/**
@@ -65,6 +68,15 @@
ActiveMQSession* session );
virtual ~ActiveMQProducer();
+
+ /**
+ * Closes the Consumer. This will return all allocated resources
+ * and purge any outstanding messages. This method will block if
+ * there is a call to receive in progress, or a dispatch to a
+ * MessageListener in place
+ * @throws CMSException
+ */
+ virtual void close() throw ( cms::CMSException );
/**
* Sends the message to the default producer destination.
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp Tue Dec 5 12:39:08 2006
@@ -148,7 +148,7 @@
"ActiveMQSession::createConsumer - Session Already Closed" );
}
- return createConsumer( destination, "" );
+ return createConsumer( destination, "", false );
}
AMQ_CATCH_RETHROW( ActiveMQException )
AMQ_CATCHALL_THROW( ActiveMQException )
@@ -169,9 +169,33 @@
"ActiveMQSession::createConsumer - Session Already Closed" );
}
+ return createConsumer( destination, selector, false );
+ }
+ AMQ_CATCH_RETHROW( ActiveMQException )
+ AMQ_CATCHALL_THROW( ActiveMQException )
+}
+////////////////////////////////////////////////////////////////////////////////
+cms::MessageConsumer* ActiveMQSession::createConsumer(
+ const cms::Destination* destination,
+ const std::string& selector,
+ bool noLocal )
+ throw ( cms::CMSException )
+{
+ try
+ {
+ if( closed )
+ {
+ throw InvalidStateException(
+ __FILE__, __LINE__,
+ "ActiveMQSession::createConsumer - Session Already Closed" );
+ }
+
ActiveMQConsumer* consumer = new ActiveMQConsumer(
connection->getConnectionData()->getConnector()->
- createConsumer( destination, sessionInfo, selector), this );
+ createConsumer( destination,
+ sessionInfo,
+ selector,
+ noLocal ), this );
connection->addMessageListener(
consumer->getConsumerInfo()->getConsumerId(), consumer );
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h Tue Dec 5 12:39:08 2006
@@ -91,11 +91,28 @@
* Creates a MessageConsumer for the specified destination, using a
* message selector.
* @param the Destination that this consumer receiving messages for.
+ * @param the Message Selector string to use for this destination
* @throws CMSException
*/
virtual cms::MessageConsumer* createConsumer(
const cms::Destination* destination,
const std::string& selector )
+ throw ( cms::CMSException );
+ /**
+ * Creates a MessageConsumer for the specified destination, using a
+ * message selector.
+ * @param the Destination that this consumer receiving messages for.
+ * @param the Message Selector string to use for this destination
+ * @param if true, and the destination is a topic, inhibits the
+ * delivery of messages published by its own connection. The
+ * behavior for NoLocal is not specified if the destination is
+ * a queue.
+ * @throws CMSException
+ */
+ virtual cms::MessageConsumer* createConsumer(
+ const cms::Destination* destination,
+ const std::string& selector,
+ bool noLocal )
throw ( cms::CMSException );
/**
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageConsumer.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageConsumer.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageConsumer.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageConsumer.h Tue Dec 5 12:39:08 2006
@@ -20,11 +20,12 @@
#include <cms/MessageListener.h>
#include <cms/Message.h>
+#include <cms/Closeable.h>
namespace cms
{
- class MessageConsumer
+ class MessageConsumer : public Closeable
{
public:
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageProducer.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageProducer.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageProducer.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MessageProducer.h Tue Dec 5 12:39:08 2006
@@ -20,6 +20,7 @@
#include <cms/Message.h>
#include <cms/Destination.h>
+#include <cms/Closeable.h>
#include <cms/CMSException.h>
#include <cms/DeliveryMode.h>
@@ -30,7 +31,7 @@
* by all MessageProducer derivations. This class defines the JMS
* spec'd interface for a MessageProducer.
*/
- class MessageProducer
+ class MessageProducer : public Closeable
{
public:
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h?view=diff&rev=482768&r1=482767&r2=482768
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Session.h Tue Dec 5 12:39:08 2006
@@ -105,6 +105,7 @@
* Creates a MessageConsumer for the specified destination, using a
* message selector.
* @param the Destination that this consumer receiving messages for.
+ * @param the Message Selector to use
* @return pointer to a new MessageConsumer that is owned by the
* caller ( caller deletes )
* @throws CMSException
@@ -112,6 +113,24 @@
virtual MessageConsumer* createConsumer(
const Destination* destination,
const std::string& selector )
+ throw ( CMSException ) = 0;
+
+ /**
+ * Creates a MessageConsumer for the specified destination, using a
+ * message selector.
+ * @param the Destination that this consumer receiving messages for.
+ * @param the Message Selector to use
+ * @param if true, and the destination is a topic, inhibits the
+ * delivery of messages published by its own connection. The behavior
+ * for NoLocal is not specified if the destination is a queue.
+ * @return pointer to a new MessageConsumer that is owned by the
+ * caller ( caller deletes )
+ * @throws CMSException
+ */
+ virtual MessageConsumer* createConsumer(
+ const Destination* destination,
+ const std::string& selector,
+ bool noLocal )
throw ( CMSException ) = 0;
/**