diff options
author | Stephen D. Huston <shuston@apache.org> | 2011-10-21 14:42:12 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2011-10-21 14:42:12 +0000 |
commit | f83677056891e436bf5ba99e79240df2a44528cd (patch) | |
tree | 625bfd644b948e89105630759cf6decb0435354d /cpp/include/qpid/messaging/Session.h | |
parent | ebfd9ff053b04ab379acfc0fefedee5a31b6d8a5 (diff) | |
download | qpid-python-QPID-2519.tar.gz |
Merged out from trunkQPID-2519
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include/qpid/messaging/Session.h')
-rw-r--r-- | cpp/include/qpid/messaging/Session.h | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/cpp/include/qpid/messaging/Session.h b/cpp/include/qpid/messaging/Session.h index 6c023629e0..e8d6efb35d 100644 --- a/cpp/include/qpid/messaging/Session.h +++ b/cpp/include/qpid/messaging/Session.h @@ -46,7 +46,7 @@ class SessionImpl; * A session represents a distinct 'conversation' which can involve * sending and receiving messages to and from different addresses. */ -class Session : public qpid::messaging::Handle<SessionImpl> +class QPID_MESSAGING_CLASS_EXTERN Session : public qpid::messaging::Handle<SessionImpl> { public: QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0); @@ -62,6 +62,12 @@ class Session : public qpid::messaging::Handle<SessionImpl> */ QPID_MESSAGING_EXTERN void close(); + /** + * Commits the sessions transaction. + * + * @exception TransactionAborted if the original session is lost + * forcing an automatic rollback. + */ QPID_MESSAGING_EXTERN void commit(); QPID_MESSAGING_EXTERN void rollback(); @@ -78,6 +84,10 @@ class Session : public qpid::messaging::Handle<SessionImpl> */ QPID_MESSAGING_EXTERN void acknowledge(Message&, bool sync=false); /** + * Acknowledges all message up to the specified message. + */ + QPID_MESSAGING_EXTERN void acknowledgeUpTo(Message&, bool sync=false); + /** * Rejects the specified message. The broker does not redeliver a * message that has been rejected. Once a message has been * acknowledged, it can no longer be rejected. @@ -135,25 +145,51 @@ class Session : public qpid::messaging::Handle<SessionImpl> /** * Create a new sender through which messages can be sent to the * specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address */ QPID_MESSAGING_EXTERN Sender createSender(const Address& address); + /** + * Create a new sender through which messages can be sent to the + * specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address + * + * @exception MalformedAddress if the syntax of address is not + * valid + */ QPID_MESSAGING_EXTERN Sender createSender(const std::string& address); /** * Create a new receiver through which messages can be received * from the specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address */ QPID_MESSAGING_EXTERN Receiver createReceiver(const Address& address); + /** + * Create a new receiver through which messages can be received + * from the specified address. + * + * @exception ResolutionError if there is an error in resolving + * the address + * + * @exception MalformedAddress if the syntax of address is not + * valid + */ QPID_MESSAGING_EXTERN Receiver createReceiver(const std::string& address); /** * Returns the sender with the specified name. - *@exception KeyError if there is none for that name. + * @exception KeyError if there is none for that name. */ QPID_MESSAGING_EXTERN Sender getSender(const std::string& name) const; /** * Returns the receiver with the specified name. - *@exception KeyError if there is none for that name. + * @exception KeyError if there is none for that name. */ QPID_MESSAGING_EXTERN Receiver getReceiver(const std::string& name) const; /** @@ -162,7 +198,16 @@ class Session : public qpid::messaging::Handle<SessionImpl> */ QPID_MESSAGING_EXTERN Connection getConnection() const; + /** + * @returns true if the session has been rendered invalid by some + * exception, false if it is valid for use. + */ QPID_MESSAGING_EXTERN bool hasError(); + /** + * If the session has been rendered invalid by some exception, + * this method will result in that exception being thrown on + * calling this method. + */ QPID_MESSAGING_EXTERN void checkError(); #ifndef SWIG |