activemq-cpp-3.8.2
CachedProducer.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_CMSUTIL_CACHEDPRODUCER_H_
19 #define _ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_
20 
21 #include <cms/MessageProducer.h>
22 #include <activemq/util/Config.h>
23 
24 namespace activemq {
25 namespace cmsutil {
26 
31  private:
32 
33  cms::MessageProducer* producer;
34 
35  private:
36 
38  CachedProducer& operator=(const CachedProducer&);
39 
40  public:
41 
43 
44  virtual ~CachedProducer();
45 
50  virtual void close() {
51  // Do nothing.
52  }
53 
54  virtual void send(cms::Message* message) {
55  producer->send(message);
56  }
57 
58  virtual void send(cms::Message* message, cms::AsyncCallback* onComplete) {
59  producer->send(message, onComplete);
60  }
61 
62  virtual void send(cms::Message* message, int deliveryMode, int priority, long long timeToLive) {
63  producer->send(message, deliveryMode, priority, timeToLive);
64  }
65 
66  virtual void send(cms::Message* message, int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback* onComplete) {
67  producer->send(message, deliveryMode, priority, timeToLive, onComplete);
68  }
69 
70  virtual void send(const cms::Destination* destination, cms::Message* message) {
71  producer->send(destination, message);
72  }
73 
74  virtual void send(const cms::Destination* destination, cms::Message* message, cms::AsyncCallback* onComplete) {
75  producer->send(destination, message, onComplete);
76  }
77 
78  virtual void send(const cms::Destination* destination, cms::Message* message, int deliveryMode, int priority, long long timeToLive) {
79  producer->send(destination, message, deliveryMode, priority, timeToLive);
80  }
81 
82  virtual void send(const cms::Destination* destination, cms::Message* message, int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback* onComplete) {
83  producer->send(destination, message, deliveryMode, priority, timeToLive, onComplete);
84  }
85 
86  virtual void setDeliveryMode(int mode) {
87  producer->setDeliveryMode(mode);
88  }
89 
90  virtual int getDeliveryMode() const {
91  return producer->getDeliveryMode();
92  }
93 
94  virtual void setDisableMessageID(bool value) {
95  producer->setDisableMessageID(value);
96  }
97 
98  virtual bool getDisableMessageID() const {
99  return producer->getDisableMessageID();
100  }
101 
102  virtual void setDisableMessageTimeStamp(bool value) {
103  producer->setDisableMessageTimeStamp(value);
104  }
105 
106  virtual bool getDisableMessageTimeStamp() const {
107  return producer->getDisableMessageTimeStamp();
108  }
109 
110  virtual void setPriority(int priority) {
111  producer->setPriority(priority);
112  }
113 
114  virtual int getPriority() const {
115  return producer->getPriority();
116  }
117 
118  virtual void setTimeToLive(long long time) {
119  producer->setTimeToLive(time);
120  }
121 
122  virtual long long getTimeToLive() const {
123  return producer->getTimeToLive();
124  }
125 
126  virtual void setMessageTransformer(cms::MessageTransformer* transformer) {
127  producer->setMessageTransformer(transformer);
128  }
129 
131  return producer->getMessageTransformer();
132  }
133 
134  };
135 
136 }}
137 
138 #endif /*_ACTIVEMQ_CMSUTIL_CACHEDPRODUCER_H_*/
virtual bool getDisableMessageID() const
Gets if Message Ids are disabled for this Producer.
Definition: CachedProducer.h:98
virtual void setDeliveryMode(int mode)=0
Sets the delivery mode for this Producer.
Provides an interface for clients to transform cms::Message objects inside the CMS MessageProducer an...
Definition: MessageTransformer.h:37
virtual void send(const cms::Destination *destination, cms::Message *message, int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback *onComplete)
Sends the message to the designated destination, but does not take ownership of the message...
Definition: CachedProducer.h:82
virtual bool getDisableMessageTimeStamp() const
Gets if Message Time Stamps are disabled for this Producer.
Definition: CachedProducer.h:106
Root of all messages.
Definition: Message.h:88
A Destination object encapsulates a provider-specific address.
Definition: Destination.h:39
#define AMQCPP_API
Definition: Config.h:30
virtual void send(Message *message)=0
Sends the message to the default producer destination, but does not take ownership of the message...
virtual void send(cms::Message *message, cms::AsyncCallback *onComplete)
Sends the message to the default producer destination, but does not take ownership of the message...
Definition: CachedProducer.h:58
Asynchronous event interface for CMS asynchronous operations.
Definition: AsyncCallback.h:37
virtual void send(const cms::Destination *destination, cms::Message *message, int deliveryMode, int priority, long long timeToLive)
Sends the message to the designated destination, but does not take ownership of the message...
Definition: CachedProducer.h:78
virtual void setMessageTransformer(cms::MessageTransformer *transformer)=0
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent o...
virtual bool getDisableMessageID() const =0
Gets if Message Ids are disabled for this Producer.
virtual void send(cms::Message *message, int deliveryMode, int priority, long long timeToLive, cms::AsyncCallback *onComplete)
Sends the message to the default producer destination, but does not take ownership of the message...
Definition: CachedProducer.h:66
virtual void send(cms::Message *message, int deliveryMode, int priority, long long timeToLive)
Sends the message to the default producer destination, but does not take ownership of the message...
Definition: CachedProducer.h:62
virtual void setDisableMessageTimeStamp(bool value)=0
Sets if Message Time Stamps are disabled for this Producer.
virtual bool getDisableMessageTimeStamp() const =0
Gets if Message Time Stamps are disabled for this Producer.
virtual void setDisableMessageTimeStamp(bool value)
Sets if Message Time Stamps are disabled for this Producer.
Definition: CachedProducer.h:102
virtual void setTimeToLive(long long time)=0
Sets the Time to Live that this Producers sends messages with.
virtual int getPriority() const =0
Gets the Priority level that this producer sends messages at.
virtual void setDisableMessageID(bool value)
Sets if Message Ids are disabled for this Producer.
Definition: CachedProducer.h:94
virtual long long getTimeToLive() const =0
Gets the Time to Live that this producer sends messages with.
virtual void setPriority(int priority)=0
Sets the Priority that this Producers sends messages at.
virtual void setMessageTransformer(cms::MessageTransformer *transformer)
Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent o...
Definition: CachedProducer.h:126
virtual void setTimeToLive(long long time)
Sets the Time to Live that this Producers sends messages with.
Definition: CachedProducer.h:118
virtual int getPriority() const
Gets the Priority level that this producer sends messages at.
Definition: CachedProducer.h:114
virtual void send(cms::Message *message)
Sends the message to the default producer destination, but does not take ownership of the message...
Definition: CachedProducer.h:54
A client uses a MessageProducer object to send messages to a Destination.
Definition: MessageProducer.h:60
virtual int getDeliveryMode() const =0
Gets the delivery mode for this Producer.
virtual long long getTimeToLive() const
Gets the Time to Live that this producer sends messages with.
Definition: CachedProducer.h:122
virtual int getDeliveryMode() const
Gets the delivery mode for this Producer.
Definition: CachedProducer.h:90
virtual cms::MessageTransformer * getMessageTransformer() const
Gets the currently configured MessageTransformer for this MessageProducer.
Definition: CachedProducer.h:130
virtual void setPriority(int priority)
Sets the Priority that this Producers sends messages at.
Definition: CachedProducer.h:110
A cached message producer contained within a pooled session.
Definition: CachedProducer.h:30
virtual void send(const cms::Destination *destination, cms::Message *message)
Sends the message to the designated destination, but does not take ownership of the message...
Definition: CachedProducer.h:70
virtual void setDisableMessageID(bool value)=0
Sets if Message Ids are disabled for this Producer.
virtual void setDeliveryMode(int mode)
Sets the delivery mode for this Producer.
Definition: CachedProducer.h:86
virtual void send(const cms::Destination *destination, cms::Message *message, cms::AsyncCallback *onComplete)
Sends the message to the designated destination, but does not take ownership of the message...
Definition: CachedProducer.h:74
virtual cms::MessageTransformer * getMessageTransformer() const =0
Gets the currently configured MessageTransformer for this MessageProducer.
virtual void close()
Does nothing - the real producer resource will be closed by the lifecycle manager.
Definition: CachedProducer.h:50