activemq-cpp-3.8.2
FifoMessageDispatchChannel.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_CORE_FIFOMESSAGEDISPATCHCHANNEL_H_
19 #define _ACTIVEMQ_CORE_FIFOMESSAGEDISPATCHCHANNEL_H_
20 
21 #include <activemq/util/Config.h>
23 
24 #include <decaf/util/LinkedList.h>
25 #include <decaf/lang/Pointer.h>
26 
27 namespace activemq {
28 namespace core {
29 
31  private:
32 
33  bool closed;
34  bool running;
35 
37 
38  private:
39 
42 
43  public:
44 
46 
47  virtual ~FifoMessageDispatchChannel();
48 
49  virtual void enqueue(const Pointer<MessageDispatch>& message);
50 
51  virtual void enqueueFirst(const Pointer<MessageDispatch>& message);
52 
53  virtual bool isEmpty() const;
54 
55  virtual bool isClosed() const {
56  return this->closed;
57  }
58 
59  virtual bool isRunning() const {
60  return this->running;
61  }
62 
63  virtual Pointer<MessageDispatch> dequeue(long long timeout);
64 
65  virtual Pointer<MessageDispatch> dequeueNoWait();
66 
67  virtual Pointer<MessageDispatch> peek() const;
68 
69  virtual void start();
70 
71  virtual void stop();
72 
73  virtual void close();
74 
75  virtual void clear();
76 
77  virtual int size() const;
78 
79  virtual std::vector<Pointer<MessageDispatch> > removeAll();
80 
81  public:
82 
83  virtual void lock() {
84  channel.lock();
85  }
86 
87  virtual bool tryLock() {
88  return channel.tryLock();
89  }
90 
91  virtual void unlock() {
92  channel.unlock();
93  }
94 
95  virtual void wait() {
96  channel.wait();
97  }
98 
99  virtual void wait(long long millisecs) {
100  channel.wait(millisecs);
101  }
102 
103  virtual void wait(long long millisecs, int nanos) {
104  channel.wait(millisecs, nanos);
105  }
106 
107  virtual void notify() {
108  channel.notify();
109  }
110 
111  virtual void notifyAll() {
112  channel.notifyAll();
113  }
114 
115  };
116 
117 }}
118 
119 #endif /* _ACTIVEMQ_CORE_FIFOMESSAGEDISPATCHCHANNEL_H_ */
virtual bool tryLock()
Attempts to Lock the object, if the lock is already held by another thread than this method returns f...
Definition: FifoMessageDispatchChannel.h:87
#define AMQCPP_API
Definition: Config.h:30
virtual void notifyAll()
Signals the waiters on this object that it can now wake up and continue.
Definition: FifoMessageDispatchChannel.h:111
virtual bool isRunning() const
Definition: FifoMessageDispatchChannel.h:59
virtual void wait()
Waits on a signal from this object, which is generated by a call to Notify.
Definition: FifoMessageDispatchChannel.h:95
virtual bool tryLock()=0
Attempts to Lock the object, if the lock is already held by another thread than this method returns f...
virtual void notify()=0
Signals a waiter on this object that it can now wake up and continue.
virtual void wait(long long millisecs, int nanos)
Waits on a signal from this object, which is generated by a call to Notify.
Definition: FifoMessageDispatchChannel.h:103
virtual void lock()
Locks the object.
Definition: FifoMessageDispatchChannel.h:83
virtual void unlock()=0
Unlocks the object.
Definition: FifoMessageDispatchChannel.h:30
virtual bool isClosed() const
Definition: FifoMessageDispatchChannel.h:55
virtual void notify()
Signals a waiter on this object that it can now wake up and continue.
Definition: FifoMessageDispatchChannel.h:107
virtual void unlock()
Unlocks the object.
Definition: FifoMessageDispatchChannel.h:91
virtual void lock()=0
Locks the object.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Definition: MessageDispatchChannel.h:34
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
virtual void wait()=0
Waits on a signal from this object, which is generated by a call to Notify.
virtual void notifyAll()=0
Signals the waiters on this object that it can now wake up and continue.
virtual void wait(long long millisecs)
Waits on a signal from this object, which is generated by a call to Notify.
Definition: FifoMessageDispatchChannel.h:99
A complete implementation of the List interface using a doubly linked list data structure.
Definition: LinkedList.h:55