activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
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
21
#include <
activemq/util/Config.h
>
22
23
#include <
cms/Queue.h
>
24
#include <
cms/QueueBrowser.h
>
25
#include <
cms/MessageEnumeration.h
>
26
#include <
activemq/commands/ConsumerId.h
>
27
#include <
activemq/commands/ActiveMQDestination.h
>
28
#include <
activemq/core/kernels/ActiveMQSessionKernel.h
>
29
#include <
decaf/lang/Pointer.h
>
30
#include <
decaf/util/concurrent/Mutex.h
>
31
#include <
decaf/util/concurrent/atomic/AtomicBoolean.h
>
32
33
#include <string>
34
35
namespace
activemq {
36
namespace
core {
37
namespace
kernels {
38
class
ActiveMQConsumerKernel
;
39
}
40
41
class
ActiveMQSession
;
42
class
Browser;
43
44
using
decaf::lang::Pointer
;
45
46
class
AMQCPP_API
ActiveMQQueueBrowser
:
public
cms::QueueBrowser
,
47
public
cms::MessageEnumeration
{
48
private
:
49
50
friend
class
Browser;
51
52
activemq::core::kernels::ActiveMQSessionKernel
* session;
53
Pointer<commands::ConsumerId>
consumerId;
54
Pointer<commands::ActiveMQDestination>
destination;
55
std::string selector;
56
bool
dispatchAsync;
57
cms::Queue
* queue;
58
volatile
bool
closed;
59
60
mutable
decaf::util::concurrent::Mutex
mutex;
61
mutable
decaf::util::concurrent::Mutex
wait;
62
decaf::util::concurrent::atomic::AtomicBoolean
browseDone;
63
64
mutable
Pointer<activemq::core::kernels::ActiveMQConsumerKernel>
browser;
65
66
private
:
67
68
ActiveMQQueueBrowser
(
const
ActiveMQQueueBrowser
&);
69
ActiveMQQueueBrowser
& operator=(
const
ActiveMQQueueBrowser
&);
70
71
public
:
72
73
ActiveMQQueueBrowser
(
activemq::core::kernels::ActiveMQSessionKernel
* session,
74
const
Pointer<commands::ConsumerId>
& consumerId,
75
const
Pointer<commands::ActiveMQDestination>
& destination,
76
const
std::string& selector,
77
bool
dispatchAsync);
78
79
virtual
~
ActiveMQQueueBrowser
();
80
81
public
:
82
83
virtual
const
cms::Queue
* getQueue()
const
;
84
85
virtual
std::string getMessageSelector()
const
;
86
87
virtual
cms::MessageEnumeration
* getEnumeration();
88
89
virtual
void
close();
90
91
virtual
bool
hasMoreMessages();
92
93
virtual
cms::Message
* nextMessage();
94
95
private
:
96
97
void
checkClosed();
98
void
notifyMessageAvailable();
99
void
waitForMessageAvailable();
100
101
Pointer<activemq::core::kernels::ActiveMQConsumerKernel>
createConsumer();
102
void
destroyConsumer();
103
104
};
105
106
}}
107
108
#endif
/* _ACTIVEMQ_CORE_ACTIVEMQQUEUEBROWSER_H_ */
src
main
activemq
core
ActiveMQQueueBrowser.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2