summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/messaging/MessageListener.h49
-rw-r--r--cpp/include/qpid/messaging/Receiver.h8
-rw-r--r--cpp/include/qpid/messaging/Session.h20
3 files changed, 16 insertions, 61 deletions
diff --git a/cpp/include/qpid/messaging/MessageListener.h b/cpp/include/qpid/messaging/MessageListener.h
deleted file mode 100644
index 72811e7b9c..0000000000
--- a/cpp/include/qpid/messaging/MessageListener.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef QPID_MESSAGING_MESSAGELISTENER_H
-#define QPID_MESSAGING_MESSAGELISTENER_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "qpid/client/ClientImportExport.h"
-
-namespace qpid {
-namespace messaging {
-
-class Message;
-
-/**
- * To use a push style interface for receiving messages, applications
- * provide implementations of this interface and pass an implementing
- * instance to MessageSource::subscribe().
- *
- * Messages arriving for that subscription will then be passed to the
- * implementation via the received() method.
- */
-class MessageListener
-{
- public:
- QPID_CLIENT_EXTERN virtual ~MessageListener() {}
- virtual void received(Message&) = 0;
- private:
-};
-
-}} // namespace qpid::messaging
-
-#endif /*!QPID_MESSAGING_MESSAGELISTENER_H*/
diff --git a/cpp/include/qpid/messaging/Receiver.h b/cpp/include/qpid/messaging/Receiver.h
index a4fdd7a34b..1d72e5fc49 100644
--- a/cpp/include/qpid/messaging/Receiver.h
+++ b/cpp/include/qpid/messaging/Receiver.h
@@ -36,7 +36,6 @@ template <class> class PrivateImplRef;
namespace messaging {
class Message;
-class MessageListener;
class ReceiverImpl;
/**
@@ -121,13 +120,6 @@ class Receiver : public qpid::client::Handle<ReceiverImpl>
* Cancels this receiver.
*/
QPID_CLIENT_EXTERN void cancel();
-
- /**
- * Set a message listener for this receiver.
- *
- * @see Session::dispatch()
- */
- QPID_CLIENT_EXTERN void setListener(MessageListener* listener);
private:
friend class qpid::client::PrivateImplRef<Receiver>;
};
diff --git a/cpp/include/qpid/messaging/Session.h b/cpp/include/qpid/messaging/Session.h
index d77ddf3e43..4b23d355ec 100644
--- a/cpp/include/qpid/messaging/Session.h
+++ b/cpp/include/qpid/messaging/Session.h
@@ -45,7 +45,7 @@ class Subscription;
/**
* A session represents a distinct 'conversation' which can involve
- * sending and receiving messages from different sources and sinks.
+ * sending and receiving messages to and from different addresses.
*/
class Session : public qpid::client::Handle<SessionImpl>
{
@@ -85,10 +85,22 @@ class Session : public qpid::client::Handle<SessionImpl>
* has not yet been confirmed as processed by the server.
*/
QPID_CLIENT_EXTERN uint32_t pendingAck();
- QPID_CLIENT_EXTERN bool fetch(Message& message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
- QPID_CLIENT_EXTERN Message fetch(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
- QPID_CLIENT_EXTERN bool dispatch(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+ /**
+ * Retrieves the receiver for the next available message. If there
+ * are no available messages at present the call will block for up
+ * to the specified timeout waiting for one to arrive. Returns
+ * true if a message was available at the point of return, in
+ * which case the passed in receiver reference will be set to the
+ * receiver for that message or fals if no message was available.
+ */
QPID_CLIENT_EXTERN bool nextReceiver(Receiver&, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+ /**
+ * Returns the receiver for the next available message. If there
+ * are no available messages at present the call will block for up
+ * to the specified timeout waiting for one to arrive. Will throw
+ * Receiver::NoMessageAvailable if no message became available in
+ * time.
+ */
QPID_CLIENT_EXTERN Receiver nextReceiver(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);