From 15a915878c787e6d5ed8330a8dd4375ec885a6c0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 3 Nov 2006 13:44:21 +0000 Subject: Added some methods to MessageStore interface and hooked these in where appropriate. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@470810 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp') diff --git a/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp b/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp index 9883c94a25..76723881dc 100644 --- a/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp +++ b/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp @@ -33,7 +33,9 @@ const std::string amq_fanout("amq.fanout"); const std::string amq_match("amq.match"); } -SessionHandlerFactoryImpl::SessionHandlerFactoryImpl(u_int32_t _timeout) : timeout(_timeout), cleaner(&queues, timeout/10){ +SessionHandlerFactoryImpl::SessionHandlerFactoryImpl(u_int32_t _timeout) : + queues(store.get()), timeout(_timeout), cleaner(&queues, timeout/10) +{ exchanges.declare(empty, DirectExchange::typeName); // Default exchange. exchanges.declare(amq_direct, DirectExchange::typeName); exchanges.declare(amq_topic, TopicExchange::typeName); @@ -42,10 +44,17 @@ SessionHandlerFactoryImpl::SessionHandlerFactoryImpl(u_int32_t _timeout) : timeo cleaner.start(); } -SessionHandler* SessionHandlerFactoryImpl::create(SessionContext* ctxt){ +void SessionHandlerFactoryImpl::recover() +{ + if(store.get()) store->recover(queues); +} + +SessionHandler* SessionHandlerFactoryImpl::create(SessionContext* ctxt) +{ return new SessionHandlerImpl(ctxt, &queues, &exchanges, &cleaner, timeout); } -SessionHandlerFactoryImpl::~SessionHandlerFactoryImpl(){ +SessionHandlerFactoryImpl::~SessionHandlerFactoryImpl() +{ cleaner.stop(); } -- cgit v1.2.1