activemq-cpp-3.9.5
CmsAccessor.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_CMSUTIL_CMSACCESSOR_H_
18#define _ACTIVEMQ_CMSUTIL_CMSACCESSOR_H_
19
23
24namespace activemq {
25namespace cmsutil {
26
40 private:
41
42 ResourceLifecycleManager resourceLifecycleManager;
43
44 cms::ConnectionFactory* connectionFactory;
45
46 cms::Session::AcknowledgeMode sessionAcknowledgeMode;
47
48 protected:
49
52
53 public:
54
56
57 virtual ~CmsAccessor();
58
60 return &resourceLifecycleManager;
61 }
62
64 return &resourceLifecycleManager;
65 }
66
70 virtual void setConnectionFactory(cms::ConnectionFactory* connectionFactory) {
71 this->connectionFactory = connectionFactory;
72 }
73
79 return this->connectionFactory;
80 }
81
87 return this->connectionFactory;
88 }
89
98 virtual void setSessionAcknowledgeMode(cms::Session::AcknowledgeMode sessionAcknowledgeMode) {
99 this->sessionAcknowledgeMode = sessionAcknowledgeMode;
100 }
101
108 return this->sessionAcknowledgeMode;
109 }
110
111 protected:
112
120 virtual void init();
121
128 virtual void destroy() {
129 resourceLifecycleManager.destroy();
130 }
131
141
154
161
162 };
163
164}}
165
166#endif /* _ACTIVEMQ_CMSUTIL_CMSACCESSOR_H_ */
#define AMQCPP_API
Definition Config.h:30
virtual const ResourceLifecycleManager * getResourceLifecycleManager() const
Definition CmsAccessor.h:63
virtual cms::Connection * createConnection()
Create a CMS Connection via this template's ConnectionFactory.
virtual void setConnectionFactory(cms::ConnectionFactory *connectionFactory)
Set the ConnectionFactory to use for obtaining CMS Connections.
Definition CmsAccessor.h:70
virtual void init()
Initializes this object and prepares it for use.
virtual void setSessionAcknowledgeMode(cms::Session::AcknowledgeMode sessionAcknowledgeMode)
Set the CMS acknowledgment mode that is used when creating a CMS Session to send a message.
Definition CmsAccessor.h:98
virtual cms::ConnectionFactory * getConnectionFactory()
Return the ConnectionFactory that this accessor uses for obtaining CMS Connections.
Definition CmsAccessor.h:86
virtual const cms::ConnectionFactory * getConnectionFactory() const
Return the ConnectionFactory that this accessor uses for obtaining CMS Connections.
Definition CmsAccessor.h:78
virtual cms::Session * createSession(cms::Connection *con)
Create a CMS Session for the given Connection.
virtual cms::Session::AcknowledgeMode getSessionAcknowledgeMode() const
Return the acknowledgment mode for CMS sessions.
Definition CmsAccessor.h:107
virtual ResourceLifecycleManager * getResourceLifecycleManager()
Definition CmsAccessor.h:59
CmsAccessor(const CmsAccessor &)
virtual void destroy()
Shuts down this object and destroys any allocated resources.
Definition CmsAccessor.h:128
CmsAccessor & operator=(const CmsAccessor &)
virtual void checkConnectionFactory()
Verifies that the connection factory is valid.
Manages the lifecycle of a set of CMS resources.
Definition ResourceLifecycleManager.h:37
Defines the interface for a factory that creates connection objects, the Connection objects returned ...
Definition ConnectionFactory.h:41
The client's connection to its provider.
Definition Connection.h:70
A Session object is a single-threaded context for producing and consuming messages.
Definition Session.h:105
AcknowledgeMode
Definition Session.h:108
Definition CachedConsumer.h:25
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24