/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/broker/MessageStoreModule.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 #ifndef _MessageStoreModule_
00022 #define _MessageStoreModule_
00023 
00024 #include "MessageStore.h"
00025 #include "Queue.h"
00026 #include "RecoveryManager.h"
00027 
00028 #include "qpid/sys/Module.h"
00029 
00030 #include <boost/intrusive_ptr.hpp>
00031 
00032 namespace qpid {
00033 namespace broker {
00034 
00038 class MessageStoreModule : public MessageStore
00039 {
00040     MessageStore* store;
00041 public:
00042     MessageStoreModule(MessageStore* store);
00043 
00044         bool init(const Options* options);
00045     std::auto_ptr<TransactionContext> begin();
00046     std::auto_ptr<TPCTransactionContext> begin(const std::string& xid);
00047     void prepare(TPCTransactionContext& txn);
00048     void commit(TransactionContext& txn);
00049     void abort(TransactionContext& txn);
00050     void collectPreparedXids(std::set<std::string>& xids);
00051 
00052     void create(PersistableQueue& queue, const framing::FieldTable& args);
00053     void destroy(PersistableQueue& queue);
00054     void create(const PersistableExchange& exchange, const framing::FieldTable& args);
00055     void destroy(const PersistableExchange& exchange);
00056     void bind(const PersistableExchange& exchange, const PersistableQueue& queue, 
00057               const std::string& key, const framing::FieldTable& args);
00058     void unbind(const PersistableExchange& exchange, const PersistableQueue& queue, 
00059                 const std::string& key, const framing::FieldTable& args);
00060     void recover(RecoveryManager& queues);
00061     void stage(boost::intrusive_ptr<PersistableMessage>& msg);
00062     void destroy(PersistableMessage& msg);
00063     void appendContent(boost::intrusive_ptr<const PersistableMessage>& msg, const std::string& data);
00064     void loadContent(const qpid::broker::PersistableQueue& queue, 
00065                   boost::intrusive_ptr<const PersistableMessage>& msg, std::string& data,
00066               uint64_t offset, uint32_t length);
00067 
00068     void enqueue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00069                  const PersistableQueue& queue);
00070     void dequeue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00071                  const PersistableQueue& queue);
00072     u_int32_t outstandingQueueAIO(const PersistableQueue& queue);
00073     void flush(const qpid::broker::PersistableQueue& queue);
00074          
00075     ~MessageStoreModule();
00076 };
00077 
00078 }
00079 }
00080 
00081 
00082 #endif

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7