1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_diameter_comm_TimerManager_hpp
10 #define anna_diameter_comm_TimerManager_hpp
12 #include <anna/config/defines.hpp>
13 #include <anna/core/util/Recycler.hpp>
14 #include <anna/core/Singleton.hpp>
15 #include <anna/timex/TimeEventObserver.hpp>
16 #include <anna/core/RuntimeException.hpp>
19 #include <anna/diameter.comm/Timer.hpp>
43 Timer Manager for Diameter Requests and client-session events
45 class TimerManager : public anna::timex::TimeEventObserver, public anna::Singleton <TimerManager> {
46 typedef anna::Recycler <anna::diameter::comm::Timer> timer_container;
48 timer_container a_timers;
49 anna::timex::Engine* a_timeController;
52 TimerManager(const TimerManager&);
53 virtual ~TimerManager() {;}
55 Timer* createTimer(Response*) throw(anna::RuntimeException);
56 Timer* createTimer(Session*, const anna::diameter::comm::Timer::Type::_v type) throw(anna::RuntimeException);
57 Timer* createTimer(LocalServer*) throw(anna::RuntimeException);
59 void cancelTimer(Timer*) throw();
61 void release(anna::timex::TimeEvent*) throw();
63 friend class anna::Singleton <TimerManager>;
64 friend class Response;
66 friend class LocalServer;