activemq-cpp-3.9.5
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
27
30
31#include <string>
32
33namespace activemq {
34namespace state {
35
36 using decaf::lang::Pointer;
37 using decaf::util::concurrent::ConcurrentStlMap;
38 using decaf::util::concurrent::atomic::AtomicBoolean;
39 using namespace activemq::commands;
40
41 class AMQCPP_API SessionState {
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
70 return this->info;
71 }
72
74
76
78
80
82 return producers.values();
83 }
84
86 return producers.get(id);
87 }
88
90 return consumers.values();
91 }
92
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_*/
#define AMQCPP_API
Definition Config.h:30
decaf::lang::PointerComparator< ConsumerId > COMPARATOR
Definition ConsumerId.h:59
decaf::lang::PointerComparator< ProducerId > COMPARATOR
Definition ProducerId.h:59
SessionState(Pointer< SessionInfo > info)
Pointer< ProducerState > removeProducer(Pointer< ProducerId > id)
const decaf::util::Collection< Pointer< ConsumerState > > & getConsumerStates() const
Definition SessionState.h:89
void addConsumer(Pointer< ConsumerInfo > info)
Pointer< ConsumerState > getConsumerState(Pointer< ConsumerId > id)
Definition SessionState.h:93
const Pointer< SessionInfo > getInfo() const
Definition SessionState.h:69
std::string toString() const
Pointer< ConsumerState > removeConsumer(Pointer< ConsumerId > id)
Pointer< ProducerState > getProducerState(Pointer< ProducerId > id)
Definition SessionState.h:85
void addProducer(Pointer< ProducerInfo > info)
const decaf::util::Collection< Pointer< ProducerState > > & getProducerStates() const
Definition SessionState.h:81
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
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