activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
BackupTransportPool.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_TRANSPORT_FAILOVER_BACKUPTRANSPORTPOOL_H_
19
#define _ACTIVEMQ_TRANSPORT_FAILOVER_BACKUPTRANSPORTPOOL_H_
20
21
#include <
activemq/util/Config.h
>
22
#include <
activemq/threads/CompositeTask.h
>
23
#include <
activemq/threads/CompositeTaskRunner.h
>
24
#include <
activemq/transport/failover/CloseTransportsTask.h
>
25
#include <
activemq/transport/failover/BackupTransport.h
>
26
#include <
activemq/transport/failover/URIPool.h
>
27
28
#include <
decaf/lang/Pointer.h
>
29
#include <
decaf/io/IOException.h
>
30
#include <
decaf/util/LinkedList.h
>
31
32
namespace
activemq {
33
namespace
transport {
34
namespace
failover {
35
36
using
decaf::lang::Pointer
;
37
using
decaf::util::LinkedList
;
38
using
activemq::threads::CompositeTaskRunner
;
39
40
class
BackupTransportPoolImpl;
41
class
FailoverTransport;
42
43
class
AMQCPP_API
BackupTransportPool
:
public
activemq::threads::CompositeTask
{
44
private
:
45
46
friend
class
BackupTransport
;
47
48
BackupTransportPoolImpl* impl;
49
50
FailoverTransport
* parent;
51
Pointer<CompositeTaskRunner>
taskRunner;
52
Pointer<CloseTransportsTask>
closeTask;
53
Pointer<URIPool>
uriPool;
54
Pointer<URIPool>
updates;
55
Pointer<URIPool>
priorityUriPool;
56
volatile
int
backupPoolSize;
57
volatile
bool
enabled;
58
volatile
int
maxReconnectDelay;
59
60
public
:
61
62
BackupTransportPool
(
FailoverTransport
* parent,
63
const
Pointer<CompositeTaskRunner>
taskRunner,
64
const
Pointer<CloseTransportsTask>
closeTask,
65
const
Pointer<URIPool>
uriPool,
66
const
Pointer<URIPool>
updates,
67
const
Pointer<URIPool>
priorityUriPool);
68
69
BackupTransportPool
(
FailoverTransport
* parent,
70
int
backupPoolSize,
71
const
Pointer<CompositeTaskRunner>
taskRunner,
72
const
Pointer<CloseTransportsTask>
closeTask,
73
const
Pointer<URIPool>
uriPool,
74
const
Pointer<URIPool>
updates,
75
const
Pointer<URIPool>
priorityUriPool);
76
77
virtual
~
BackupTransportPool
();
78
82
void
close();
83
87
virtual
bool
isPending()
const
;
88
95
Pointer<BackupTransport>
getBackup();
96
101
virtual
bool
iterate();
102
107
int
getBackupPoolSize
()
const
{
108
return
this->backupPoolSize;
109
}
110
115
void
setBackupPoolSize
(
int
size) {
116
this->backupPoolSize = size;
117
}
118
125
bool
isEnabled
()
const
{
126
return
this->enabled;
127
}
128
135
void
setEnabled(
bool
value);
136
143
bool
isPriorityBackupAvailable()
const
;
144
145
private
:
146
147
// The backups report their failure to the pool, the pool removes them
148
// from the list and returns their URIs to the URIPool, and then adds
149
// the internal transport to the close transport's task for cleanup.
150
void
onBackupTransportFailure(
BackupTransport
* failedTransport);
151
152
Pointer<Transport>
createTransport(
const
decaf::net::URI
& location)
const
;
153
154
};
155
156
}}}
157
158
#endif
/*_ACTIVEMQ_TRANSPORT_FAILOVER_BACKUPTRANSPORTPOOL_H_*/
src
main
activemq
transport
failover
BackupTransportPool.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2