activemq-cpp-3.9.5
ActiveMQQueueBrowser.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _ACTIVEMQ_CORE_ACTIVEMQQUEUEBROWSER_H_
19#define _ACTIVEMQ_CORE_ACTIVEMQQUEUEBROWSER_H_
20
22
23#include <cms/Queue.h>
24#include <cms/QueueBrowser.h>
29#include <decaf/lang/Pointer.h>
32
33#include <string>
34
35namespace activemq {
36namespace core {
37namespace kernels {
39}
40
41 class ActiveMQSession;
42 class Browser;
43
45
46 class AMQCPP_API ActiveMQQueueBrowser : public cms::QueueBrowser,
48 private:
49
50 friend class Browser;
51
55 std::string selector;
56 bool dispatchAsync;
57 cms::Queue* queue;
59
63
65
66 private:
67
68 ActiveMQQueueBrowser(const ActiveMQQueueBrowser&);
69 ActiveMQQueueBrowser& operator=(const ActiveMQQueueBrowser&);
70
71 public:
72
74 const Pointer<commands::ConsumerId>& consumerId,
76 const std::string& selector,
77 bool dispatchAsync);
78
80
81 public:
82
83 virtual const cms::Queue* getQueue() const;
84
85 virtual std::string getMessageSelector() const;
86
88
89 virtual void close();
90
91 virtual bool hasMoreMessages();
92
94
95 private:
96
97 void checkClosed();
98 void notifyMessageAvailable();
99 void waitForMessageAvailable();
100
102 void destroyConsumer();
103
104 };
105
106}}
107
108#endif /* _ACTIVEMQ_CORE_ACTIVEMQQUEUEBROWSER_H_ */
#define AMQCPP_API
Definition Config.h:30
virtual bool hasMoreMessages()
Returns true if there are more Message in the Browser that can be retrieved via the nextMessage metho...
virtual cms::MessageEnumeration * getEnumeration()
Gets a pointer to an Enumeration object for browsing the Messages currently in the Queue in the order...
ActiveMQQueueBrowser(activemq::core::kernels::ActiveMQSessionKernel *session, const Pointer< commands::ConsumerId > &consumerId, const Pointer< commands::ActiveMQDestination > &destination, const std::string &selector, bool dispatchAsync)
virtual std::string getMessageSelector() const
virtual cms::Message * nextMessage()
Returns the Next Message in the Queue if one is present, if no more Message's are available then an E...
virtual const cms::Queue * getQueue() const
friend class Browser
Definition ActiveMQQueueBrowser.h:50
virtual void close()
Closes this object and deallocates the appropriate resources.
Definition ActiveMQSession.h:42
Definition ActiveMQConsumerKernel.h:49
Definition ActiveMQSessionKernel.h:67
Defines an object that enumerates a collection of Messages.
Definition MessageEnumeration.h:35
Root of all messages.
Definition Message.h:88
This class implements in interface for browsing the messages in a Queue without removing them.
Definition QueueBrowser.h:53
An interface encapsulating a provider-specific queue name.
Definition Queue.h:37
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
Mutex object that offers recursive support on all platforms as well as providing the ability to use t...
Definition Mutex.h:39
A boolean value that may be updated atomically.
Definition AtomicBoolean.h:34
Definition ActiveMQQueueBrowser.h:37
Definition ActiveMQTempDestination.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24