activemq-cpp-3.8.2
ActiveMQConsumer.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 #ifndef _ACTIVEMQ_CORE_ACTIVEMQCONSUMER_H_
18 #define _ACTIVEMQ_CORE_ACTIVEMQCONSUMER_H_
19 
20 #include <cms/MessageConsumer.h>
21 #include <cms/MessageListener.h>
22 #include <cms/Message.h>
23 #include <cms/CMSException.h>
24 
25 #include <activemq/util/Config.h>
29 
30 #include <decaf/lang/Pointer.h>
31 
32 namespace activemq{
33 namespace core{
34 
36 
37  class ActiveMQSession;
38  class ActiveMQConsumerData;
39 
41  private:
42 
43  ActiveMQConsumerData* config;
44 
45  private:
46 
48  ActiveMQConsumer& operator=(const ActiveMQConsumer&);
49 
50  public:
51 
60 
61  virtual ~ActiveMQConsumer();
62 
63  public: // Interface Implementation for cms::MessageConsumer
64 
65  virtual void start();
66 
67  virtual void stop();
68 
69  virtual void close();
70 
71  virtual cms::Message* receive();
72 
73  virtual cms::Message* receive(int millisecs);
74 
75  virtual cms::Message* receiveNoWait();
76 
77  virtual void setMessageListener(cms::MessageListener* listener);
78 
79  virtual cms::MessageListener* getMessageListener() const;
80 
81  virtual void setMessageAvailableListener(cms::MessageAvailableListener* listener);
82 
83  virtual cms::MessageAvailableListener* getMessageAvailableListener() const;
84 
85  virtual std::string getMessageSelector() const;
86 
87  virtual void setMessageTransformer(cms::MessageTransformer* transformer);
88 
89  virtual cms::MessageTransformer* getMessageTransformer() const;
90 
91  public:
92 
97  const Pointer<commands::ConsumerInfo>& getConsumerInfo() const;
98 
103  const Pointer<commands::ConsumerId>& getConsumerId() const;
104 
108  bool isClosed() const;
109 
113  int getMessageAvailableCount() const;
114 
124  void setRedeliveryPolicy(RedeliveryPolicy* policy);
125 
132  RedeliveryPolicy* getRedeliveryPolicy() const;
133 
140  decaf::lang::Exception* getFailureError() const;
141 
148  long long getOptimizedAckScheduledAckInterval() const;
149 
158  void setOptimizedAckScheduledAckInterval(long long value);
159 
163  bool isOptimizeAcknowledge() const;
164 
171  void setOptimizeAcknowledge(bool value);
172 
173  };
174 
175 }}
176 
177 #endif /*_ACTIVEMQ_CORE_ACTIVEMQCONSUMER_H_*/
Provides an interface for clients to transform cms::Message objects inside the CMS MessageProducer an...
Definition: MessageTransformer.h:37
Interface for a RedeliveryPolicy object that controls how message Redelivery is handled in ActiveMQ-C...
Definition: RedeliveryPolicy.h:34
Root of all messages.
Definition: Message.h:88
#define AMQCPP_API
Definition: Config.h:30
Definition: ActiveMQConsumer.h:40
A client uses a MessageConsumer to received messages from a destination.
Definition: MessageConsumer.h:63
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Definition: Exception.h:38
A listener interface similar to the MessageListener interface.
Definition: MessageAvailableListener.h:33
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
A MessageListener object is used to receive asynchronously delivered messages.
Definition: MessageListener.h:33