Author: tabish
Date: Thu Feb 15 10:50:19 2007
New Revision: 508069
URL: http://svn.apache.org/viewvc?view=rev&rev=508069
Log:
http://issues.apache.org/activemq/browse/AMQCPP-30
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h?view=diff&rev=508069&r1=508068&r2=508069
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireConsumerInfo.h
Thu Feb 15 10:50:19 2007
@@ -33,24 +33,12 @@
// OpenWire's Consumer Info Command
commands::ConsumerInfo* consumerInfo;
- // Message Selector for this Consumer
- std::string selector;
-
- // Consumer Id
- unsigned int consumerId;
-
- // Destination
- cms::Destination* destination;
-
// Session Info - We do not own this
const SessionInfo* session;
public:
OpenWireConsumerInfo() {
- selector = "";
- consumerId = 0;
- destination = NULL;
session = NULL;
}
@@ -61,6 +49,12 @@
* @return This Consumer's selector expression or "".
*/
virtual const std::string& getMessageSelector(void) const {
+ static std::string selector = "";
+
+ if( consumerInfo != NULL ) {
+ selector = consumerInfo->getSelector();
+ }
+
return selector;
}
@@ -69,7 +63,9 @@
* @param selector This Consumer's selector expression or "".
*/
virtual void setMessageSelector( const std::string& selector ) {
- this->selector = selector;
+ if( consumerInfo != NULL ){
+ this->consumerInfo->setSelector( selector );
+ }
}
/**
@@ -77,7 +73,12 @@
* @return value of the Consumer Id.
*/
virtual unsigned int getConsumerId(void) const {
- return consumerId;
+ if( consumerInfo != NULL ) {
+ return (unsigned int)
+ this->consumerInfo->getConsumerId()->getValue();
+ }
+
+ return 0;
}
/**
@@ -85,7 +86,9 @@
* @param id value of the Consumer Id.
*/
virtual void setConsumerId( const unsigned int id ) {
- this->consumerId = id;
+ if( this->consumerInfo != NULL ) {
+ this->consumerInfo->getConsumerId()->setValue( id );
+ }
}
/**
@@ -93,7 +96,7 @@
* @return Destination this consumer is attached to
*/
virtual const cms::Destination& getDestination(void) const {
- return *destination;
+ //return *(this->consumerInfo->getDestination());
}
/**
@@ -101,7 +104,12 @@
* @param destination Destination this consumer is attached to
*/
virtual void setDestination( const cms::Destination& destination ) {
- this->destination = destination.clone();
+ if( consumerInfo != NULL ) {
+
+ this->consumerInfo->setDestination(
+ dynamic_cast<commands::ActiveMQDestination*>(
+ destination.clone() ) );
+ }
}
/**
|