activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
TransactionState.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_STATE_TRANSACTIONSTATE_H_
19
#define _ACTIVEMQ_STATE_TRANSACTIONSTATE_H_
20
21
#include <
activemq/util/Config.h
>
22
#include <
activemq/commands/Command.h
>
23
#include <
activemq/commands/ProducerId.h
>
24
#include <
activemq/commands/TransactionId.h
>
25
26
#include <
decaf/lang/Pointer.h
>
27
#include <
decaf/util/LinkedList.h
>
28
#include <
decaf/util/concurrent/atomic/AtomicBoolean.h
>
29
#include <
decaf/util/concurrent/ConcurrentStlMap.h
>
30
31
#include <string>
32
#include <memory>
33
34
namespace
activemq {
35
namespace
state {
36
37
using
decaf::lang::Pointer
;
38
using
decaf::util::LinkedList
;
39
using
decaf::util::concurrent::atomic::AtomicBoolean
;
40
using
decaf::util::concurrent::ConcurrentStlMap
;
41
using namespace
activemq::commands;
42
43
class
ProducerState;
44
45
class
AMQCPP_API
TransactionState
{
46
private
:
47
48
LinkedList< Pointer<Command>
> commands;
49
Pointer<TransactionId>
id;
50
AtomicBoolean
disposed;
51
bool
prepared;
52
int
preparedResult;
53
ConcurrentStlMap<Pointer<ProducerId>
,
Pointer<ProducerState>
,
54
ProducerId::COMPARATOR
> producers;
55
56
private
:
57
58
TransactionState
(
const
TransactionState
&);
59
TransactionState
& operator=(
const
TransactionState
&);
60
61
public
:
62
63
TransactionState
(
Pointer<TransactionId>
id
);
64
65
virtual
~
TransactionState
();
66
67
std::string toString()
const
;
68
69
void
addCommand(
Pointer<Command>
operation);
70
71
void
checkShutdown()
const
;
72
73
void
shutdown();
74
75
void
clear();
76
77
const
LinkedList<Pointer<Command>
>&
getCommands
()
const
{
78
return
commands;
79
}
80
81
const
Pointer<TransactionId>
getId
()
const
{
82
return
id;
83
}
84
85
void
setPrepared
(
bool
prepared) {
86
this->prepared = prepared;
87
}
88
89
bool
isPrepared
()
const
{
90
return
this->prepared;
91
}
92
93
void
setPreparedResult
(
int
preparedResult) {
94
this->preparedResult = preparedResult;
95
}
96
97
int
getPreparedResult
()
const
{
98
return
this->preparedResult;
99
}
100
101
void
addProducerState(
Pointer<ProducerState>
producerState);
102
103
const
decaf::util::Collection<Pointer<ProducerState>
>& getProducerStates();
104
105
};
106
107
}}
108
109
#endif
/*_ACTIVEMQ_STATE_TRANSACTIONSTATE_H_*/
src
main
activemq
state
TransactionState.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2