activemq-cpp-3.8.2
SessionState.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_SESSIONSTATE_H_
19 #define _ACTIVEMQ_STATE_SESSIONSTATE_H_
20 
21 #include <activemq/util/Config.h>
27 
30 
31 #include <string>
32 
33 namespace activemq {
34 namespace state {
35 
39  using namespace activemq::commands;
40 
42  private:
43 
45 
48  ProducerId::COMPARATOR> producers;
49 
52  ConsumerId::COMPARATOR> consumers;
53 
54  AtomicBoolean disposed;
55 
56  private:
57 
58  SessionState(const SessionState&);
59  SessionState& operator=(const SessionState&);
60 
61  public:
62 
64 
65  virtual ~SessionState();
66 
67  std::string toString() const;
68 
69  const Pointer<SessionInfo> getInfo() const {
70  return this->info;
71  }
72 
73  void addProducer(Pointer<ProducerInfo> info);
74 
75  Pointer<ProducerState> removeProducer(Pointer<ProducerId> id);
76 
77  void addConsumer(Pointer<ConsumerInfo> info);
78 
79  Pointer<ConsumerState> removeConsumer(Pointer<ConsumerId> id);
80 
82  return producers.values();
83  }
84 
85  Pointer<ProducerState> getProducerState(Pointer<ProducerId> id) {
86  return producers.get(id);
87  }
88 
90  return consumers.values();
91  }
92 
93  Pointer<ConsumerState> getConsumerState(Pointer<ConsumerId> id) {
94  return consumers.get(id);
95  }
96 
97  void checkShutdown() const;
98 
99  void shutdown();
100 
101  };
102 
103 }}
104 
105 #endif /*_ACTIVEMQ_STATE_SESSIONSTATE_H_*/
The root interface in the collection hierarchy.
Definition: Collection.h:68
#define AMQCPP_API
Definition: Config.h:30
Definition: ActiveMQBlobMessage.h:28
virtual Collection< V > & values()
Returns a Collection view of the values contained in this map.
Definition: ConcurrentStlMap.h:1092
const decaf::util::Collection< Pointer< ProducerState > > & getProducerStates() const
Definition: SessionState.h:81
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
const Pointer< SessionInfo > getInfo() const
Definition: SessionState.h:69
Pointer< ProducerState > getProducerState(Pointer< ProducerId > id)
Definition: SessionState.h:85
const decaf::util::Collection< Pointer< ConsumerState > > & getConsumerStates() const
Definition: SessionState.h:89
virtual V & get(const K &key)
Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is ...
Definition: ConcurrentStlMap.h:829
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Definition: SessionState.h:41
This implementation of Comparator is designed to allows objects in a Collection to be sorted or teste...
Definition: Pointer.h:366
Pointer< ConsumerState > getConsumerState(Pointer< ConsumerId > id)
Definition: SessionState.h:93
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