activemq-cpp-3.6.0
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_*/