activemq-cpp-3.3.0

src/main/activemq/core/MessageDispatchChannel.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef _ACTIVEMQ_CORE_MESSAGEDISPATCHCHANNEL_H_
00019 #define _ACTIVEMQ_CORE_MESSAGEDISPATCHCHANNEL_H_
00020 
00021 #include <activemq/util/Config.h>
00022 #include <activemq/commands/MessageDispatch.h>
00023 
00024 #include <decaf/util/concurrent/Mutex.h>
00025 #include <decaf/util/concurrent/Synchronizable.h>
00026 #include <decaf/lang/Pointer.h>
00027 
00028 namespace activemq {
00029 namespace core {
00030 
00031     using decaf::lang::Pointer;
00032     using activemq::commands::MessageDispatch;
00033 
00034     class AMQCPP_API MessageDispatchChannel : public decaf::util::concurrent::Synchronizable {
00035     public:
00036 
00037         virtual ~MessageDispatchChannel() {}
00038 
00044         virtual void enqueue( const Pointer<MessageDispatch>& message ) = 0;
00045 
00051         virtual void enqueueFirst( const Pointer<MessageDispatch>& message ) = 0;
00052 
00056         virtual bool isEmpty() const = 0;
00057 
00061         virtual bool isClosed() const = 0;
00062 
00066         virtual bool isRunning() const = 0;
00067 
00079         virtual Pointer<MessageDispatch> dequeue( long long timeout ) = 0;
00080 
00087         virtual Pointer<MessageDispatch> dequeueNoWait() = 0;
00088 
00095         virtual Pointer<MessageDispatch> peek() const = 0;
00096 
00100         virtual void start() = 0;
00101 
00105         virtual void stop() = 0;
00106 
00110         virtual void close() = 0;
00111 
00115         virtual void clear() = 0;
00116 
00120         virtual int size() const = 0;
00121 
00128         virtual std::vector< Pointer<MessageDispatch> > removeAll() = 0;
00129 
00130     };
00131 
00132 }}
00133 
00134 #endif /* _ACTIVEMQ_CORE_MESSAGEDISPATCHCHANNEL_H_ */