activemq-cpp-3.8.2
ActiveMQProducer.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_ACTIVEMQPRODUCER_H_
18 #define _ACTIVEMQ_CORE_ACTIVEMQPRODUCER_H_
19 
20 #include <cms/MessageProducer.h>
21 #include <cms/Message.h>
22 #include <cms/Destination.h>
23 #include <cms/DeliveryMode.h>
24 
25 #include <activemq/util/Config.h>
28 
29 namespace activemq{
30 namespace core{
31 
33 
34  class ActiveMQSession;
35 
37  private:
38 
40 
41  private:
42 
44  ActiveMQProducer& operator=(const ActiveMQProducer&);
45 
46  public:
47 
56 
57  virtual ~ActiveMQProducer();
58 
59  public: // cms::MessageProducer methods.
60 
61  virtual void close();
62 
63  virtual void send(cms::Message* message);
64 
65  virtual void send(cms::Message* message, cms::AsyncCallback* callback);
66 
67  virtual void send(cms::Message* message, int deliveryMode, int priority, long long timeToLive);
68 
69  virtual void send(cms::Message* message, int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback* callback);
70 
71  virtual void send(const cms::Destination* destination, cms::Message* message);
72 
73  virtual void send(const cms::Destination* destination, cms::Message* message, cms::AsyncCallback* callback);
74 
75  virtual void send(const cms::Destination* destination, cms::Message* message,
76  int deliveryMode, int priority, long long timeToLive);
77 
78  virtual void send(const cms::Destination* destination, cms::Message* message,
79  int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback* callback);
80 
85  virtual void setDeliveryMode(int mode) {
86  this->kernel->setDeliveryMode(mode);
87  }
88 
93  virtual int getDeliveryMode() const {
94  return this->kernel->getDeliveryMode();
95  }
96 
101  virtual void setDisableMessageID(bool value) {
102  this->kernel->setDisableMessageID(value);
103  }
104 
109  virtual bool getDisableMessageID() const {
110  return this->kernel->getDisableMessageID();
111  }
112 
117  virtual void setDisableMessageTimeStamp(bool value) {
118  this->kernel->setDisableMessageTimeStamp(value);
119  }
120 
125  virtual bool getDisableMessageTimeStamp() const {
126  return this->kernel->getDisableMessageTimeStamp();
127  }
128 
133  virtual void setPriority(int priority) {
134  this->kernel->setPriority(priority);
135  }
136 
141  virtual int getPriority() const {
142  return this->kernel->getPriority();
143  }
144 
149  virtual void setTimeToLive(long long time) {
150  this->kernel->setTimeToLive(time);
151  }
152 
157  virtual long long getTimeToLive() const {
158  return this->kernel->getTimeToLive();
159  }
160 
165  virtual void setSendTimeout(long long time) {
166  this->kernel->setSendTimeout(time);
167  }
168 
173  virtual long long getSendTimeout() const {
174  return this->kernel->getSendTimeout();
175  }
176 
177  virtual void setMessageTransformer(cms::MessageTransformer* transformer) {
178  this->kernel->setMessageTransformer(transformer);
179  }
180 
182  return this->kernel->getMessageTransformer();
183  }
184 
185  public:
186 
190  bool isClosed() const {
191  return this->kernel->isClosed();
192  }
193 
199  return this->kernel->getProducerInfo();
200  }
201 
207  return this->kernel->getProducerId();
208  }
209  };
210 
211 }}
212 
213 #endif /*_ACTIVEMQ_CORE_ACTIVEMQPRODUCER_H_*/
virtual void setTimeToLive(long long time)
Sets the Time to Live that this Producers sends messages with.
Definition: ActiveMQProducerKernel.h:225
virtual long long getTimeToLive() const
Gets the Time to Live that this producer sends messages with.
Definition: ActiveMQProducerKernel.h:233
virtual void setDeliveryMode(int mode)
Sets the delivery mode for this Producer.
Definition: ActiveMQProducerKernel.h:161
Provides an interface for clients to transform cms::Message objects inside the CMS MessageProducer an...
Definition: MessageTransformer.h:37
bool isClosed() const
Definition: ActiveMQProducerKernel.h:256
virtual void setMessageTransformer(cms::MessageTransformer *transformer)
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent o...
Definition: ActiveMQProducer.h:177
Root of all messages.
Definition: Message.h:88
virtual void setDisableMessageID(bool value)
Sets if Message Ids are disabled for this Producer.
Definition: ActiveMQProducer.h:101
A Destination object encapsulates a provider-specific address.
Definition: Destination.h:39
#define AMQCPP_API
Definition: Config.h:30
Asynchronous event interface for CMS asynchronous operations.
Definition: AsyncCallback.h:37
const Pointer< commands::ProducerInfo > & getProducerInfo() const
Retries this object ProducerInfo pointer.
Definition: ActiveMQProducer.h:198
bool isClosed() const
Definition: ActiveMQProducer.h:190
virtual int getPriority() const
Gets the Priority level that this producer sends messages at.
Definition: ActiveMQProducer.h:141
virtual long long getSendTimeout() const
Gets the Send Timeout that this producer sends messages with.
Definition: ActiveMQProducerKernel.h:249
virtual bool getDisableMessageID() const
Gets if Message Ids are disabled for this Producer.
Definition: ActiveMQProducer.h:109
const Pointer< commands::ProducerInfo > & getProducerInfo() const
Retries this object ProducerInfo pointer.
Definition: ActiveMQProducerKernel.h:264
virtual long long getSendTimeout() const
Gets the Send Timeout that this producer sends messages with.
Definition: ActiveMQProducer.h:173
const Pointer< commands::ProducerId > & getProducerId() const
Retries this object ProducerId or NULL if closed.
Definition: ActiveMQProducer.h:206
virtual void setMessageTransformer(cms::MessageTransformer *transformer)
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent o...
Definition: ActiveMQProducerKernel.h:144
virtual void setDeliveryMode(int mode)
Sets the delivery mode for this Producer.
Definition: ActiveMQProducer.h:85
virtual int getPriority() const
Gets the Priority level that this producer sends messages at.
Definition: ActiveMQProducerKernel.h:217
virtual void setPriority(int priority)
Sets the Priority that this Producers sends messages at.
Definition: ActiveMQProducer.h:133
virtual void setSendTimeout(long long time)
Sets the Send Timeout that this Producers sends messages with.
Definition: ActiveMQProducerKernel.h:241
virtual void setPriority(int priority)
Sets the Priority that this Producers sends messages at.
Definition: ActiveMQProducerKernel.h:209
virtual void setTimeToLive(long long time)
Sets the Time to Live that this Producers sends messages with.
Definition: ActiveMQProducer.h:149
const Pointer< commands::ProducerId > & getProducerId() const
Retries this object ProducerId or NULL if closed.
Definition: ActiveMQProducerKernel.h:273
A client uses a MessageProducer object to send messages to a Destination.
Definition: MessageProducer.h:60
virtual bool getDisableMessageTimeStamp() const
Gets if Message Time Stamps are disabled for this Producer.
Definition: ActiveMQProducer.h:125
virtual void setDisableMessageTimeStamp(bool value)
Sets if Message Time Stamps are disabled for this Producer.
Definition: ActiveMQProducerKernel.h:193
virtual void setDisableMessageTimeStamp(bool value)
Sets if Message Time Stamps are disabled for this Producer.
Definition: ActiveMQProducer.h:117
virtual int getDeliveryMode() const
Gets the delivery mode for this Producer.
Definition: ActiveMQProducer.h:93
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
virtual bool getDisableMessageID() const
Gets if Message Ids are disabled for this Producer.
Definition: ActiveMQProducerKernel.h:185
virtual void setDisableMessageID(bool value)
Sets if Message Ids are disabled for this Producer.
Definition: ActiveMQProducerKernel.h:177
virtual int getDeliveryMode() const
Gets the delivery mode for this Producer.
Definition: ActiveMQProducerKernel.h:169
virtual bool getDisableMessageTimeStamp() const
Gets if Message Time Stamps are disabled for this Producer.
Definition: ActiveMQProducerKernel.h:201
virtual void setSendTimeout(long long time)
Sets the Send Timeout that this Producers sends messages with.
Definition: ActiveMQProducer.h:165
virtual cms::MessageTransformer * getMessageTransformer() const
Gets the currently configured MessageTransformer for this MessageProducer.
Definition: ActiveMQProducer.h:181
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
virtual cms::MessageTransformer * getMessageTransformer() const
Gets the currently configured MessageTransformer for this MessageProducer.
Definition: ActiveMQProducerKernel.h:153
Definition: ActiveMQProducer.h:36
virtual long long getTimeToLive() const
Gets the Time to Live that this producer sends messages with.
Definition: ActiveMQProducer.h:157