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 2007/02/15 16:31:50 UTC
svn commit: r507963 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h
Author: tabish
Date: Thu Feb 15 07:31:50 2007
New Revision: 507963
URL: http://svn.apache.org/viewvc?view=rev&rev=507963
Log:
http://issues.apache.org/activemq/browse/AMQCPP-30
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h?view=diff&rev=507963&r1=507962&r2=507963
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireSessionInfo.h Thu Feb 15 07:31:50 2007
@@ -37,12 +37,8 @@
// Acknowledge Mode of this Session
cms::Session::AcknowledgeMode ackMode;
- // The id of the connection to the broker
- // (given to us by the broker)
- std::string connectionId;
-
- // The unique session id
- unsigned int sessionId;
+ // Internal String used to buffer the ConnectionId
+ mutable std::string connectionId;
// Info for this sessions current transaction
const TransactionInfo* transaction;
@@ -50,7 +46,6 @@
public:
OpenWireSessionInfo() {
- sessionId = 0;
ackMode = cms::Session::AUTO_ACKNOWLEDGE;
transaction = NULL;
sessionInfo = NULL;
@@ -63,6 +58,10 @@
* @return string value of the connection id
*/
virtual const std::string& getConnectionId(void) const{
+ if( sessionInfo != NULL ) {
+ connectionId = sessionInfo->getSessionId()->getConnectionId();
+ }
+
return connectionId;
}
@@ -71,8 +70,8 @@
* using to receive its messages.
* @param id string value of the connection id
*/
- virtual void setConnectionId( const std::string& id ){
- connectionId = id;
+ virtual void setConnectionId( const std::string& id AMQCPP_UNUSED ){
+ // Do Nothing here.
}
/**
@@ -80,15 +79,19 @@
* @return id for this session
*/
virtual unsigned int getSessionId(void) const {
- return sessionId;
+ if( sessionInfo != NULL ) {
+ return (unsigned int)sessionInfo->getSessionId()->getValue();
+ }
+
+ return 0;
}
/**
* Sets the Session Id for this Session
* @param id integral id value for this session
*/
- virtual void setSessionId( const unsigned int id ) {
- this->sessionId = id;
+ virtual void setSessionId( const unsigned int id AMQCPP_UNUSED ) {
+ // Do nothing here
}
/**