activemq-cpp-3.8.2
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>
25 
26 #include <decaf/lang/Pointer.h>
27 #include <decaf/util/LinkedList.h>
30 
31 #include <string>
32 #include <memory>
33 
34 namespace activemq {
35 namespace state {
36 
41  using namespace activemq::commands;
42 
43  class ProducerState;
44 
46  private:
47 
50  AtomicBoolean disposed;
51  bool prepared;
52  int preparedResult;
54  ProducerId::COMPARATOR> producers;
55 
56  private:
57 
59  TransactionState& operator=(const TransactionState&);
60 
61  public:
62 
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 
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_*/
The root interface in the collection hierarchy.
Definition: Collection.h:68
int getPreparedResult() const
Definition: TransactionState.h:97
#define AMQCPP_API
Definition: Config.h:30
void setPrepared(bool prepared)
Definition: TransactionState.h:85
Definition: ActiveMQBlobMessage.h:28
void setPreparedResult(int preparedResult)
Definition: TransactionState.h:93
Definition: TransactionState.h:45
Map template that wraps around a std::map to provide a more user-friendly interface and to provide co...
Definition: ConcurrentStlMap.h:51
const Pointer< TransactionId > getId() const
Definition: TransactionState.h:81
A boolean value that may be updated atomically.
Definition: AtomicBoolean.h:34
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
const LinkedList< Pointer< Command > > & getCommands() const
Definition: TransactionState.h:77
bool isPrepared() const
Definition: TransactionState.h:89
This implementation of Comparator is designed to allows objects in a Collection to be sorted or teste...
Definition: Pointer.h:366
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
A complete implementation of the List interface using a doubly linked list data structure.
Definition: LinkedList.h:55