activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1026490 - in /activemq/activemq-cpp/trunk/activemq-c/src/main/c: CMS_Session.cpp CMS_Session.h
Date Fri, 22 Oct 2010 20:41:31 GMT
Author: tabish
Date: Fri Oct 22 20:41:30 2010
New Revision: 1026490

URL: http://svn.apache.org/viewvc?rev=1026490&view=rev
Log:
Wrap the remainder of the cms::Session methods.  

Modified:
    activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp
    activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h

Modified: activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp?rev=1026490&r1=1026489&r2=1026490&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp Fri Oct 22 20:41:30
2010
@@ -159,3 +159,71 @@ cms_status rollbackSession(CMS_Session* 
 
     return result;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status recoverSession(CMS_Session* session) {
+
+    cms_status result = CMS_SUCCESS;
+
+    if(session != NULL) {
+
+        try{
+            session->session->recover();
+        } catch(...) {
+            result = CMS_ERROR;
+        }
+    }
+
+    return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getSessionAcknowledgeMode(CMS_Session* session, int* mode) {
+
+    cms_status result = CMS_SUCCESS;
+
+    if(session != NULL && mode != NULL) {
+
+        try{
+            *mode = (int) session->session->getAcknowledgeMode();
+        } catch(...) {
+            result = CMS_ERROR;
+        }
+    }
+
+    return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status isSessionTransacted(CMS_Session* session, int* transacted) {
+
+    cms_status result = CMS_SUCCESS;
+
+    if(session != NULL && result != NULL) {
+
+        try{
+            *transacted = (int) session->session->isTransacted();
+        } catch(...) {
+            result = CMS_ERROR;
+        }
+    }
+
+    return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status unsubscribeSessionDurableConsumer(CMS_Session* session, const char* subscription)
{
+
+    cms_status result = CMS_SUCCESS;
+
+    if(session != NULL && subscription != NULL) {
+
+        try{
+            session->session->unsubscribe(subscription);
+        } catch(...) {
+            result = CMS_ERROR;
+        }
+    }
+
+    return result;
+}

Modified: activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h?rev=1026490&r1=1026489&r2=1026490&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h (original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h Fri Oct 22 20:41:30 2010
@@ -70,6 +70,8 @@ cms_status destroySession(CMS_Session* s
  *
  * @param session
  *      The Session that is to be closed.
+ *
+ * @return result code indicating the success or failure of the operation.
  */
 cms_status closeSession(CMS_Session* session);
 
@@ -78,6 +80,8 @@ cms_status closeSession(CMS_Session* ses
  *
  * @param session
  *      The Session that will have its current transaction committed.
+ *
+ * @return result code indicating the success or failure of the operation.
  */
 cms_status commitSession(CMS_Session* session);
 
@@ -86,9 +90,55 @@ cms_status commitSession(CMS_Session* se
  *
  * @param session
  *      The Session that will have its current transaction rolled back.
+ *
+ * @return result code indicating the success or failure of the operation.
  */
 cms_status rollbackSession(CMS_Session* session);
 
+/**
+ * Stop Message delivery in the given session and restart from the oldest unacknowledged
+ * Message.
+ *
+ * @param session
+ *      The Session that will be recovered.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status recoverSession(CMS_Session* session);
+
+/**
+ * Get the Acknowledge Mode that was used to create the given Session.
+ *
+ * @param session
+ *      The session that is the target for this operation.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getSessionAcknowledgeMode(CMS_Session* session, int* mode);
+
+/**
+ * Query the given Session to determine if it is a Transacted Session, if the Session is
+ * transacted then a value of 1 is written into the result address, otherwise zero is
+ * written into the result location.
+ *
+ * @param session
+ *      The session that is the target for this operation.
+ * @param transacted
+ *      The address where the boolean value is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status isSessionTransacted(CMS_Session* session, int* transacted);
+
+/**
+ *
+ * @param session
+ *    The session that is the target for this operation.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status unsubscribeSessionDurableConsumer(CMS_Session* session, const char* subscription);
+
 #ifdef __cplusplus
 }
 #endif



Mime
View raw message