activemq-cpp-3.9.5
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
25
26#include <decaf/lang/Pointer.h>
30
31#include <string>
32#include <memory>
33
34namespace activemq {
35namespace 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
50 AtomicBoolean disposed;
51 bool prepared;
52 int preparedResult;
54 ProducerId::COMPARATOR> producers;
55
56 private:
57
58 TransactionState(const TransactionState&);
59 TransactionState& operator=(const TransactionState&);
60
61 public:
62
64
66
67 std::string toString() const;
68
70
71 void checkShutdown() const;
72
73 void shutdown();
74
75 void clear();
76
78 return commands;
79 }
80
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
102
104
105 };
106
107}}
108
109#endif /*_ACTIVEMQ_STATE_TRANSACTIONSTATE_H_*/
#define AMQCPP_API
Definition Config.h:30
decaf::lang::PointerComparator< ProducerId > COMPARATOR
Definition ProducerId.h:59
Definition ProducerState.h:37
bool isPrepared() const
Definition TransactionState.h:89
void setPrepared(bool prepared)
Definition TransactionState.h:85
void addCommand(Pointer< Command > operation)
TransactionState(Pointer< TransactionId > id)
const Pointer< TransactionId > getId() const
Definition TransactionState.h:81
const decaf::util::Collection< Pointer< ProducerState > > & getProducerStates()
const LinkedList< Pointer< Command > > & getCommands() const
Definition TransactionState.h:77
int getPreparedResult() const
Definition TransactionState.h:97
void setPreparedResult(int preparedResult)
Definition TransactionState.h:93
void addProducerState(Pointer< ProducerState > producerState)
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
The root interface in the collection hierarchy.
Definition Collection.h:69
A complete implementation of the List interface using a doubly linked list data structure.
Definition LinkedList.h:55
Map template that wraps around a std::map to provide a more user-friendly interface and to provide co...
Definition ConcurrentStlMap.h:51
A boolean value that may be updated atomically.
Definition AtomicBoolean.h:34
Definition Command.h:28
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24