activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
SessionPool.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_SESSIONPOOL_H_
19
#define _ACTIVEMQ_CMSUTIL_SESSIONPOOL_H_
20
21
#include <
activemq/cmsutil/PooledSession.h
>
22
#include <
decaf/util/concurrent/Mutex.h
>
23
#include <
cms/Connection.h
>
24
#include <list>
25
#include <
activemq/util/Config.h
>
26
27
namespace
activemq {
28
namespace
cmsutil {
29
30
// Forward declarations.
31
class
ResourceLifecycleManager;
32
39
class
AMQCPP_API
SessionPool
{
40
private
:
41
42
cms::Connection
* connection;
43
44
ResourceLifecycleManager
* resourceLifecycleManager;
45
46
decaf::util::concurrent::Mutex
mutex;
47
48
std::list<PooledSession*> available;
49
50
std::list<PooledSession*> sessions;
51
52
cms::Session::AcknowledgeMode
acknowledgeMode;
53
54
private
:
55
56
SessionPool
(
const
SessionPool
&);
57
SessionPool
& operator=(
const
SessionPool
&);
58
59
public
:
60
71
SessionPool
(
cms::Connection
* connection,
72
cms::Session::AcknowledgeMode
ackMode,
73
ResourceLifecycleManager
* resourceLifecycleManager);
74
79
virtual
~
SessionPool
();
80
88
virtual
PooledSession
* takeSession();
89
96
virtual
void
returnSession(
PooledSession
* session);
97
98
ResourceLifecycleManager
*
getResourceLifecycleManager
() {
99
return
resourceLifecycleManager;
100
}
101
102
};
103
104
}}
105
106
#endif
/*_ACTIVEMQ_CMSUTIL_SESSIONPOOL_H_*/
src
main
activemq
cmsutil
SessionPool.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2